summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
diff options
context:
space:
mode:
authorAlexandre Ganea <alexandre.ganea@ubisoft.com>2019-09-05 20:12:20 +0000
committerAlexandre Ganea <alexandre.ganea@ubisoft.com>2019-09-05 20:12:20 +0000
commit31817731167135870259ef1e7387746345b96a2f (patch)
treeff3cdc475b28f59613e7fecac7af25cd39eeb2c4 /clang/lib/CodeGen
parentafd82492782fc97e39382509a079053633f57bb7 (diff)
downloadbcm5719-llvm-31817731167135870259ef1e7387746345b96a2f.tar.gz
bcm5719-llvm-31817731167135870259ef1e7387746345b96a2f.zip
Revert: [DebugInfo] Add debug location to stubs generated by CGDeclCXX and mark them as artificial
llvm-svn: 371113
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r--clang/lib/CodeGen/CGDebugInfo.cpp7
-rw-r--r--clang/lib/CodeGen/CGDeclCXX.cpp12
2 files changed, 5 insertions, 14 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp
index a9bc86b0547..e36f6932f86 100644
--- a/clang/lib/CodeGen/CGDebugInfo.cpp
+++ b/clang/lib/CodeGen/CGDebugInfo.cpp
@@ -1910,8 +1910,7 @@ StringRef CGDebugInfo::getDynamicInitializerName(const VarDecl *VD,
llvm::Function *InitFn) {
// If we're not emitting codeview, use the mangled name. For Itanium, this is
// arbitrary.
- if (!CGM.getCodeGenOpts().EmitCodeView ||
- StubKind == DynamicInitKind::GlobalArrayDestructor)
+ if (!CGM.getCodeGenOpts().EmitCodeView)
return InitFn->getName();
// Print the normal qualified name for the variable, then break off the last
@@ -1936,7 +1935,6 @@ StringRef CGDebugInfo::getDynamicInitializerName(const VarDecl *VD,
switch (StubKind) {
case DynamicInitKind::NoStub:
- case DynamicInitKind::GlobalArrayDestructor:
llvm_unreachable("not an initializer");
case DynamicInitKind::Initializer:
OS << "`dynamic initializer for '";
@@ -3571,8 +3569,7 @@ void CGDebugInfo::EmitFunctionStart(GlobalDecl GD, SourceLocation Loc,
if (Name.startswith("\01"))
Name = Name.substr(1);
- if (!HasDecl || D->isImplicit() || D->hasAttr<ArtificialAttr>() ||
- (isa<VarDecl>(D) && GD.getDynamicInitKind() != DynamicInitKind::NoStub)) {
+ if (!HasDecl || D->isImplicit() || D->hasAttr<ArtificialAttr>()) {
Flags |= llvm::DINode::FlagArtificial;
// Artificial functions should not silently reuse CurLoc.
CurLoc = SourceLocation();
diff --git a/clang/lib/CodeGen/CGDeclCXX.cpp b/clang/lib/CodeGen/CGDeclCXX.cpp
index c4dbe0b6bb7..7a0605b8450 100644
--- a/clang/lib/CodeGen/CGDeclCXX.cpp
+++ b/clang/lib/CodeGen/CGDeclCXX.cpp
@@ -247,8 +247,6 @@ 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,9 +642,8 @@ void CodeGenFunction::GenerateCXXGlobalVarDeclInitFunc(llvm::Function *Fn,
StartFunction(GlobalDecl(D, DynamicInitKind::Initializer),
getContext().VoidTy, Fn, getTypes().arrangeNullaryFunction(),
- FunctionArgList());
- // Emit an artificial location for this function.
- auto AL = ApplyDebugLocation::CreateArtificial(*this);
+ FunctionArgList(), D->getLocation(),
+ D->getInit()->getExprLoc());
// Use guarded initialization if the global variable is weak. This
// occurs for, e.g., instantiated static data members and
@@ -771,10 +768,7 @@ llvm::Function *CodeGenFunction::generateDestroyHelper(
CurEHLocation = VD->getBeginLoc();
- StartFunction(GlobalDecl(VD, DynamicInitKind::GlobalArrayDestructor),
- getContext().VoidTy, fn, FI, args);
- // Emit an artificial location for this function.
- auto AL = ApplyDebugLocation::CreateArtificial(*this);
+ StartFunction(VD, getContext().VoidTy, fn, FI, args);
emitDestroy(addr, type, destroyer, useEHCleanupForArray);
OpenPOWER on IntegriCloud