DebugInfo: Fix a bunch of tests that, owing to their compile_unit metadata not including a 13th field, had some subtle behavior.
Without the 13th field, the "emission kind" field defaults to 0 (which
is not equal to either of the values of the emission kind enum (1 ==
full debug info, 2 == line tables only)).
In this particular instance, the comparison with "FullDebugInfo" was
done when adding elements to the ranges list - so for these test cases
no values were added to the ranges list.
This got weirder when emitting debug_loc entries as the addresses should
be relative to the range of the CU if the CU has only one range (the
reasonable assumption is that if we're emitting debug_loc lists for a CU
that CU has at least one range - but due to the above situation, it has
zero) so the ranges were emitted relative to the start of the section
rather than relative to the start of the CU's singular range.
Fix these tests by accounting for the difference in the description of
debug_loc entries (in some cases making the test ignorant to these
differences, in others adding the extra label difference expression,
etc) or the presence/absence of high/low_pc on the CU, and add the 13th
field to their CUs to enable proper "full debug info" emission here.
In a future commit I'll fix up a bunch of other test cases that are not
so rigorously depending on this behavior, but still doing similarly
weird things due to the missing 13th field.
llvm-svn: 214937
2014-08-06 07:57:31 +08:00
|
|
|
; RUN: llc < %s - -filetype=obj | llvm-dwarfdump -debug-dump=loc - | FileCheck %s
|
2011-05-05 03:00:57 +08:00
|
|
|
; Radar 9376013
|
|
|
|
target datalayout = "e-p:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:32-f32:32:32-f64:32:32-v64:32:64-v128:32:128-a0:0:32-n32"
|
|
|
|
target triple = "thumbv7-apple-macosx10.6.7"
|
|
|
|
|
2014-08-08 06:44:24 +08:00
|
|
|
; Just making sure the first part of the location isn't a repetition
|
|
|
|
; of the size of the location description.
|
|
|
|
;
|
DebugInfo: Fix a bunch of tests that, owing to their compile_unit metadata not including a 13th field, had some subtle behavior.
Without the 13th field, the "emission kind" field defaults to 0 (which
is not equal to either of the values of the emission kind enum (1 ==
full debug info, 2 == line tables only)).
In this particular instance, the comparison with "FullDebugInfo" was
done when adding elements to the ranges list - so for these test cases
no values were added to the ranges list.
This got weirder when emitting debug_loc entries as the addresses should
be relative to the range of the CU if the CU has only one range (the
reasonable assumption is that if we're emitting debug_loc lists for a CU
that CU has at least one range - but due to the above situation, it has
zero) so the ranges were emitted relative to the start of the section
rather than relative to the start of the CU's singular range.
Fix these tests by accounting for the difference in the description of
debug_loc entries (in some cases making the test ignorant to these
differences, in others adding the extra label difference expression,
etc) or the presence/absence of high/low_pc on the CU, and add the 13th
field to their CUs to enable proper "full debug info" emission here.
In a future commit I'll fix up a bunch of other test cases that are not
so rigorously depending on this behavior, but still doing similarly
weird things due to the missing 13th field.
llvm-svn: 214937
2014-08-06 07:57:31 +08:00
|
|
|
; 0x90 DW_OP_regx of super-register
|
|
|
|
|
|
|
|
; CHECK: 0x00000000: Beginning address offset:
|
|
|
|
; CHECK-NEXT: Ending address offset:
|
2014-08-08 07:04:07 +08:00
|
|
|
; CHECK-NEXT: Location description: 90 {{.. .. .. .. $}}
|
2011-05-05 03:00:57 +08:00
|
|
|
|
|
|
|
define void @_Z3foov() optsize ssp {
|
|
|
|
entry:
|
|
|
|
%call = tail call float @_Z3barv() optsize, !dbg !11
|
2014-10-04 04:01:09 +08:00
|
|
|
tail call void @llvm.dbg.value(metadata !{float %call}, i64 0, metadata !5, metadata !{metadata !"0x102"}), !dbg !11
|
2011-05-05 03:00:57 +08:00
|
|
|
%call16 = tail call float @_Z2f2v() optsize, !dbg !12
|
|
|
|
%cmp7 = fcmp olt float %call, %call16, !dbg !12
|
|
|
|
br i1 %cmp7, label %for.body, label %for.end, !dbg !12
|
|
|
|
|
|
|
|
for.body: ; preds = %entry, %for.body
|
|
|
|
%k.08 = phi float [ %inc, %for.body ], [ %call, %entry ]
|
|
|
|
%call4 = tail call float @_Z2f3f(float %k.08) optsize, !dbg !13
|
|
|
|
%inc = fadd float %k.08, 1.000000e+00, !dbg !14
|
|
|
|
%call1 = tail call float @_Z2f2v() optsize, !dbg !12
|
|
|
|
%cmp = fcmp olt float %inc, %call1, !dbg !12
|
|
|
|
br i1 %cmp, label %for.body, label %for.end, !dbg !12
|
|
|
|
|
|
|
|
for.end: ; preds = %for.body, %entry
|
|
|
|
ret void, !dbg !15
|
|
|
|
}
|
|
|
|
|
|
|
|
declare float @_Z3barv() optsize
|
|
|
|
|
|
|
|
declare float @_Z2f2v() optsize
|
|
|
|
|
|
|
|
declare float @_Z2f3f(float) optsize
|
|
|
|
|
Move the complex address expression out of DIVariable and into an extra
argument of the llvm.dbg.declare/llvm.dbg.value intrinsics.
Previously, DIVariable was a variable-length field that has an optional
reference to a Metadata array consisting of a variable number of
complex address expressions. In the case of OpPiece expressions this is
wasting a lot of storage in IR, because when an aggregate type is, e.g.,
SROA'd into all of its n individual members, the IR will contain n copies
of the DIVariable, all alike, only differing in the complex address
reference at the end.
By making the complex address into an extra argument of the
dbg.value/dbg.declare intrinsics, all of the pieces can reference the
same variable and the complex address expressions can be uniqued across
the CU, too.
Down the road, this will allow us to move other flags, such as
"indirection" out of the DIVariable, too.
The new intrinsics look like this:
declare void @llvm.dbg.declare(metadata %storage, metadata %var, metadata %expr)
declare void @llvm.dbg.value(metadata %storage, i64 %offset, metadata %var, metadata %expr)
This patch adds a new LLVM-local tag to DIExpressions, so we can detect
and pretty-print DIExpression metadata nodes.
What this patch doesn't do:
This patch does not touch the "Indirect" field in DIVariable; but moving
that into the expression would be a natural next step.
http://reviews.llvm.org/D4919
rdar://problem/17994491
Thanks to dblaikie and dexonsmith for reviewing this patch!
Note: I accidentally committed a bogus older version of this patch previously.
llvm-svn: 218787
2014-10-02 02:55:02 +08:00
|
|
|
declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnone
|
2011-05-05 03:00:57 +08:00
|
|
|
|
|
|
|
!llvm.dbg.cu = !{!0}
|
2013-11-23 05:49:45 +08:00
|
|
|
!llvm.module.flags = !{!20}
|
2011-05-05 03:00:57 +08:00
|
|
|
|
2014-10-04 04:01:09 +08:00
|
|
|
!0 = metadata !{metadata !"0x11\004\00clang version 3.0 (trunk 130845)\001\00\000\00\001", metadata !18, metadata !19, metadata !19, metadata !16, null, null} ; [ DW_TAG_compile_unit ]
|
|
|
|
!1 = metadata !{metadata !"0x2e\00foo\00foo\00_Z3foov\005\000\001\000\006\00256\001\005", metadata !18, metadata !2, metadata !3, null, void ()* @_Z3foov, null, null, metadata !17} ; [ DW_TAG_subprogram ] [line 5] [def] [foo]
|
|
|
|
!2 = metadata !{metadata !"0x29", metadata !18} ; [ DW_TAG_file_type ]
|
|
|
|
!3 = metadata !{metadata !"0x15\00\000\000\000\000\000\000", metadata !18, metadata !2, null, metadata !4, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
|
2011-05-05 03:00:57 +08:00
|
|
|
!4 = metadata !{null}
|
2014-10-04 04:01:09 +08:00
|
|
|
!5 = metadata !{metadata !"0x100\00k\006\000", metadata !6, metadata !2, metadata !7} ; [ DW_TAG_auto_variable ]
|
|
|
|
!6 = metadata !{metadata !"0xb\005\0012\000", metadata !18, metadata !1} ; [ DW_TAG_lexical_block ]
|
|
|
|
!7 = metadata !{metadata !"0x24\00float\000\0032\0032\000\000\004", null, metadata !0} ; [ DW_TAG_base_type ]
|
|
|
|
!8 = metadata !{metadata !"0x100\00y\008\000", metadata !9, metadata !2, metadata !7} ; [ DW_TAG_auto_variable ]
|
|
|
|
!9 = metadata !{metadata !"0xb\007\0025\002", metadata !18, metadata !10} ; [ DW_TAG_lexical_block ]
|
|
|
|
!10 = metadata !{metadata !"0xb\007\003\001", metadata !18, metadata !6} ; [ DW_TAG_lexical_block ]
|
2011-05-05 03:00:57 +08:00
|
|
|
!11 = metadata !{i32 6, i32 18, metadata !6, null}
|
|
|
|
!12 = metadata !{i32 7, i32 3, metadata !6, null}
|
|
|
|
!13 = metadata !{i32 8, i32 20, metadata !9, null}
|
|
|
|
!14 = metadata !{i32 7, i32 20, metadata !10, null}
|
|
|
|
!15 = metadata !{i32 10, i32 1, metadata !6, null}
|
2013-03-18 05:13:55 +08:00
|
|
|
!16 = metadata !{metadata !1}
|
|
|
|
!17 = metadata !{metadata !5, metadata !8}
|
|
|
|
!18 = metadata !{metadata !"k.cc", metadata !"/private/tmp"}
|
2013-07-27 04:04:30 +08:00
|
|
|
!19 = metadata !{i32 0}
|
2014-10-04 04:01:09 +08:00
|
|
|
!20 = metadata !{i32 1, metadata !"Debug Info Version", i32 2}
|