diff options
author | Eric Christopher <echristo@apple.com> | 2012-03-30 01:07:48 +0000 |
---|---|---|
committer | Eric Christopher <echristo@apple.com> | 2012-03-30 01:07:48 +0000 |
commit | df02b36a2c16e87279047ef4c190add84a18f4af (patch) | |
tree | 875ce88c0666b8c535e3692acd188df12c40c924 /clang/lib/CodeGen/CGDebugInfo.cpp | |
parent | 219cf31f7d3ebbad8caed50c49ae7c2f04181e17 (diff) | |
download | bcm5719-llvm-df02b36a2c16e87279047ef4c190add84a18f4af.tar.gz bcm5719-llvm-df02b36a2c16e87279047ef4c190add84a18f4af.zip |
Change location information for synthesized properties to be at the
property file/line rather than the @synthesize file/line. Avoids
some nasty confusing-ness with conflating the file from the scope
and the line from the original declaration.
Update a couple of testcases accordingly since I had to change
that we actually use the passed in location in EmitFunctionStart.
Fixes rdar://11026482
llvm-svn: 153714
Diffstat (limited to 'clang/lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGDebugInfo.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp index af55a86a590..780993ac92a 100644 --- a/clang/lib/CodeGen/CGDebugInfo.cpp +++ b/clang/lib/CodeGen/CGDebugInfo.cpp @@ -1969,9 +1969,11 @@ void CGDebugInfo::EmitFunctionStart(GlobalDecl GD, QualType FnType, FnBeginRegionCount.push_back(LexicalBlockStack.size()); const Decl *D = GD.getDecl(); + // Use the location of the declaration. + SourceLocation Loc = D->getLocation(); unsigned Flags = 0; - llvm::DIFile Unit = getOrCreateFile(CurLoc); + llvm::DIFile Unit = getOrCreateFile(Loc); llvm::DIDescriptor FDContext(Unit); llvm::DIArray TParamsArray; if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(D)) { @@ -2015,10 +2017,7 @@ void CGDebugInfo::EmitFunctionStart(GlobalDecl GD, QualType FnType, if (!Name.empty() && Name[0] == '\01') 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. - unsigned LineNo = getLineNumber(CurLoc); + unsigned LineNo = getLineNumber(Loc); if (D->isImplicit()) Flags |= llvm::DIDescriptor::FlagArtificial; llvm::DISubprogram SPDecl = getFunctionDeclaration(D); |