From e1c79749ca96a704556c46a8e9140244a9bbdfed Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Tue, 30 Sep 2014 21:28:32 +0000 Subject: Disable the -gmlt optimization implemented in r218129 under Darwin due to issues with dsymutil. r218129 omits DW_TAG_subprograms which have no inlined subroutines when emitting -gmlt data. This makes -gmlt very low cost for -O0 builds. Darwin's dsymutil reasonably considers a CU empty if it has no subprograms (which occurs with the above optimization in -O0 programs without any force_inline function calls) and drops the line table, CU, and everything in this situation, making backtraces impossible. Until dsymutil is modified to account for this, disable this optimization on Darwin to preserve the desired functionality. (see r218545, which should be reverted after this patch, for other discussion/details) Footnote: In the long term, it doesn't look like this scheme (of simplified debug info to describe inlining to enable backtracing) is tenable, it is far too size inefficient for optimized code (the DW_TAG_inlined_subprograms, even once compressed, are nearly twice as large as the line table itself (also compressed)) and we'll be considering things like Cary's two level line table proposal to encode all this information directly in the line table. llvm-svn: 218702 --- llvm/test/DebugInfo/gmlt.ll | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'llvm/test') diff --git a/llvm/test/DebugInfo/gmlt.ll b/llvm/test/DebugInfo/gmlt.ll index 3912134b2d1..a643931927f 100644 --- a/llvm/test/DebugInfo/gmlt.ll +++ b/llvm/test/DebugInfo/gmlt.ll @@ -1,5 +1,7 @@ ; REQUIRES: object-emission ; RUN: %llc_dwarf -O0 -filetype=obj < %s | llvm-dwarfdump - | FileCheck %s +; RUN: %llc_dwarf -O0 -filetype=obj < %s -mtriple x86_64-apple-darwin | llvm-dwarfdump - \ +; RUN: | FileCheck --check-prefix=CHECK --check-prefix=DARWIN %s ; Generated from the following source compiled with clang++ -gmlt: ; void f1() {} @@ -17,6 +19,25 @@ ; CHECK: DW_AT_ranges [DW_FORM_sec_offset] (0x00000000) ; CHECK-NOT: {{DW_TAG|NULL}} +; Omitting the subprograms without inlined subroutines is not possible +; currently on Darwin as dsymutil will drop the whole CU if it has no subprograms +; (which happens with this optimization if there are no inlined subroutines). + +; DARWIN: DW_TAG_subprogram +; DARWIN-NOT: DW_TAG +; DARWIN: DW_AT_name {{.*}} "f1" +; DARWIN-NOT: {{DW_TAG|NULL}} +; DARWIN: DW_TAG_subprogram +; DARWIN-NOT: DW_TAG +; DARWIN: DW_AT_name {{.*}} "f2" +; DARWIN-NOT: {{DW_TAG|NULL}} +; DARWIN: DW_TAG_subprogram +; DARWIN-NOT: DW_TAG +; Can't check the abstract_origin value across the DARWIN/CHECK checking and +; ordering, so don't bother - just trust me, it refers to f3 down there. +; DARWIN: DW_AT_abstract_origin +; DARWIN-NOT: {{DW_TAG|NULL}} + ; FIXME: Emitting separate abstract definitions is inefficient when we could ; just attach the DW_AT_name to the inlined_subroutine directly. Except that -- cgit v1.2.3