r205664 - Revert "DebugInfo: Place global constants in their appropriate context."

Yunzhong Gao gaoyunzhong at gmail.com
Sat Apr 5 00:23:17 PDT 2014


Hi David,
Just wondering,
Did you try changing AllGVs to use TrackingVH since they can be updated
again (multiple forward declarations) in the deferred case?
- Gao


On Fri, Apr 4, 2014 at 8:39 PM, David Blaikie <dblaikie at gmail.com> wrote:
> Author: dblaikie
> Date: Fri Apr  4 22:39:29 2014
> New Revision: 205664
>
> URL: http://llvm.org/viewvc/llvm-project?rev=205664&view=rev
> Log:
> Revert "DebugInfo: Place global constants in their appropriate context."
>
> This reverts commit r205655.
>
> Breaks the compiler-rt build with an assertion failure in LLVM...
> reverting while I investigate.
>
> Modified:
>     cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
>     cfe/trunk/test/CodeGenCXX/debug-info.cpp
>
> Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=205664&r1=205663&r2=205664&view=diff
> ==============================================================================
> --- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
> +++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Fri Apr  4 22:39:29 2014
> @@ -3230,11 +3230,8 @@ void CGDebugInfo::EmitGlobalVariable(con
>    // 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)));
>  }
>
> Modified: cfe/trunk/test/CodeGenCXX/debug-info.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/debug-info.cpp?rev=205664&r1=205663&r2=205664&view=diff
> ==============================================================================
> --- cfe/trunk/test/CodeGenCXX/debug-info.cpp (original)
> +++ cfe/trunk/test/CodeGenCXX/debug-info.cpp Fri Apr  4 22:39:29 2014
> @@ -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]
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits



More information about the cfe-commits mailing list