[PATCH] D25132: Invoke add-discriminator at -g0 -fsample-profile

Dehao Chen via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 30 14:45:53 PDT 2016


danielcdh created this revision.
danielcdh added reviewers: davidxl, dnovillo.
danielcdh added a subscriber: llvm-commits.

-fsample-profile needs discriminator, which will not be added if built with -g0. This patch makes sure the discriminator is added for sample-profile at -g0. A followup patch will be send out to update clang tests.


https://reviews.llvm.org/D25132

Files:
  lib/Transforms/Utils/AddDiscriminators.cpp


Index: lib/Transforms/Utils/AddDiscriminators.cpp
===================================================================
--- lib/Transforms/Utils/AddDiscriminators.cpp
+++ lib/Transforms/Utils/AddDiscriminators.cpp
@@ -159,10 +159,8 @@
   // If the function has debug information, but the user has disabled
   // discriminators, do nothing.
   // Simlarly, if the function has no debug info, do nothing.
-  // Finally, if this module is built with dwarf versions earlier than 4,
   // do nothing (discriminator support is a DWARF 4 feature).
-  if (NoDiscriminators || !F.getSubprogram() ||
-      F.getParent()->getDwarfVersion() < 4)
+  if (NoDiscriminators || !F.getSubprogram())
     return false;
 
   bool Changed = false;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D25132.73147.patch
Type: text/x-patch
Size: 726 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160930/c119cdf0/attachment.bin>


More information about the llvm-commits mailing list