]> granicus.if.org Git - clang/commitdiff
Revert "DebugInfo: Place global constants in their appropriate context."
authorDavid Blaikie <dblaikie@gmail.com>
Sat, 5 Apr 2014 03:39:29 +0000 (03:39 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Sat, 5 Apr 2014 03:39:29 +0000 (03:39 +0000)
This reverts commit r205655.

Breaks the compiler-rt build with an assertion failure in LLVM...
reverting while I investigate.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@205664 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGDebugInfo.cpp
test/CodeGenCXX/debug-info.cpp

index eed2f3c6155ae7f8b9c333b2992454a49b10accb..41f1ddb697c141e5806140ad5786d4e9604c20b8 100644 (file)
@@ -3230,11 +3230,8 @@ void CGDebugInfo::EmitGlobalVariable(const ValueDecl *VD,
   // Do not emit separate definitions for function local const/statics.
   if (isa<FunctionDecl>(VD->getDeclContext()))
     return;
-  llvm::DIDescriptor DContext =
-      getContextDescriptor(dyn_cast<Decl>(VD->getDeclContext()));
   llvm::DIGlobalVariable GV = DBuilder.createStaticVariable(
-      DContext, Name, StringRef(), Unit, getLineNumber(VD->getLocation()), Ty,
-      true, Init,
+      Unit, Name, Name, Unit, getLineNumber(VD->getLocation()), Ty, true, Init,
       getOrCreateStaticDataMemberDeclarationOrNull(cast<VarDecl>(VD)));
   DeclCache.insert(std::make_pair(VD->getCanonicalDecl(), llvm::WeakVH(GV)));
 }
index 26d647aa35673c1e88c86e3d3fecf8fe128a0d26..7c89dfc04ce1bcdf3fcf3ae8bf32dfcff82faa8d 100644 (file)
@@ -83,16 +83,9 @@ foo func(foo f) {
 // CHECK: [[FUNC:![0-9]*]] = {{.*}} metadata !"_ZN7pr147634funcENS_3fooE", i32 {{[0-9]*}}, metadata [[FUNC_TYPE:![0-9]*]], {{.*}} ; [ DW_TAG_subprogram ] {{.*}} [def] [func]
 }
 
-namespace local_const {
-const wchar_t lc_c = L'x';
-}
-
-// CHECK: metadata [[LOCAL_CONST:![0-9]*]], metadata !"lc_c", {{.*}}; [ DW_TAG_variable ] [lc_c]
-// CHECK: [[LOCAL_CONST]] = {{.*}}; [ DW_TAG_namespace ] [local_const]
-
 void foo() {
   const wchar_t c = L'x';
-  wchar_t d = c + local_const::lc_c;
+  wchar_t d = c;
 }
 
 // CHECK-NOT: ; [ DW_TAG_variable ] [c]