diff options
author | Alexey Samsonov <samsonov@google.com> | 2012-10-25 10:18:50 +0000 |
---|---|---|
committer | Alexey Samsonov <samsonov@google.com> | 2012-10-25 10:18:50 +0000 |
commit | 34b41f80aad3679c545a4ba9bca9c1a318d41844 (patch) | |
tree | 08aa80f7049b2162799a8dbaa4436351fbf67208 /lib/CodeGen/CGDeclCXX.cpp | |
parent | d9a2d5bdb747836917c2a5f7e12d075ec6762c77 (diff) |
Initialize debug info for special cases of functions that lack declarations and are generated by Clang (global initializers/destructors, thunks) . Fixes PR13942.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166676 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGDeclCXX.cpp')
-rw-r--r-- | lib/CodeGen/CGDeclCXX.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/CodeGen/CGDeclCXX.cpp b/lib/CodeGen/CGDeclCXX.cpp index 9f7ee1ecee..67f710db0e 100644 --- a/lib/CodeGen/CGDeclCXX.cpp +++ b/lib/CodeGen/CGDeclCXX.cpp @@ -163,6 +163,9 @@ static llvm::Constant *createAtExitStub(CodeGenModule &CGM, CodeGenFunction CGF(CGM); + // Initialize debug info if needed. + CGF.maybeInitializeDebugInfo(); + CGF.StartFunction(GlobalDecl(), CGM.getContext().VoidTy, fn, CGM.getTypes().arrangeNullaryFunction(), FunctionArgList(), SourceLocation()); @@ -345,6 +348,9 @@ void CodeGenFunction::GenerateCXXGlobalVarDeclInitFunc(llvm::Function *Fn, void CodeGenFunction::GenerateCXXGlobalInitFunc(llvm::Function *Fn, llvm::Constant **Decls, unsigned NumDecls) { + // Initialize debug info if needed. + maybeInitializeDebugInfo(); + StartFunction(GlobalDecl(), getContext().VoidTy, Fn, getTypes().arrangeNullaryFunction(), FunctionArgList(), SourceLocation()); @@ -370,6 +376,9 @@ void CodeGenFunction::GenerateCXXGlobalInitFunc(llvm::Function *Fn, void CodeGenFunction::GenerateCXXGlobalDtorsFunc(llvm::Function *Fn, const std::vector<std::pair<llvm::WeakVH, llvm::Constant*> > &DtorsAndObjects) { + // Initialize debug info if needed. + maybeInitializeDebugInfo(); + StartFunction(GlobalDecl(), getContext().VoidTy, Fn, getTypes().arrangeNullaryFunction(), FunctionArgList(), SourceLocation()); @@ -406,6 +415,9 @@ CodeGenFunction::generateDestroyHelper(llvm::Constant *addr, llvm::Function *fn = CreateGlobalInitOrDestructFunction(CGM, FTy, "__cxx_global_array_dtor"); + // Initialize debug info if needed. + maybeInitializeDebugInfo(); + StartFunction(GlobalDecl(), getContext().VoidTy, fn, FI, args, SourceLocation()); |