summaryrefslogtreecommitdiff
path: root/lib/CodeGen/CodeGenFunction.h
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2014-04-10 23:21:53 +0000
committerAdrian Prantl <aprantl@apple.com>2014-04-10 23:21:53 +0000
commit9a7c2b4dfae18c6826c6e8caed450f39efdf3ab3 (patch)
treeb6f9cc3a99dc0d8cfd25bf38a94fb86b78513aed /lib/CodeGen/CodeGenFunction.h
parentf31150259598511e7b061eb48758c2a64f02ffb3 (diff)
downloadclang-9a7c2b4dfae18c6826c6e8caed450f39efdf3ab3.tar.gz
clang-9a7c2b4dfae18c6826c6e8caed450f39efdf3ab3.tar.bz2
clang-9a7c2b4dfae18c6826c6e8caed450f39efdf3ab3.tar.xz
Debug info: (Bugfix) Make sure artificial functions like _GLOBAL__I_a
are not associated with any source lines. Previously, if the Location of a Decl was empty, EmitFunctionStart would just keep using CurLoc, which would sometimes be correct (e.g., thunks) but in other cases would just point to a hilariously random location. This patch fixes this by completely eliminating all uses of CurLoc from EmitFunctionStart and rather have clients explicitly pass in a SourceLocation for the function header and the function body. rdar://problem/14985269 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@205999 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenFunction.h')
-rw-r--r--lib/CodeGen/CodeGenFunction.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/CodeGen/CodeGenFunction.h b/lib/CodeGen/CodeGenFunction.h
index 5b0653adc6..56ad76ae92 100644
--- a/lib/CodeGen/CodeGenFunction.h
+++ b/lib/CodeGen/CodeGenFunction.h
@@ -1140,11 +1140,15 @@ public:
void GenerateCode(GlobalDecl GD, llvm::Function *Fn,
const CGFunctionInfo &FnInfo);
+ /// \brief Emit code for the start of a function.
+ /// \param Loc The location to be associated with the function.
+ /// \param StartLoc The location of the function body.
void StartFunction(GlobalDecl GD,
QualType RetTy,
llvm::Function *Fn,
const CGFunctionInfo &FnInfo,
const FunctionArgList &Args,
+ SourceLocation Loc,
SourceLocation StartLoc);
void EmitConstructorBody(FunctionArgList &Args);