2014-03-20 19:16:16 +00:00
; RUN: llc %s -filetype=obj -O0 -mtriple=i386-unknown-linux-gnu -dwarf-version=4 -o %t
; RUN: llvm-dwarfdump %t | FileCheck %s
; From the code:
2014-06-09 21:53:47 +00:00
; debug-loc-offset1.cc
2014-03-20 19:16:16 +00:00
; int bar (int b) {
; return b+4;
; }
2014-06-09 21:53:47 +00:00
; debug-loc-offset2.cc
2014-03-20 19:16:16 +00:00
; struct A {
2014-06-09 21:53:47 +00:00
; int var;
; virtual char foo();
2014-03-20 19:16:16 +00:00
; };
2014-06-09 21:53:47 +00:00
; void baz(struct A a) {
; int z = 2;
; if (a.var > 2)
; z++;
; if (a.foo() == 'a')
; z++;
2014-03-20 19:16:16 +00:00
; }
; Compiled separately for i386-pc-linux-gnu and linked together.
; This ensures that we have multiple compile units so that we can verify that
; debug_loc entries are relative to the low_pc of the CU. The loc entry for
; the byval argument in foo.cpp is in the second CU and so should have
; an offset relative to that CU rather than from the beginning of the text
; section.
; Checking that we have two compile units with two sets of high/lo_pc.
; CHECK: .debug_info contents
; CHECK: DW_TAG_compile_unit
; CHECK: DW_AT_low_pc
; CHECK: DW_AT_high_pc
; CHECK: DW_TAG_compile_unit
; CHECK: DW_AT_low_pc
; CHECK: DW_AT_high_pc
; CHECK: DW_TAG_subprogram
2014-05-23 21:11:46 +00:00
; CHECK-NOT: DW_TAG
2015-03-10 22:44:45 +00:00
; CHECK: DW_AT_linkage_name [DW_FORM_strp]{{.*}}"_Z3baz1A"
2014-05-23 21:11:46 +00:00
; CHECK-NOT: {{DW_TAG|NULL}}
2014-03-20 19:16:16 +00:00
; CHECK: DW_TAG_formal_parameter
2014-06-13 22:18:23 +00:00
; CHECK-NOT: DW_TAG
2014-03-20 19:16:16 +00:00
; CHECK: DW_AT_location [DW_FORM_sec_offset] (0x00000000)
2014-06-13 22:18:23 +00:00
; CHECK-NOT: DW_TAG
; CHECK: DW_AT_name [DW_FORM_strp]{{.*}}"a"
2014-06-09 21:53:47 +00:00
; CHECK: DW_TAG_variable
; CHECK: DW_AT_location [DW_FORM_exprloc]
2014-03-20 19:16:16 +00:00
; CHECK-NOT: DW_AT_location
; CHECK: .debug_loc contents:
; CHECK: 0x00000000: Beginning address offset: 0x0000000000000000
2015-03-16 14:25:08 +00:00
; CHECK: Ending address offset: 0x0000000000000017
2014-03-20 19:16:16 +00:00
2014-06-09 21:53:47 +00:00
%struct.A = type { i32 ( . . . ) * * , i32 }
2014-03-20 19:16:16 +00:00
; Function Attrs: nounwind
define i32 @_Z3bari ( i32 %b ) #0 {
entry:
%b.addr = alloca i32 , align 4
store i32 %b , i32 * %b.addr , align 4
2015-04-29 16:38:44 +00:00
call void @llvm.dbg.declare ( metadata i32 * %b.addr , metadata !21 , metadata !DIExpression ( ) ) , !dbg !22
2015-02-27 21:17:42 +00:00
%0 = load i32 , i32 * %b.addr , align 4 , !dbg !23
2014-06-09 21:53:47 +00:00
%add = add nsw i32 %0 , 4 , !dbg !23
ret i32 %add , !dbg !23
2014-03-20 19:16:16 +00:00
}
; Function Attrs: nounwind readnone
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218787 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-01 18:55:02 +00:00
declare void @llvm.dbg.declare ( metadata , metadata , metadata ) #1
2014-03-20 19:16:16 +00:00
2014-06-09 21:53:47 +00:00
define void @_Z3baz1A ( %struct.A * %a ) #2 {
2014-03-20 19:16:16 +00:00
entry:
2014-06-09 21:53:47 +00:00
%z = alloca i32 , align 4
2015-04-29 16:38:44 +00:00
call void @llvm.dbg.declare ( metadata %struct.A * %a , metadata !24 , metadata !DIExpression ( D W _ O P _ d e r e f ) ) , !dbg !25
call void @llvm.dbg.declare ( metadata i32 * %z , metadata !26 , metadata !DIExpression ( ) ) , !dbg !27
2014-06-09 21:53:47 +00:00
store i32 2 , i32 * %z , align 4 , !dbg !27
[opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction
One of several parallel first steps to remove the target type of pointers,
replacing them with a single opaque pointer type.
This adds an explicit type parameter to the gep instruction so that when the
first parameter becomes an opaque pointer type, the type to gep through is
still available to the instructions.
* This doesn't modify gep operators, only instructions (operators will be
handled separately)
* Textual IR changes only. Bitcode (including upgrade) and changing the
in-memory representation will be in separate changes.
* geps of vectors are transformed as:
getelementptr <4 x float*> %x, ...
->getelementptr float, <4 x float*> %x, ...
Then, once the opaque pointer type is introduced, this will ultimately look
like:
getelementptr float, <4 x ptr> %x
with the unambiguous interpretation that it is a vector of pointers to float.
* address spaces remain on the pointer, not the type:
getelementptr float addrspace(1)* %x
->getelementptr float, float addrspace(1)* %x
Then, eventually:
getelementptr float, ptr addrspace(1) %x
Importantly, the massive amount of test case churn has been automated by
same crappy python code. I had to manually update a few test cases that
wouldn't fit the script's model (r228970,r229196,r229197,r229198). The
python script just massages stdin and writes the result to stdout, I
then wrapped that in a shell script to handle replacing files, then
using the usual find+xargs to migrate all the files.
update.py:
import fileinput
import sys
import re
ibrep = re.compile(r"(^.*?[^%\w]getelementptr inbounds )(((?:<\d* x )?)(.*?)(| addrspace\(\d\)) *\*(|>)(?:$| *(?:%|@|null|undef|blockaddress|getelementptr|addrspacecast|bitcast|inttoptr|\[\[[a-zA-Z]|\{\{).*$))")
normrep = re.compile( r"(^.*?[^%\w]getelementptr )(((?:<\d* x )?)(.*?)(| addrspace\(\d\)) *\*(|>)(?:$| *(?:%|@|null|undef|blockaddress|getelementptr|addrspacecast|bitcast|inttoptr|\[\[[a-zA-Z]|\{\{).*$))")
def conv(match, line):
if not match:
return line
line = match.groups()[0]
if len(match.groups()[5]) == 0:
line += match.groups()[2]
line += match.groups()[3]
line += ", "
line += match.groups()[1]
line += "\n"
return line
for line in sys.stdin:
if line.find("getelementptr ") == line.find("getelementptr inbounds"):
if line.find("getelementptr inbounds") != line.find("getelementptr inbounds ("):
line = conv(re.match(ibrep, line), line)
elif line.find("getelementptr ") != line.find("getelementptr ("):
line = conv(re.match(normrep, line), line)
sys.stdout.write(line)
apply.sh:
for name in "$@"
do
python3 `dirname "$0"`/update.py < "$name" > "$name.tmp" && mv "$name.tmp" "$name"
rm -f "$name.tmp"
done
The actual commands:
From llvm/src:
find test/ -name *.ll | xargs ./apply.sh
From llvm/src/tools/clang:
find test/ -name *.mm -o -name *.m -o -name *.cpp -o -name *.c | xargs -I '{}' ../../apply.sh "{}"
From llvm/src/tools/polly:
find test/ -name *.ll | xargs ./apply.sh
After that, check-all (with llvm, clang, clang-tools-extra, lld,
compiler-rt, and polly all checked out).
The extra 'rm' in the apply.sh script is due to a few files in clang's test
suite using interesting unicode stuff that my python script was throwing
exceptions on. None of those files needed to be migrated, so it seemed
sufficient to ignore those cases.
Reviewers: rafael, dexonsmith, grosser
Differential Revision: http://reviews.llvm.org/D7636
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230786 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-27 19:29:02 +00:00
%var = getelementptr inbounds %struct.A , %struct.A * %a , i32 0 , i32 1 , !dbg !28
2015-02-27 21:17:42 +00:00
%0 = load i32 , i32 * %var , align 4 , !dbg !28
2014-06-09 21:53:47 +00:00
%cmp = icmp sgt i32 %0 , 2 , !dbg !28
br i1 %cmp , label %if.then , label %if.end , !dbg !28
if.then: ; preds = %entry
2015-02-27 21:17:42 +00:00
%1 = load i32 , i32 * %z , align 4 , !dbg !30
2014-06-09 21:53:47 +00:00
%inc = add nsw i32 %1 , 1 , !dbg !30
store i32 %inc , i32 * %z , align 4 , !dbg !30
br label %if.end , !dbg !30
if.end: ; preds = %if.then, %entry
%call = call signext i8 @_ZN1A3fooEv ( %struct.A * %a ) , !dbg !31
%conv = sext i8 %call to i32 , !dbg !31
%cmp1 = icmp eq i32 %conv , 97 , !dbg !31
br i1 %cmp1 , label %if.then2 , label %if.end4 , !dbg !31
if.then2: ; preds = %if.end
2015-02-27 21:17:42 +00:00
%2 = load i32 , i32 * %z , align 4 , !dbg !33
2014-06-09 21:53:47 +00:00
%inc3 = add nsw i32 %2 , 1 , !dbg !33
store i32 %inc3 , i32 * %z , align 4 , !dbg !33
br label %if.end4 , !dbg !33
if.end4: ; preds = %if.then2, %if.end
ret void , !dbg !34
2014-03-20 19:16:16 +00:00
}
2014-06-09 21:53:47 +00:00
declare signext i8 @_ZN1A3fooEv ( %struct.A * ) #2
2014-03-20 19:16:16 +00:00
attributes #0 = { nounwind "less-precise-fpmad" = "false" "no-frame-pointer-elim" = "true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math" = "false" "no-nans-fp-math" = "false" "stack-protector-buffer-size" = "8" "unsafe-fp-math" = "false" "use-soft-float" = "false" }
attributes #1 = { nounwind readnone }
2014-06-09 21:53:47 +00:00
attributes #2 = { "less-precise-fpmad" = "false" "no-frame-pointer-elim" = "true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math" = "false" "no-nans-fp-math" = "false" "stack-protector-buffer-size" = "8" "unsafe-fp-math" = "false" "use-soft-float" = "false" }
2014-03-20 19:16:16 +00:00
!llvm.dbg.cu = ! { !0 , !9 }
2014-06-09 21:53:47 +00:00
!llvm.module.flags = ! { !18 , !19 }
!llvm.ident = ! { !20 , !20 }
2014-03-20 19:16:16 +00:00
2015-04-29 16:38:44 +00:00
!0 = !DICompileUnit ( language: D W _ L A N G _ C _ p l u s _ p l u s , producer: "clang version 3.5.0 (210479)" , isOptimized: false , emissionKind: 1 , file: !1 , enums: !2 , retainedTypes: !2 , subprograms: !3 , globals: !2 , imports: !2 )
!1 = !DIFile ( filename: "debug-loc-offset1.cc" , directory: "/llvm_cmake_gcc" )
IR: Make metadata typeless in assembly
Now that `Metadata` is typeless, reflect that in the assembly. These
are the matching assembly changes for the metadata/value split in
r223802.
- Only use the `metadata` type when referencing metadata from a call
intrinsic -- i.e., only when it's used as a `Value`.
- Stop pretending that `ValueAsMetadata` is wrapped in an `MDNode`
when referencing it from call intrinsics.
So, assembly like this:
define @foo(i32 %v) {
call void @llvm.foo(metadata !{i32 %v}, metadata !0)
call void @llvm.foo(metadata !{i32 7}, metadata !0)
call void @llvm.foo(metadata !1, metadata !0)
call void @llvm.foo(metadata !3, metadata !0)
call void @llvm.foo(metadata !{metadata !3}, metadata !0)
ret void, !bar !2
}
!0 = metadata !{metadata !2}
!1 = metadata !{i32* @global}
!2 = metadata !{metadata !3}
!3 = metadata !{}
turns into this:
define @foo(i32 %v) {
call void @llvm.foo(metadata i32 %v, metadata !0)
call void @llvm.foo(metadata i32 7, metadata !0)
call void @llvm.foo(metadata i32* @global, metadata !0)
call void @llvm.foo(metadata !3, metadata !0)
call void @llvm.foo(metadata !{!3}, metadata !0)
ret void, !bar !2
}
!0 = !{!2}
!1 = !{i32* @global}
!2 = !{!3}
!3 = !{}
I wrote an upgrade script that handled almost all of the tests in llvm
and many of the tests in cfe (even handling many `CHECK` lines). I've
attached it (or will attach it in a moment if you're speedy) to PR21532
to help everyone update their out-of-tree testcases.
This is part of PR21532.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224257 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-15 19:07:53 +00:00
!2 = ! { }
!3 = ! { !4 }
2015-04-29 16:38:44 +00:00
!4 = !DISubprogram ( name: "bar" , linkageName: "_Z3bari" , line: 1 , isLocal: false , isDefinition: true , virtualIndex: 6 , flags: D I F l a g P r o t o t y p e d , isOptimized: false , scopeLine: 1 , file: !1 , scope: !5 , type: !6 , function: i32 ( i32 ) * @_Z3bari , variables: !2 )
!5 = !DIFile ( filename: "debug-loc-offset1.cc" , directory: "/llvm_cmake_gcc" )
!6 = !DISubroutineType ( types: !7 )
IR: Make metadata typeless in assembly
Now that `Metadata` is typeless, reflect that in the assembly. These
are the matching assembly changes for the metadata/value split in
r223802.
- Only use the `metadata` type when referencing metadata from a call
intrinsic -- i.e., only when it's used as a `Value`.
- Stop pretending that `ValueAsMetadata` is wrapped in an `MDNode`
when referencing it from call intrinsics.
So, assembly like this:
define @foo(i32 %v) {
call void @llvm.foo(metadata !{i32 %v}, metadata !0)
call void @llvm.foo(metadata !{i32 7}, metadata !0)
call void @llvm.foo(metadata !1, metadata !0)
call void @llvm.foo(metadata !3, metadata !0)
call void @llvm.foo(metadata !{metadata !3}, metadata !0)
ret void, !bar !2
}
!0 = metadata !{metadata !2}
!1 = metadata !{i32* @global}
!2 = metadata !{metadata !3}
!3 = metadata !{}
turns into this:
define @foo(i32 %v) {
call void @llvm.foo(metadata i32 %v, metadata !0)
call void @llvm.foo(metadata i32 7, metadata !0)
call void @llvm.foo(metadata i32* @global, metadata !0)
call void @llvm.foo(metadata !3, metadata !0)
call void @llvm.foo(metadata !{!3}, metadata !0)
ret void, !bar !2
}
!0 = !{!2}
!1 = !{i32* @global}
!2 = !{!3}
!3 = !{}
I wrote an upgrade script that handled almost all of the tests in llvm
and many of the tests in cfe (even handling many `CHECK` lines). I've
attached it (or will attach it in a moment if you're speedy) to PR21532
to help everyone update their out-of-tree testcases.
This is part of PR21532.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224257 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-15 19:07:53 +00:00
!7 = ! { !8 , !8 }
2015-04-29 16:38:44 +00:00
!8 = !DIBasicType ( tag: D W _ T A G _ b a s e _ type , name: "int" , size: 32 , align: 32 , encoding: D W _ A T E _ s i g n e d )
!9 = !DICompileUnit ( language: D W _ L A N G _ C _ p l u s _ p l u s , producer: "clang version 3.5.0 (210479)" , isOptimized: false , emissionKind: 1 , file: !10 , enums: !2 , retainedTypes: !11 , subprograms: !13 , globals: !2 , imports: !2 )
!10 = !DIFile ( filename: "debug-loc-offset2.cc" , directory: "/llvm_cmake_gcc" )
IR: Make metadata typeless in assembly
Now that `Metadata` is typeless, reflect that in the assembly. These
are the matching assembly changes for the metadata/value split in
r223802.
- Only use the `metadata` type when referencing metadata from a call
intrinsic -- i.e., only when it's used as a `Value`.
- Stop pretending that `ValueAsMetadata` is wrapped in an `MDNode`
when referencing it from call intrinsics.
So, assembly like this:
define @foo(i32 %v) {
call void @llvm.foo(metadata !{i32 %v}, metadata !0)
call void @llvm.foo(metadata !{i32 7}, metadata !0)
call void @llvm.foo(metadata !1, metadata !0)
call void @llvm.foo(metadata !3, metadata !0)
call void @llvm.foo(metadata !{metadata !3}, metadata !0)
ret void, !bar !2
}
!0 = metadata !{metadata !2}
!1 = metadata !{i32* @global}
!2 = metadata !{metadata !3}
!3 = metadata !{}
turns into this:
define @foo(i32 %v) {
call void @llvm.foo(metadata i32 %v, metadata !0)
call void @llvm.foo(metadata i32 7, metadata !0)
call void @llvm.foo(metadata i32* @global, metadata !0)
call void @llvm.foo(metadata !3, metadata !0)
call void @llvm.foo(metadata !{!3}, metadata !0)
ret void, !bar !2
}
!0 = !{!2}
!1 = !{i32* @global}
!2 = !{!3}
!3 = !{}
I wrote an upgrade script that handled almost all of the tests in llvm
and many of the tests in cfe (even handling many `CHECK` lines). I've
attached it (or will attach it in a moment if you're speedy) to PR21532
to help everyone update their out-of-tree testcases.
This is part of PR21532.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224257 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-15 19:07:53 +00:00
!11 = ! { !12 }
2015-04-29 16:38:44 +00:00
!12 = !DICompositeType ( tag: D W _ T A G _ s t r u c t u r e _ type , name: "A" , line: 1 , flags: D I F l a g F w d D e c l , file: !10 , identifier: "_ZTS1A" )
IR: Make metadata typeless in assembly
Now that `Metadata` is typeless, reflect that in the assembly. These
are the matching assembly changes for the metadata/value split in
r223802.
- Only use the `metadata` type when referencing metadata from a call
intrinsic -- i.e., only when it's used as a `Value`.
- Stop pretending that `ValueAsMetadata` is wrapped in an `MDNode`
when referencing it from call intrinsics.
So, assembly like this:
define @foo(i32 %v) {
call void @llvm.foo(metadata !{i32 %v}, metadata !0)
call void @llvm.foo(metadata !{i32 7}, metadata !0)
call void @llvm.foo(metadata !1, metadata !0)
call void @llvm.foo(metadata !3, metadata !0)
call void @llvm.foo(metadata !{metadata !3}, metadata !0)
ret void, !bar !2
}
!0 = metadata !{metadata !2}
!1 = metadata !{i32* @global}
!2 = metadata !{metadata !3}
!3 = metadata !{}
turns into this:
define @foo(i32 %v) {
call void @llvm.foo(metadata i32 %v, metadata !0)
call void @llvm.foo(metadata i32 7, metadata !0)
call void @llvm.foo(metadata i32* @global, metadata !0)
call void @llvm.foo(metadata !3, metadata !0)
call void @llvm.foo(metadata !{!3}, metadata !0)
ret void, !bar !2
}
!0 = !{!2}
!1 = !{i32* @global}
!2 = !{!3}
!3 = !{}
I wrote an upgrade script that handled almost all of the tests in llvm
and many of the tests in cfe (even handling many `CHECK` lines). I've
attached it (or will attach it in a moment if you're speedy) to PR21532
to help everyone update their out-of-tree testcases.
This is part of PR21532.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224257 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-15 19:07:53 +00:00
!13 = ! { !14 }
2015-04-29 16:38:44 +00:00
!14 = !DISubprogram ( name: "baz" , linkageName: "_Z3baz1A" , line: 6 , isLocal: false , isDefinition: true , virtualIndex: 6 , flags: D I F l a g P r o t o t y p e d , isOptimized: false , scopeLine: 6 , file: !10 , scope: !15 , type: !16 , function: void ( %struct.A * ) * @_Z3baz1A , variables: !2 )
!15 = !DIFile ( filename: "debug-loc-offset2.cc" , directory: "/llvm_cmake_gcc" )
!16 = !DISubroutineType ( types: !17 )
IR: Make metadata typeless in assembly
Now that `Metadata` is typeless, reflect that in the assembly. These
are the matching assembly changes for the metadata/value split in
r223802.
- Only use the `metadata` type when referencing metadata from a call
intrinsic -- i.e., only when it's used as a `Value`.
- Stop pretending that `ValueAsMetadata` is wrapped in an `MDNode`
when referencing it from call intrinsics.
So, assembly like this:
define @foo(i32 %v) {
call void @llvm.foo(metadata !{i32 %v}, metadata !0)
call void @llvm.foo(metadata !{i32 7}, metadata !0)
call void @llvm.foo(metadata !1, metadata !0)
call void @llvm.foo(metadata !3, metadata !0)
call void @llvm.foo(metadata !{metadata !3}, metadata !0)
ret void, !bar !2
}
!0 = metadata !{metadata !2}
!1 = metadata !{i32* @global}
!2 = metadata !{metadata !3}
!3 = metadata !{}
turns into this:
define @foo(i32 %v) {
call void @llvm.foo(metadata i32 %v, metadata !0)
call void @llvm.foo(metadata i32 7, metadata !0)
call void @llvm.foo(metadata i32* @global, metadata !0)
call void @llvm.foo(metadata !3, metadata !0)
call void @llvm.foo(metadata !{!3}, metadata !0)
ret void, !bar !2
}
!0 = !{!2}
!1 = !{i32* @global}
!2 = !{!3}
!3 = !{}
I wrote an upgrade script that handled almost all of the tests in llvm
and many of the tests in cfe (even handling many `CHECK` lines). I've
attached it (or will attach it in a moment if you're speedy) to PR21532
to help everyone update their out-of-tree testcases.
This is part of PR21532.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224257 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-15 19:07:53 +00:00
!17 = ! { null , !12 }
!18 = ! { i32 2 , !"Dwarf Version" , i32 4 }
2015-03-03 17:24:31 +00:00
!19 = ! { i32 2 , !"Debug Info Version" , i32 3 }
IR: Make metadata typeless in assembly
Now that `Metadata` is typeless, reflect that in the assembly. These
are the matching assembly changes for the metadata/value split in
r223802.
- Only use the `metadata` type when referencing metadata from a call
intrinsic -- i.e., only when it's used as a `Value`.
- Stop pretending that `ValueAsMetadata` is wrapped in an `MDNode`
when referencing it from call intrinsics.
So, assembly like this:
define @foo(i32 %v) {
call void @llvm.foo(metadata !{i32 %v}, metadata !0)
call void @llvm.foo(metadata !{i32 7}, metadata !0)
call void @llvm.foo(metadata !1, metadata !0)
call void @llvm.foo(metadata !3, metadata !0)
call void @llvm.foo(metadata !{metadata !3}, metadata !0)
ret void, !bar !2
}
!0 = metadata !{metadata !2}
!1 = metadata !{i32* @global}
!2 = metadata !{metadata !3}
!3 = metadata !{}
turns into this:
define @foo(i32 %v) {
call void @llvm.foo(metadata i32 %v, metadata !0)
call void @llvm.foo(metadata i32 7, metadata !0)
call void @llvm.foo(metadata i32* @global, metadata !0)
call void @llvm.foo(metadata !3, metadata !0)
call void @llvm.foo(metadata !{!3}, metadata !0)
ret void, !bar !2
}
!0 = !{!2}
!1 = !{i32* @global}
!2 = !{!3}
!3 = !{}
I wrote an upgrade script that handled almost all of the tests in llvm
and many of the tests in cfe (even handling many `CHECK` lines). I've
attached it (or will attach it in a moment if you're speedy) to PR21532
to help everyone update their out-of-tree testcases.
This is part of PR21532.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224257 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-15 19:07:53 +00:00
!20 = ! { !"clang version 3.5.0 (210479)" }
2015-04-29 16:38:44 +00:00
!21 = !DILocalVariable ( tag: D W _ T A G _ a r g _ v a r i a b l e , name: "b" , line: 1 , arg: 1 , scope: !4 , file: !5 , type: !8 )
!22 = !DILocation ( line: 1 , scope: !4 )
!23 = !DILocation ( line: 2 , scope: !4 )
!24 = !DILocalVariable ( tag: D W _ T A G _ a r g _ v a r i a b l e , name: "a" , line: 6 , arg: 1 , scope: !14 , file: !15 , type: !"_ZTS1A" )
!25 = !DILocation ( line: 6 , scope: !14 )
!26 = !DILocalVariable ( tag: D W _ T A G _ a u t o _ v a r i a b l e , name: "z" , line: 7 , scope: !14 , file: !15 , type: !8 )
!27 = !DILocation ( line: 7 , scope: !14 )
!28 = !DILocation ( line: 8 , scope: !29 )
!29 = distinct !DILexicalBlock ( line: 8 , column: 0 , file: !10 , scope: !14 )
!30 = !DILocation ( line: 9 , scope: !29 )
!31 = !DILocation ( line: 10 , scope: !32 )
!32 = distinct !DILexicalBlock ( line: 10 , column: 0 , file: !10 , scope: !14 )
!33 = !DILocation ( line: 11 , scope: !32 )
!34 = !DILocation ( line: 12 , scope: !14 )