Review request: generate DWARF pubnames under a compiler option

Eric Christopher echristo at gmail.com
Mon Feb 11 11:21:30 PST 2013


On Mon, Feb 11, 2013 at 10:52 AM, Krzysztof Parzyszek <
kparzysz at codeaurora.org> wrote:

> On 2/5/2013 5:44 PM, Krzysztof Parzyszek wrote:
>
>> On 2/1/2013 11:27 AM, Krzysztof Parzyszek wrote:
>>
>>>
>>> Here's a patch that includes the changes you asked for.  I hope I didn't
>>> miss anything.  Let me know what you think.
>>>
>>>
>> Hello... hello... hello...
>> Is there anybody in there?  :)
>>
>
> Hi Eric,
> I haven't heard from you about this updated patch yet.  Please take a
> look.  It's attached to my email from Feb 1.


Sorry, was hitting my review limit pretty fast last week. Here you go:

 +++ b/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
@@ -27,6 +27,7 @@
 #include "llvm/Target/Mangler.h"
 #include "llvm/Target/TargetFrameLowering.h"
 #include "llvm/Target/TargetMachine.h"
+#include "llvm/Target/TargetLoweringObjectFile.h"

Unnecessary include.

+  /// Globals - A map of globally visible named entities for this unit.
+  ///
+  StringMap<DIE*> Globals;

GlobalNames for consistency?

+  if (GenerateDwarfPubNamesSection) {
+    // Check if any of the CUs has any globals.
+    bool HaveGlobals = false;
+    typedef DenseMap<const MDNode*, CompileUnit*> CUMapType;
+    for (CUMapType::iterator I = CUMap.begin(), E = CUMap.end(); I != E;
++I) {
+      CompileUnit *TheCU = I->second;
+      if (!TheCU->getGlobals().empty()) {
+        HaveGlobals = true;
+        break;
+      }
+    }
+    if (HaveGlobals)
+      emitSectionSym(Asm, TLOF.getDwarfPubNamesSection());
+  }

I appreciate the attempt to minimize whether or not we emit the section at
all, but feel free to just check if we're generating and emit the section
sym.

Missing a testcase it appears as well? Once you've got a testcase and have
fixed the above feel free to commit if you have commit privs, otherwise
send me something. It'd be nice to split out the section patches from the
dwarfdump and emission patch. Try to make sure in the testcase that you
cover a good set of what should be in the pubnames section and include the
.c file in the comments of the testcase so we can duplicate it via clang's
IR emission.

Thanks!

-eric
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130211/578abc9e/attachment.html>


More information about the llvm-commits mailing list