Revert "[DebugInfo] Support to emit debugInfo for extern variables"
This reverts commit d77ae1552fc21a9f3877f3ed7e13d631f517c825.
The tests committed along with this change do not pass, and should be
changed to use %clang_cc1.
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp
index 675df30..8858e08 100644
--- a/clang/lib/CodeGen/CGDebugInfo.cpp
+++ b/clang/lib/CodeGen/CGDebugInfo.cpp
@@ -4485,7 +4485,7 @@
GVE = DBuilder.createGlobalVariableExpression(
DContext, DeclName, LinkageName, Unit, LineNo, getOrCreateType(T, Unit),
- Var->hasLocalLinkage(), true,
+ Var->hasLocalLinkage(),
Expr.empty() ? nullptr : DBuilder.createExpression(Expr),
getOrCreateStaticDataMemberDeclarationOrNull(D), TemplateParameters,
Align);
@@ -4588,29 +4588,10 @@
GV.reset(DBuilder.createGlobalVariableExpression(
DContext, Name, StringRef(), Unit, getLineNumber(VD->getLocation()), Ty,
- true, true, InitExpr, getOrCreateStaticDataMemberDeclarationOrNull(VarD),
+ true, InitExpr, getOrCreateStaticDataMemberDeclarationOrNull(VarD),
TemplateParameters, Align));
}
-void CGDebugInfo::EmitExternalVariable(llvm::GlobalVariable *Var,
- const VarDecl *D) {
- assert(DebugKind >= codegenoptions::LimitedDebugInfo);
- if (D->hasAttr<NoDebugAttr>())
- return;
-
- auto Align = getDeclAlignIfRequired(D, CGM.getContext());
- llvm::DIFile *Unit = getOrCreateFile(D->getLocation());
- StringRef Name = D->getName();
- llvm::DIType *Ty = getOrCreateType(D->getType(), Unit);
-
- llvm::DIScope *DContext = getDeclContextDescriptor(D);
- llvm::DIGlobalVariableExpression *GVE =
- DBuilder.createGlobalVariableExpression(
- DContext, Name, StringRef(), Unit, getLineNumber(D->getLocation()),
- Ty, false, false, nullptr, nullptr, nullptr, Align);
- Var->addDebugInfo(GVE);
-}
-
llvm::DIScope *CGDebugInfo::getCurrentContextDescriptor(const Decl *D) {
if (!LexicalBlockStack.empty())
return LexicalBlockStack.back();