[PATCH] Do not split variables definitions into 2 DIEs.

David Blaikie dblaikie at gmail.com
Tue Sep 23 08:31:58 PDT 2014


================
Comment at: test/DebugInfo/X86/gnu-public-names.ll:56
@@ -56,2 +55,3 @@
+; CHECK: [[STATIC_MEM_VAR:0x[0-9a-f]+]]: DW_TAG_member
 ; CHECK-NEXT: DW_AT_name {{.*}} "static_member_variable"
 
----------------
This actually seems like it /might/ be a reasonable place for a separate declaration and definition, since the user wrote an out of line definition.

What location do we attribute the definition to? It might be worth checking the decl_line attribute in this test. Did we previously attribute the declaration and definition to their respective lines, or just duplicate one/the other of them?

How does this compare to other nested definitions (I suppose for functions in namespaces we don't emit both distinguishing the declaration and definition in cases like: "namespace x { void func(); } void x::func() {}" so there's arguably no reason to similarly for variables)

http://reviews.llvm.org/D5457






More information about the llvm-commits mailing list