2013-07-27 01:02:41 +08:00
; REQUIRES: object-emission
2014-07-26 01:11:58 +08:00
; RUN: llc < %s -o %t -filetype=obj -O0 -generate-type-units -mtriple=x86_64-unknown-linux-gnu
2014-01-10 09:38:41 +08:00
; RUN: llvm-dwarfdump %t | FileCheck --check-prefix=CHECK --check-prefix=SINGLE %s
2014-08-27 13:04:14 +08:00
; RUN: llvm-readobj -s -t %t | FileCheck --check-prefix=OBJ_SINGLE %s
2014-01-10 09:38:41 +08:00
2014-07-26 01:11:58 +08:00
; RUN: llc < %s -split-dwarf=Enable -o %t -filetype=obj -O0 -generate-type-units -mtriple=x86_64-unknown-linux-gnu
2014-01-10 09:38:41 +08:00
; RUN: llvm-dwarfdump %t | FileCheck --check-prefix=CHECK --check-prefix=FISSION %s
2014-08-27 13:04:14 +08:00
; RUN: llvm-readobj -s -t %t | FileCheck --check-prefix=OBJ_FISSION %s
2013-11-26 08:22:37 +08:00
2014-02-12 08:40:47 +08:00
; Generated from bar.cpp:
; #line 1 "bar.h"
2013-07-27 01:02:41 +08:00
; struct bar {};
2014-02-12 08:40:47 +08:00
; #line 2 "bar.cpp"
2013-07-30 07:53:08 +08:00
2013-07-27 01:02:41 +08:00
; struct bar b;
2013-07-30 07:53:08 +08:00
2013-07-27 01:02:41 +08:00
; void foo(void) {
; struct baz {};
; baz b;
; }
2013-07-30 07:53:08 +08:00
2013-07-27 01:02:41 +08:00
; namespace echidna {
; namespace capybara {
; namespace mongoose {
; class fluffy {
; int a;
; int b;
; };
2013-07-30 07:53:08 +08:00
2013-07-27 01:02:41 +08:00
; fluffy animal;
; }
; }
; }
2013-07-30 07:53:08 +08:00
2013-07-27 01:02:41 +08:00
; namespace {
2013-07-30 07:53:08 +08:00
; struct walrus {
; walrus() {}
; };
2013-07-27 01:02:41 +08:00
; }
2013-07-30 07:53:08 +08:00
2013-07-27 01:02:41 +08:00
; walrus w;
2013-07-30 07:53:08 +08:00
2013-07-30 07:53:05 +08:00
; struct wombat {
; struct {
2013-07-30 07:53:08 +08:00
; int a;
; int b;
2013-07-30 07:53:05 +08:00
; } a_b;
; };
2013-07-30 07:53:08 +08:00
2013-07-30 07:53:05 +08:00
; wombat wom;
2013-07-27 01:02:41 +08:00
2014-01-10 09:38:41 +08:00
; SINGLE-LABEL: .debug_info contents:
; FISSION-LABEL: .debug_info.dwo contents:
2013-12-05 09:00:12 +08:00
; CHECK: Compile Unit: length = [[CU_SIZE:[0-9a-f]+]]
2013-12-14 05:33:40 +08:00
2014-03-06 09:42:00 +08:00
; CHECK: [[BAR:^0x........]]: DW_TAG_structure_type
2014-02-01 03:52:26 +08:00
; CHECK-NEXT: DW_AT_declaration
2014-03-06 09:42:00 +08:00
; CHECK-NEXT: DW_AT_signature {{.*}} (0x1d02f3be30cc5688)
; CHECK: [[FLUFFY:^0x........]]: DW_TAG_class_type
2014-02-01 03:52:26 +08:00
; CHECK-NEXT: DW_AT_declaration
2014-03-06 09:42:00 +08:00
; CHECK-NEXT: DW_AT_signature {{.*}} (0xb04af47397402e77)
2014-01-04 02:59:42 +08:00
; Ensure the CU-local type 'walrus' is not placed in a type unit.
2014-03-06 09:42:00 +08:00
; CHECK: [[WALRUS:^0x........]]: DW_TAG_structure_type
2014-01-10 09:38:41 +08:00
; CHECK-NEXT: DW_AT_name{{.*}}"walrus"
2014-01-04 02:59:42 +08:00
; CHECK-NEXT: DW_AT_byte_size
; CHECK-NEXT: DW_AT_decl_file
; CHECK-NEXT: DW_AT_decl_line
2014-03-06 09:42:00 +08:00
; CHECK: [[WOMBAT:^0x........]]: DW_TAG_structure_type
; CHECK-NEXT: DW_AT_declaration
; CHECK-NEXT: DW_AT_signature {{.*}} (0xfd756cee88f8a118)
2014-01-10 09:38:41 +08:00
; SINGLE-LABEL: .debug_types contents:
2014-08-27 13:04:14 +08:00
; FISSION-NOT: .debug_types contents:
2014-01-10 09:38:41 +08:00
; FISSION-LABEL: .debug_types.dwo contents:
2013-12-14 05:33:40 +08:00
2013-12-13 09:24:54 +08:00
; Check that we generate a hash for bar and the value.
2014-01-04 02:59:42 +08:00
; CHECK-NOT: type_signature
; CHECK-LABEL: type_signature = 0x1d02f3be30cc5688
2013-12-13 09:24:54 +08:00
; CHECK: DW_TAG_structure_type
Provide gmlt-like inline scope information in the skeleton CU to facilitate symbolication without needing the .dwo files
Clang -gsplit-dwarf self-host -O0, binary increases by 0.0005%, -O2,
binary increases by 25%.
A large binary inside Google, split-dwarf, -O0, and other internal flags
(GDB index, etc) increases by 1.8%, optimized build is 35%.
The size impact may be somewhat greater in .o files (I haven't measured
that much - since the linked executable -O0 numbers seemed low enough)
due to relocations. These relocations could be removed if we taught the
llvm-symbolizer to handle indexed addressing in the .o file (GDB can't
cope with this just yet, but GDB won't be reading this info anyway).
Also debug_ranges could be shared between .o and .dwo, though ideally
debug_ranges would get a schema that could used index(+offset)
addressing, and move to the .dwo file, then we'd be back to sharing
addresses in the address pool again.
But for now, these sizes seem small enough to go ahead with this.
Verified that no other DW_TAGs are produced into the .o file other than
subprograms and inlined_subroutines.
llvm-svn: 221306
2014-11-05 06:12:25 +08:00
; FISSION-NEXT: DW_AT_name {{.*}} ( indexed {{.*}} "bar"
; SINGLE-NEXT: DW_AT_name {{.*}} "bar"
2013-11-20 07:08:21 +08:00
2013-12-14 05:33:40 +08:00
2013-11-20 07:08:21 +08:00
; Check that we generate a hash for fluffy and the value.
2014-01-04 02:59:42 +08:00
; CHECK-NOT: type_signature
; CHECK-LABEL: type_signature = 0xb04af47397402e77
; CHECK-NOT: DW_AT_GNU_odr_signature [DW_FORM_data8] (0x9a0124d5a0c21c52)
2013-07-27 01:02:41 +08:00
; CHECK: DW_TAG_namespace
2014-01-10 09:38:41 +08:00
; CHECK-NEXT: DW_AT_name{{.*}}"echidna"
2013-07-27 01:02:41 +08:00
; CHECK: DW_TAG_namespace
2014-01-10 09:38:41 +08:00
; CHECK-NEXT: DW_AT_name{{.*}}"capybara"
2013-07-27 01:02:41 +08:00
; CHECK: DW_TAG_namespace
2014-01-10 09:38:41 +08:00
; CHECK-NEXT: DW_AT_name{{.*}}"mongoose"
2013-07-27 01:02:41 +08:00
; CHECK: DW_TAG_class_type
2014-01-10 09:38:41 +08:00
; CHECK-NEXT: DW_AT_name{{.*}}"fluffy"
2013-07-30 07:53:05 +08:00
2013-12-13 09:24:54 +08:00
; Check that we generate a hash for wombat and the value, but not for the
; anonymous type contained within.
2014-01-04 02:59:42 +08:00
; CHECK-NOT: type_signature
; CHECK-LABEL: type_signature = 0xfd756cee88f8a118
; CHECK-NOT: DW_AT_GNU_odr_signature [DW_FORM_data8] (0x685bcc220141e9d7)
2013-12-13 09:24:54 +08:00
; CHECK: DW_TAG_structure_type
2014-01-10 09:38:41 +08:00
; CHECK-NEXT: DW_AT_name{{.*}}"wombat"
2013-12-14 05:33:40 +08:00
2014-01-04 02:59:42 +08:00
; CHECK-NOT: type_signature
; CHECK-LABEL: type_signature = 0xe94f6d3843e62d6b
2013-12-13 09:24:54 +08:00
; CHECK: DW_TAG_type_unit
2014-03-18 09:17:26 +08:00
; CHECK: DW_AT_stmt_list [DW_FORM_sec_offset] (0x00000000)
2013-12-14 05:33:40 +08:00
; CHECK-NOT: NULL
; CHECK-NOT: DW_AT_GNU_odr_signature
2013-12-13 09:24:54 +08:00
; CHECK: DW_TAG_structure_type
2013-12-14 05:33:40 +08:00
; The signature for the outer 'wombat' type
2014-01-04 02:59:42 +08:00
; CHECK: DW_AT_signature [DW_FORM_ref_sig8] (0xfd756cee88f8a118)
2013-07-30 07:53:05 +08:00
; CHECK: DW_TAG_structure_type
2013-11-20 07:08:21 +08:00
; CHECK-NOT: DW_AT_name
; CHECK-NOT: DW_AT_GNU_odr_signature
2013-07-30 07:53:05 +08:00
; CHECK: DW_TAG_member
2014-01-10 09:38:41 +08:00
; CHECK-NEXT: DW_AT_name{{.*}}"a"
2013-07-30 07:53:05 +08:00
2014-02-15 03:51:35 +08:00
; CHECK-LABEL: .debug_line contents:
; CHECK: Line table prologue
; CHECK-NOT: file_names[
2014-03-18 09:17:26 +08:00
; SINGLE: file_names{{.*}} bar.h
2014-02-15 03:51:35 +08:00
; CHECK: file_names{{.*}} bar.cpp
; CHECK-NOT: file_names[
2014-03-18 09:17:26 +08:00
; CHECK-LABEL: .debug_line.dwo contents:
; FISSION: Line table prologue
2014-03-18 10:13:23 +08:00
; FISSION: opcode_base: 1
; FISSION-NOT: standard_opcode_lengths
2014-03-19 08:11:28 +08:00
; FISSION-NOT: include_directories
2014-03-18 09:17:26 +08:00
; FISSION-NOT: file_names[
; FISSION: file_names{{.*}} bar.h
; FISSION: file_names{{.*}} bar.cpp
; FISSION-NOT: file_names[
2014-02-15 03:51:35 +08:00
; CHECK-LABEL: .debug_str contents:
2013-11-27 03:14:34 +08:00
; Use the unit size as a rough hash/identifier for the unit we're dealing with
; it happens to be unambiguous at the moment, but it's hardly ideal.
2013-11-26 08:22:37 +08:00
; CHECK-LABEL: .debug_pubtypes contents:
2013-11-27 03:14:34 +08:00
; Don't emit pubtype entries for type DIEs in the compile unit that just indirect to a type unit.
2013-12-05 09:00:12 +08:00
; CHECK-NEXT: unit_size = [[CU_SIZE]]
2013-11-27 03:14:34 +08:00
; CHECK-NEXT: Offset Name
2014-06-07 06:16:56 +08:00
; CHECK-DAG: [[BAR]] "bar"
; CHECK-DAG: [[WALRUS]] "(anonymous namespace)::walrus"
; CHECK-DAG: [[WOMBAT]] "wombat"
; CHECK-DAG: [[FLUFFY]] "echidna::capybara::mongoose::fluffy"
2013-11-26 08:22:37 +08:00
2014-07-26 01:11:58 +08:00
; Make sure debug_types are in comdat groups. This could be more rigid to check
; that they're the right comdat groups (each type in a separate comdat group,
; etc)
2014-08-27 13:04:14 +08:00
; OBJ_SINGLE: Name: .debug_types (
; OBJ_SINGLE-NOT: }
; OBJ_SINGLE: SHF_GROUP
2014-07-26 01:11:58 +08:00
; Fission type units don't go in comdat groups, since their linker is debug
; aware it's handled using the debug info semantics rather than raw ELF object
; semantics.
; OBJ_FISSION: Name: .debug_types.dwo (
; OBJ_FISSION-NOT: SHF_GROUP
; OBJ_FISSION: }
2013-07-27 01:02:41 +08:00
%struct.bar = type { i8 }
%"class.echidna::capybara::mongoose::fluffy" = type { i32 , i32 }
2013-07-30 07:53:08 +08:00
%"struct.<anonymous namespace>::walrus" = type { i8 }
2013-07-30 07:53:05 +08:00
%struct.wombat = type { %struct.anon }
%struct.anon = type { i32 , i32 }
2013-07-27 01:02:41 +08:00
%struct.baz = type { i8 }
@b = global %struct.bar zeroinitializer , align 1
@_ZN7echidna8capybara8mongoose6animalE = global %"class.echidna::capybara::mongoose::fluffy" zeroinitializer , align 4
2013-07-30 07:53:08 +08:00
@w = internal global %"struct.<anonymous namespace>::walrus" zeroinitializer , align 1
2013-07-30 07:53:05 +08:00
@wom = global %struct.wombat zeroinitializer , align 4
2013-07-30 07:53:08 +08:00
@llvm.global_ctors = appending global [ 1 x { i32 , void ( ) * } ] [ { i32 , void ( ) * } { i32 65535 , void ( ) * @_GLOBAL__I_a } ]
2013-07-27 01:02:41 +08:00
; Function Attrs: nounwind uwtable
define void @_Z3foov ( ) #0 {
entry:
%b = alloca %struct.baz , align 1
2015-03-04 01:24:31 +08:00
call void @llvm.dbg.declare ( metadata %struct.baz * %b , metadata !46 , metadata !MDExpression ( ) ) , !dbg !48
2014-02-12 08:40:47 +08:00
ret void , !dbg !49
2013-07-27 01:02:41 +08: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.
llvm-svn: 218787
2014-10-02 02:55:02 +08:00
declare void @llvm.dbg.declare ( metadata , metadata , metadata ) #1
2013-07-27 01:02:41 +08:00
2013-07-30 07:53:08 +08:00
define internal void @__cxx_global_var_init ( ) section ".text.startup" {
entry:
2014-02-12 08:40:47 +08:00
call void @_ZN12_GLOBAL__N_16walrusC2Ev ( %"struct.<anonymous namespace>::walrus" * @w ) , !dbg !50
ret void , !dbg !50
2013-07-30 07:53:08 +08:00
}
; Function Attrs: nounwind uwtable
define internal void @_ZN12_GLOBAL__N_16walrusC2Ev ( %"struct.<anonymous namespace>::walrus" * %this ) unnamed_addr #0 align 2 {
entry:
%this.addr = alloca %"struct.<anonymous namespace>::walrus" * , align 8
store %"struct.<anonymous namespace>::walrus" * %this , %"struct.<anonymous namespace>::walrus" * * %this.addr , align 8
2015-03-04 01:24:31 +08:00
call void @llvm.dbg.declare ( metadata %"struct.<anonymous namespace>::walrus" * * %this.addr , metadata !51 , metadata !MDExpression ( ) ) , !dbg !53
2015-02-28 05:17:42 +08:00
%this1 = load %"struct.<anonymous namespace>::walrus" * , %"struct.<anonymous namespace>::walrus" * * %this.addr
2014-02-12 08:40:47 +08:00
ret void , !dbg !54
2013-07-30 07:53:08 +08:00
}
define internal void @_GLOBAL__I_a ( ) section ".text.startup" {
entry:
2014-02-12 08:40:47 +08:00
call void @__cxx_global_var_init ( ) , !dbg !55
ret void , !dbg !55
2013-07-30 07:53:08 +08:00
}
2013-11-02 06:29:28 +08:00
attributes #0 = { nounwind uwtable "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" }
2013-07-27 01:02:41 +08:00
attributes #1 = { nounwind readnone }
!llvm.dbg.cu = ! { !0 }
2014-02-12 08:40:47 +08:00
!llvm.module.flags = ! { !43 , !44 }
!llvm.ident = ! { !45 }
2013-07-27 01:02:41 +08:00
2015-03-04 01:24:31 +08:00
!0 = !MDCompileUnit ( language: D W _ L A N G _ C _ p l u s _ p l u s , producer: "clang version 3.5 " , isOptimized: false , splitDebugFilename: "bar.dwo" , emissionKind: 0 , file: !1 , enums: !2 , retainedTypes: !3 , subprograms: !21 , globals: !38 , imports: !2 )
!1 = !MDFile ( filename: "bar.cpp" , directory: "/tmp/dbginfo" )
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.
llvm-svn: 224257
2014-12-16 03:07:53 +08:00
!2 = ! { }
!3 = ! { !4 , !6 , !14 , !17 }
2015-03-04 01:24:31 +08:00
!4 = !MDCompositeType ( tag: D W _ T A G _ s t r u c t u r e _ type , name: "bar" , line: 1 , size: 8 , align: 8 , file: !5 , elements: !2 , identifier: "_ZTS3bar" )
!5 = !MDFile ( filename: "bar.h" , directory: "/tmp/dbginfo" )
!6 = !MDCompositeType ( tag: D W _ T A G _ c l a s s _ type , name: "fluffy" , line: 13 , size: 64 , align: 32 , file: !1 , scope: !7 , elements: !10 , identifier: "_ZTSN7echidna8capybara8mongoose6fluffyE" )
!7 = !MDNamespace ( name: "mongoose" , line: 12 , file: !1 , scope: !8 )
!8 = !MDNamespace ( name: "capybara" , line: 11 , file: !1 , scope: !9 )
!9 = !MDNamespace ( name: "echidna" , line: 10 , file: !1 , scope: null )
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.
llvm-svn: 224257
2014-12-16 03:07:53 +08:00
!10 = ! { !11 , !13 }
2015-03-04 01:24:31 +08:00
!11 = !MDDerivedType ( tag: D W _ T A G _ m e m b e r , name: "a" , line: 14 , size: 32 , align: 32 , flags: D I F l a g P r i v a t e , file: !1 , scope: !"_ZTSN7echidna8capybara8mongoose6fluffyE" , baseType: !12 )
!12 = !MDBasicType ( 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 )
!13 = !MDDerivedType ( tag: D W _ T A G _ m e m b e r , name: "b" , line: 15 , size: 32 , align: 32 , offset: 32 , flags: D I F l a g P r i v a t e , file: !1 , scope: !"_ZTSN7echidna8capybara8mongoose6fluffyE" , baseType: !12 )
!14 = !MDCompositeType ( tag: D W _ T A G _ s t r u c t u r e _ type , name: "wombat" , line: 31 , size: 64 , align: 32 , file: !1 , elements: !15 , identifier: "_ZTS6wombat" )
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.
llvm-svn: 224257
2014-12-16 03:07:53 +08:00
!15 = ! { !16 }
2015-03-04 01:24:31 +08:00
!16 = !MDDerivedType ( tag: D W _ T A G _ m e m b e r , name: "a_b" , line: 35 , size: 64 , align: 32 , file: !1 , scope: !"_ZTS6wombat" , baseType: !"_ZTSN6wombatUt_E" )
!17 = !MDCompositeType ( tag: D W _ T A G _ s t r u c t u r e _ type , line: 32 , size: 64 , align: 32 , file: !1 , scope: !"_ZTS6wombat" , elements: !18 , identifier: "_ZTSN6wombatUt_E" )
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.
llvm-svn: 224257
2014-12-16 03:07:53 +08:00
!18 = ! { !19 , !20 }
2015-03-04 01:24:31 +08:00
!19 = !MDDerivedType ( tag: D W _ T A G _ m e m b e r , name: "a" , line: 33 , size: 32 , align: 32 , file: !1 , scope: !"_ZTSN6wombatUt_E" , baseType: !12 )
!20 = !MDDerivedType ( tag: D W _ T A G _ m e m b e r , name: "b" , line: 34 , size: 32 , align: 32 , offset: 32 , file: !1 , scope: !"_ZTSN6wombatUt_E" , baseType: !12 )
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.
llvm-svn: 224257
2014-12-16 03:07:53 +08:00
!21 = ! { !22 , !26 , !27 , !36 }
2015-03-04 01:24:31 +08:00
!22 = !MDSubprogram ( name: "foo" , linkageName: "_Z3foov" , line: 5 , 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: 5 , file: !1 , scope: !23 , type: !24 , function: void ( ) * @_Z3foov , variables: !2 )
!23 = !MDFile ( filename: "bar.cpp" , directory: "/tmp/dbginfo" )
!24 = !MDSubroutineType ( types: !25 )
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.
llvm-svn: 224257
2014-12-16 03:07:53 +08:00
!25 = ! { null }
2015-03-04 01:24:31 +08:00
!26 = !MDSubprogram ( name: "__cxx_global_var_init" , line: 29 , isLocal: true , isDefinition: true , virtualIndex: 6 , flags: D I F l a g P r o t o t y p e d , isOptimized: false , scopeLine: 29 , file: !1 , scope: !23 , type: !24 , function: void ( ) * @__cxx_global_var_init , variables: !2 )
!27 = !MDSubprogram ( name: "walrus" , linkageName: "_ZN12_GLOBAL__N_16walrusC2Ev" , line: 25 , isLocal: true , isDefinition: true , virtualIndex: 6 , flags: D I F l a g P r o t o t y p e d , isOptimized: false , scopeLine: 25 , file: !1 , scope: !28 , type: !32 , function: void ( %"struct.<anonymous namespace>::walrus" * ) * @_ZN12_GLOBAL__N_16walrusC2Ev , declaration: !31 , variables: !2 )
!28 = !MDCompositeType ( tag: D W _ T A G _ s t r u c t u r e _ type , name: "walrus" , line: 24 , size: 8 , align: 8 , file: !1 , scope: !29 , elements: !30 )
!29 = !MDNamespace ( line: 23 , file: !1 , scope: null )
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.
llvm-svn: 224257
2014-12-16 03:07:53 +08:00
!30 = ! { !31 }
2015-03-28 10:26:45 +08:00
!31 = !MDSubprogram ( name: "walrus" , line: 25 , isLocal: false , isDefinition: false , virtualIndex: 6 , flags: D I F l a g P r o t o t y p e d , isOptimized: false , scopeLine: 25 , file: !1 , scope: !28 , type: !32 )
2015-03-04 01:24:31 +08:00
!32 = !MDSubroutineType ( types: !33 )
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.
llvm-svn: 224257
2014-12-16 03:07:53 +08:00
!33 = ! { null , !34 }
2015-03-04 01:24:31 +08:00
!34 = !MDDerivedType ( tag: D W _ T A G _ p o i n t e r _ type , size: 64 , align: 64 , flags: D I F l a g A r t i f i c i a l | D I F l a g O b j e c t P o i n t e r , baseType: !28 )
!36 = !MDSubprogram ( name: "" , linkageName: "_GLOBAL__I_a" , line: 25 , isLocal: true , isDefinition: true , virtualIndex: 6 , flags: D I F l a g A r t i f i c i a l , isOptimized: false , scopeLine: 25 , file: !1 , scope: !23 , type: !37 , function: void ( ) * @_GLOBAL__I_a , variables: !2 )
!37 = !MDSubroutineType ( types: !2 )
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.
llvm-svn: 224257
2014-12-16 03:07:53 +08:00
!38 = ! { !39 , !40 , !41 , !42 }
2015-03-04 01:24:31 +08:00
!39 = !MDGlobalVariable ( name: "b" , line: 3 , isLocal: false , isDefinition: true , scope: null , file: !23 , type: !4 , variable: %struct.bar * @b )
!40 = !MDGlobalVariable ( name: "animal" , linkageName: "_ZN7echidna8capybara8mongoose6animalE" , line: 18 , isLocal: false , isDefinition: true , scope: !7 , file: !23 , type: !6 , variable: %"class.echidna::capybara::mongoose::fluffy" * @_ZN7echidna8capybara8mongoose6animalE )
!41 = !MDGlobalVariable ( name: "w" , line: 29 , isLocal: true , isDefinition: true , scope: null , file: !23 , type: !28 , variable: %"struct.<anonymous namespace>::walrus" * @w )
!42 = !MDGlobalVariable ( name: "wom" , line: 38 , isLocal: false , isDefinition: true , scope: null , file: !23 , type: !14 , variable: %struct.wombat * @wom )
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.
llvm-svn: 224257
2014-12-16 03:07:53 +08:00
!43 = ! { i32 2 , !"Dwarf Version" , i32 4 }
2015-03-04 01:24:31 +08:00
!44 = ! { i32 1 , !"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.
llvm-svn: 224257
2014-12-16 03:07:53 +08:00
!45 = ! { !"clang version 3.5 " }
2015-03-04 01:24:31 +08:00
!46 = !MDLocalVariable ( tag: D W _ T A G _ a u t o _ v a r i a b l e , name: "b" , line: 7 , scope: !22 , file: !23 , type: !47 )
!47 = !MDCompositeType ( tag: D W _ T A G _ s t r u c t u r e _ type , name: "baz" , line: 6 , size: 8 , align: 8 , file: !1 , scope: !22 , elements: !2 )
2015-01-15 06:27:36 +08:00
!48 = !MDLocation ( line: 7 , scope: !22 )
!49 = !MDLocation ( line: 8 , scope: !22 )
!50 = !MDLocation ( line: 29 , scope: !26 )
2015-03-04 01:24:31 +08:00
!51 = !MDLocalVariable ( tag: D W _ T A G _ a r g _ v a r i a b l e , name: "this" , arg: 1 , flags: D I F l a g A r t i f i c i a l | D I F l a g O b j e c t P o i n t e r , scope: !27 , type: !52 )
!52 = !MDDerivedType ( tag: D W _ T A G _ p o i n t e r _ type , size: 64 , align: 64 , baseType: !28 )
2015-01-15 06:27:36 +08:00
!53 = !MDLocation ( line: 0 , scope: !27 )
!54 = !MDLocation ( line: 25 , scope: !27 )
!55 = !MDLocation ( line: 25 , scope: !36 )