diff options
author | Adrian Prantl <aprantl@apple.com> | 2014-04-10 23:21:53 +0000 |
---|---|---|
committer | Adrian Prantl <aprantl@apple.com> | 2014-04-10 23:21:53 +0000 |
commit | 42d71b990677afc974c404fb0482cb5af176c3d0 (patch) | |
tree | 6d64b36a9012e29d0d7df47de3f55f4ad3f70a12 /clang/lib/CodeGen/CodeGenFunction.h | |
parent | fb873af67ed23e6aa445b44d253fb156d07bdebc (diff) | |
download | llvm-42d71b990677afc974c404fb0482cb5af176c3d0.zip llvm-42d71b990677afc974c404fb0482cb5af176c3d0.tar.gz llvm-42d71b990677afc974c404fb0482cb5af176c3d0.tar.bz2 |
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
llvm-svn: 205999
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.h')
-rw-r--r-- | clang/lib/CodeGen/CodeGenFunction.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.h b/clang/lib/CodeGen/CodeGenFunction.h index 5b0653a..56ad76a 100644 --- a/clang/lib/CodeGen/CodeGenFunction.h +++ b/clang/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); |