[PATCH] Anonymous namespaces are missing import DW_TAG_imported_module.

Romanova, Katya Katya_Romanova at playstation.sony.com
Wed Mar 18 13:37:45 PDT 2015


Hi David,
If you insist on moving the patch to the FE, I would rather do it now than later.

Katya.

-----Original Message-----
From: David Blaikie [mailto:dblaikie at gmail.com] 
Sent: Wednesday, March 18, 2015 12:47 PM
To: Romanova, Katya; echristo at gmail.com; friss at apple.com; dexonsmith at apple.com; Robinson, Paul
Cc: aprantl at apple.com; llvm-commits at cs.uiuc.edu
Subject: Re: [PATCH] Anonymous namespaces are missing import DW_TAG_imported_module.

Some follow-up comments you can address before/after committing.

Only other thing I could think of is that this could be moved to the frontend (clang) - since it's a language-specific workaround, so it should perhaps be where the language semantics are known rather than polluting LLVM with more language-specific knowledge it could avoid having.

But if you like that idea, feel free to do/not do it separately from this patch (ie: if you want this in in the interim while working on a frontend patch for this, then remove this backend change afterwards).


================
Comment at: lib/CodeGen/AsmPrinter/DwarfUnit.cpp:1234
@@ -1233,1 +1233,3 @@
   addGlobalName(Name, NDie, NS.getContext());
+  if (Triple(Asm->getTargetTriple()).isPS4() && !Name.empty()) { 
+    // For anonymous namespaces, add a DW_TAG_imported_module tag
----------------
Probably switch the condition around (test Name.empty first) to do the cheaper thing first (so the more expensive thing can be skipped in some cases)

================
Comment at: test/DebugInfo/X86/anonymous-namespace.ll:37
@@ +36,3 @@
+
+;PS4: DW_TAG_imported_module
+;PS4-NEXT: DW_AT_import
----------------
Probably move all the check lines up above the IR so the test file is easier to read

================
Comment at: test/DebugInfo/X86/anonymous-namespace.ll:41
@@ +40,3 @@
+
+;NON-PS4-NOT: DW_TAG_imported_module
+;NON-PS4-NOT: DW_AT_import
----------------
I'd just leave the first of these 3 lines here, the other two don't seem important if we didn't create the tag in the first place.

http://reviews.llvm.org/D7895

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list