Skip to content

Commit 3669c3c

Browse files
committed
Revert "PR14606: Debug info for using directives/DW_TAG_imported_module"
This reverts commit r179837 as it seems to be causing test failures. llvm-svn: 179839
1 parent 3dbf346 commit 3669c3c

File tree

4 files changed

+3
-25
lines changed

4 files changed

+3
-25
lines changed

clang/lib/CodeGen/CGDebugInfo.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2929,13 +2929,6 @@ void CGDebugInfo::EmitGlobalVariable(const ValueDecl *VD,
29292929
getStaticDataMemberDeclaration(VD));
29302930
}
29312931

2932-
void CGDebugInfo::EmitUsingDirective(const UsingDirectiveDecl &UD) {
2933-
DBuilder.createImportedModule(
2934-
getContextDescriptor(cast<Decl>(UD.getDeclContext())),
2935-
getOrCreateNameSpace(UD.getNominatedNamespace()),
2936-
getLineNumber(UD.getLocation()));
2937-
}
2938-
29392932
/// getOrCreateNamesSpace - Return namespace descriptor for the given
29402933
/// namespace decl.
29412934
llvm::DINameSpace

clang/lib/CodeGen/CGDebugInfo.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -262,9 +262,6 @@ class CGDebugInfo {
262262
/// EmitGlobalVariable - Emit global variable's debug info.
263263
void EmitGlobalVariable(const ValueDecl *VD, llvm::Constant *Init);
264264

265-
/// \brief - Emit C++ using directive.
266-
void EmitUsingDirective(const UsingDirectiveDecl &UD);
267-
268265
/// getOrCreateRecordType - Emit record type's standalone debug info.
269266
llvm::DIType getOrCreateRecordType(QualType Ty, SourceLocation L);
270267

clang/lib/CodeGen/CGDecl.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ void CodeGenFunction::EmitDecl(const Decl &D) {
8080
case Decl::CXXRecord: // struct/union/class X; [C++]
8181
case Decl::Using: // using X; [C++]
8282
case Decl::UsingShadow:
83+
case Decl::UsingDirective: // using namespace X; [C++]
8384
case Decl::NamespaceAlias:
8485
case Decl::StaticAssert: // static_assert(X, ""); [C++0x]
8586
case Decl::Label: // __label__ x;
@@ -89,10 +90,6 @@ void CodeGenFunction::EmitDecl(const Decl &D) {
8990
// None of these decls require codegen support.
9091
return;
9192

92-
case Decl::UsingDirective: // using namespace X; [C++]
93-
if (CGDebugInfo *DI = getDebugInfo())
94-
DI->EmitUsingDirective(cast<UsingDirectiveDecl>(D));
95-
return;
9693
case Decl::Var: {
9794
const VarDecl &VD = cast<VarDecl>(D);
9895
assert(VD.isLocalVarDecl() &&

clang/test/CodeGenCXX/debug-info-namespace.cpp

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,11 @@ int i;
77
}
88
}
99

10-
int func() {
11-
using namespace A::B;
12-
return i;
13-
}
14-
15-
// CHECK: [[MODULES:![0-9]*]], metadata !""} ; [ DW_TAG_compile_unit ]
1610
// CHECK: [[FILE:![0-9]*]] {{.*}}debug-info-namespace.cpp"
17-
// CHECK: [[FUNC:![0-9]*]] {{.*}} ; [ DW_TAG_subprogram ] [line 6] [def] [func]
18-
// CHECK: [[FILE2:![0-9]*]]} ; [ DW_TAG_file_type ] [{{.*}}foo.cpp]
1911
// CHECK: [[VAR:![0-9]*]] = {{.*}}, metadata [[NS:![0-9]*]], metadata !"i", {{.*}} ; [ DW_TAG_variable ] [i]
20-
// CHECK: [[NS]] = {{.*}}, metadata [[FILE2]], metadata [[CTXT:![0-9]*]], {{.*}} ; [ DW_TAG_namespace ] [B] [line 1]
12+
// CHECK: [[NS]] = {{.*}}, metadata [[FILE2:![0-9]*]], metadata [[CTXT:![0-9]*]], {{.*}} ; [ DW_TAG_namespace ] [B] [line 1]
2113
// CHECK: [[CTXT]] = {{.*}}, metadata [[FILE]], null, {{.*}} ; [ DW_TAG_namespace ] [A] [line 3]
22-
// CHECK: [[MODULES]] = metadata !{metadata [[MODULE:![0-9]*]]}
23-
// CHECK: [[MODULE]] = metadata !{i32 {{[0-9]*}}, metadata [[FUNC]], metadata [[NS]], i32 7} ; [ DW_TAG_imported_module ]
14+
// CHECK: [[FILE2]]} ; [ DW_TAG_file_type ] [{{.*}}foo.cpp]
2415

2516
// FIXME: It is confused on win32 to generate file entry when dosish filename is given.
2617
// REQUIRES: shell

0 commit comments

Comments
 (0)