[PATCH] D37655: IR: Represent -ggnu-pubnames with a flag on the DICompileUnit.

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 11 14:21:50 PDT 2017


dblaikie added a comment.

Reckon maybe a test case with two units - one using gnu pubnames, one not, would be worth having to demonstrate that all works fine & is appropriately respected?



================
Comment at: llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp:412-422
+bool DwarfDebug::hasDwarfPubSections(DwarfCompileUnit &CU) const {
   // Opting in to GNU Pubnames/types overrides the default to ensure these are
   // generated for things like Gold's gdb_index generation.
-  if (GenerateGnuPubSections)
+  if (CU.getCUNode()->getGnuPubnames())
     return true;
 
   if (DwarfPubSections == Default)
----------------
Looks like this function could be moved to be a member of DwarfCompileUnit? (& move the DwarfPubSections opt into the DwarfCompileUnit.cpp file?)

Just a thought - see how you feel about it, if you think it's better here, that's fine.


================
Comment at: llvm/test/DebugInfo/X86/gnu-public-names-gmlt.ll:1
-; RUN: llc -mtriple=x86_64-pc-linux-gnu -filetype=obj < %s -generate-gnu-dwarf-pub-sections | llvm-dwarfdump - | FileCheck --check-prefix=GPUB --check-prefix=CHECK %s
+; RUN: sed -e 's/gnuPubnames: false/gnuPubnames: true/' %s | llc -mtriple=x86_64-pc-linux-gnu -filetype=obj | llvm-dwarfdump - | FileCheck --check-prefix=GPUB --check-prefix=CHECK %s
 ; RUN: llc -mtriple=x86_64-pc-linux-gnu -filetype=obj < %s -generate-dwarf-pub-sections=Enable | llvm-dwarfdump - | FileCheck --check-prefix=PUB --check-prefix=CHECK %s
----------------
Is this use of 'sed' in a RUN line portable to windows (I forget exactly which command line tools are available/dependendable in the lit environment there)?


https://reviews.llvm.org/D37655





More information about the llvm-commits mailing list