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