[PATCH] DW_TAG_typedef and DW_TAG_structure_type not emitted when typedef is used

Eric Christopher echristo at gmail.com
Tue Feb 25 17:23:15 PST 2014


  Needs changes, thanks for working on this!


================
Comment at: llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp:3280
@@ +3279,3 @@
+
+void CGDebugInfo::EmitTypeDef(QualType Ty)
+{
----------------
Please follow the style guide for formatting. The entire patch.

================
Comment at: llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp:3283
@@ +3282,3 @@
+  llvm::DIType DieTy = getOrCreateType(Ty,getOrCreateMainFile());
+  // Don't ignore in case of explicit cast were it is referenced indirectly.
+  DBuilder.retainType(DieTy); 
----------------
"where"

================
Comment at: llvm/tools/clang/lib/CodeGen/CGExprScalar.cpp:281
@@ +280,3 @@
+      if (DI && CGF.CGM.getCodeGenOpts().getDebugInfo()
+          == CodeGenOptions::LimitedDebugInfo)
+        DI->EmitTypeDef((E->getType()));
----------------
Only == Limited? You probably mean >=.

I'm also not sure this is the right place for this, Dave any thoughts?

================
Comment at: llvm/tools/clang/test/CodeGen/Debug-info-typedef.cpp:1
@@ +1,2 @@
+// RUN: %clang -fverbose-asm -S -g %s -o - | grep DW_TAG_structure_type
+// RUN: %clang -fverbose-asm -S -g %s -o - | grep DW_TAG_typedef
----------------
Testcase should check the generated metadata, not the assembly. It'll also mean you can just use a single run of the test and use FileCheck.


http://llvm-reviews.chandlerc.com/D2498



More information about the cfe-commits mailing list