summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGDeclCXX.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/CodeGen/CGDeclCXX.cpp')
-rw-r--r--clang/lib/CodeGen/CGDeclCXX.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CGDeclCXX.cpp b/clang/lib/CodeGen/CGDeclCXX.cpp
index 5b172a3480b..95bd0001039 100644
--- a/clang/lib/CodeGen/CGDeclCXX.cpp
+++ b/clang/lib/CodeGen/CGDeclCXX.cpp
@@ -244,6 +244,8 @@ llvm::Function *CodeGenFunction::createAtExitStub(const VarDecl &VD,
CGF.StartFunction(GlobalDecl(&VD, DynamicInitKind::AtExit),
CGM.getContext().VoidTy, fn, FI, FunctionArgList());
+ // Emit an artificial location for this function.
+ auto AL = ApplyDebugLocation::CreateArtificial(CGF);
llvm::CallInst *call = CGF.Builder.CreateCall(dtor, addr);
@@ -644,8 +646,9 @@ void CodeGenFunction::GenerateCXXGlobalVarDeclInitFunc(llvm::Function *Fn,
StartFunction(GlobalDecl(D, DynamicInitKind::Initializer),
getContext().VoidTy, Fn, getTypes().arrangeNullaryFunction(),
- FunctionArgList(), D->getLocation(),
- D->getInit()->getExprLoc());
+ FunctionArgList());
+ // Emit an artificial location for this function.
+ auto AL = ApplyDebugLocation::CreateArtificial(*this);
// Use guarded initialization if the global variable is weak. This
// occurs for, e.g., instantiated static data members and
@@ -770,7 +773,10 @@ llvm::Function *CodeGenFunction::generateDestroyHelper(
CurEHLocation = VD->getBeginLoc();
- StartFunction(VD, getContext().VoidTy, fn, FI, args);
+ StartFunction(GlobalDecl(VD, DynamicInitKind::GlobalArrayDestructor),
+ getContext().VoidTy, fn, FI, args);
+ // Emit an artificial location for this function.
+ auto AL = ApplyDebugLocation::CreateArtificial(*this);
emitDestroy(addr, type, destroyer, useEHCleanupForArray);
OpenPOWER on IntegriCloud