aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGDebugInfo.cpp
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2010-04-24 00:49:16 +0000
committerDevang Patel <dpatel@apple.com>2010-04-24 00:49:16 +0000
commit970c618c3f9ce7e010a30587118afc03434cfd99 (patch)
treec9187ecc437cdb2ea94403cd2fd134905f2b1a0c /lib/CodeGen/CGDebugInfo.cpp
parentf0bf4d554f2513cbb4bec952c81ced59279ad91e (diff)
Revert accidental check-in.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102226 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r--lib/CodeGen/CGDebugInfo.cpp18
1 files changed, 5 insertions, 13 deletions
diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp
index 7a9961b37f..2a5b7af712 100644
--- a/lib/CodeGen/CGDebugInfo.cpp
+++ b/lib/CodeGen/CGDebugInfo.cpp
@@ -1333,21 +1333,9 @@ void CGDebugInfo::EmitFunctionStart(GlobalDecl GD, QualType FnType,
llvm::StringRef Name;
MangleBuffer LinkageName;
- // It is expected that CurLoc is set before using EmitFunctionStart.
- // Usually, CurLoc points to the left bracket location of compound
- // statement representing function body.
- llvm::DIFile Unit = getOrCreateFile(CurLoc);
- llvm::DIDescriptor Context(Unit.getNode());
const Decl *D = GD.getDecl();
if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(D)) {
- if (const CXXMethodDecl *MD = dyn_cast<CXXMethodDecl>(FD)) {
- if (MD->isStatic()) {
- QualType RTy = CGM.getContext().getTypeDeclType(MD->getParent());
- Context = CreateType(RTy->getAs<RecordType>(), getOrCreateFile(CurLoc));
- }
- }
-
// If there is a DISubprogram for this function available then use it.
llvm::DenseMap<const FunctionDecl *, llvm::WeakVH>::iterator
FI = SPCache.find(FD);
@@ -1372,11 +1360,15 @@ void CGDebugInfo::EmitFunctionStart(GlobalDecl GD, QualType FnType,
Name = Name.substr(1);
}
+ // It is expected that CurLoc is set before using EmitFunctionStart.
+ // Usually, CurLoc points to the left bracket location of compound
+ // statement representing function body.
+ llvm::DIFile Unit = getOrCreateFile(CurLoc);
SourceManager &SM = CGM.getContext().getSourceManager();
unsigned LineNo = SM.getPresumedLoc(CurLoc).getLine();
llvm::DISubprogram SP =
- DebugFactory.CreateSubprogram(Context, Name, Name, LinkageName, Unit, LineNo,
+ DebugFactory.CreateSubprogram(Unit, Name, Name, LinkageName, Unit, LineNo,
getOrCreateType(FnType, Unit),
Fn->hasInternalLinkage(), true/*definition*/);