[PATCH] D50089: [DWARF v4] Suppressing the __debug_ranges section when there are no ranges

2018-07-31 Thread Wolfgang Pieb via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL338437: [DWARF] Do not create a .debug_ranges section when 
no ranges are needed. (authored by wolfgangp, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D50089?vs=158328=158378#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D50089

Files:
  llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp


Index: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
===
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -2136,7 +2136,7 @@
 return;
   }
 
-  if (getDwarfVersion() >= 5 && NoRangesPresent())
+  if (NoRangesPresent())
 return;
 
   // Start the dwarf ranges section.


Index: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
===
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -2136,7 +2136,7 @@
 return;
   }
 
-  if (getDwarfVersion() >= 5 && NoRangesPresent())
+  if (NoRangesPresent())
 return;
 
   // Start the dwarf ranges section.
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D50089: [DWARF v4] Suppressing the __debug_ranges section when there are no ranges

2018-07-31 Thread Adrian Prantl via Phabricator via cfe-commits
aprantl accepted this revision.
aprantl added inline comments.
This revision is now accepted and ready to land.



Comment at: apple-accel.cpp:11
 
+__attribute__((section("1,__text_foo"))) void foo() {}
 int main (int argc, char const *argv[]) { return argc; }

A comment why this is necessary would be nice.


https://reviews.llvm.org/D50089



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D50089: [DWARF v4] Suppressing the __debug_ranges section when there are no ranges

2018-07-31 Thread Wolfgang Pieb via Phabricator via cfe-commits
wolfgangp created this revision.
wolfgangp added reviewers: aprantl, JDevlieghere, dblaikie.

One of the clang tests in debuginfo-tests (apple-accel.cpp) insists on checking 
for the existence of the __debug_ranges section (it requires darwin) even for 
trivial code which doesn't need any range lists. My recent patch to implement 
DWARF v5 rnglists suppressed the section for trivial cases and broke the test. 
To pacify the bots I disabled the suppression for DWARF 4, restoring the 
original behavior.

This patch (actually 2, debuginfo-tests is a separate repo) fixes the test and 
re-enables the suppression of unneeded DWARF 4 (and earlier) range lists.

@aprantl , @JDevlieghere Could you please make sure the test change makes 
sense. I am not that well-versed with Mach-O. I'm just trying to force the 
compiler to emit ranges.


https://reviews.llvm.org/D50089

Files:
  apple-accel.cpp
  lib/CodeGen/AsmPrinter/DwarfDebug.cpp


Index: lib/CodeGen/AsmPrinter/DwarfDebug.cpp
===
--- lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -2136,7 +2136,7 @@
 return;
   }
 
-  if (getDwarfVersion() >= 5 && NoRangesPresent())
+  if (NoRangesPresent())
 return;
 
   // Start the dwarf ranges section.
Index: apple-accel.cpp
===
--- apple-accel.cpp
+++ apple-accel.cpp
@@ -8,6 +8,7 @@
 // RUN: %clang %s %target_itanium_abi_host_triple -gdwarf-4 -O0 -c -g -o %t-ex
 // RUN: llvm-objdump -section-headers %t-ex | FileCheck %s
 
+__attribute__((section("1,__text_foo"))) void foo() {}
 int main (int argc, char const *argv[]) { return argc; }
 
 // CHECK: __debug_str


Index: lib/CodeGen/AsmPrinter/DwarfDebug.cpp
===
--- lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -2136,7 +2136,7 @@
 return;
   }
 
-  if (getDwarfVersion() >= 5 && NoRangesPresent())
+  if (NoRangesPresent())
 return;
 
   // Start the dwarf ranges section.
Index: apple-accel.cpp
===
--- apple-accel.cpp
+++ apple-accel.cpp
@@ -8,6 +8,7 @@
 // RUN: %clang %s %target_itanium_abi_host_triple -gdwarf-4 -O0 -c -g -o %t-ex
 // RUN: llvm-objdump -section-headers %t-ex | FileCheck %s
 
+__attribute__((section("1,__text_foo"))) void foo() {}
 int main (int argc, char const *argv[]) { return argc; }
 
 // CHECK: __debug_str
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits