2017-09-13 05:50:41 +08:00
|
|
|
; RUN: llc -mtriple=x86_64-pc-linux-gnu < %s | FileCheck -check-prefix=ASM %s
|
|
|
|
; RUN: llc -mtriple=x86_64-pc-linux-gnu -filetype=obj < %s | llvm-dwarfdump -v - | FileCheck %s
|
2013-09-13 08:35:05 +08:00
|
|
|
; ModuleID = 'dwarf-public-names.cpp'
|
|
|
|
;
|
|
|
|
; Generated from:
|
|
|
|
;
|
|
|
|
; struct C {
|
|
|
|
; void member_function();
|
|
|
|
; static int static_member_function();
|
|
|
|
; static int static_member_variable;
|
|
|
|
; };
|
|
|
|
;
|
|
|
|
; int C::static_member_variable = 0;
|
|
|
|
;
|
|
|
|
; void C::member_function() {
|
|
|
|
; static_member_variable = 0;
|
|
|
|
; }
|
|
|
|
;
|
|
|
|
; int C::static_member_function() {
|
|
|
|
; return static_member_variable;
|
|
|
|
; }
|
|
|
|
;
|
|
|
|
; C global_variable;
|
|
|
|
;
|
|
|
|
; int global_function() {
|
|
|
|
; return -1;
|
|
|
|
; }
|
|
|
|
;
|
|
|
|
; namespace ns {
|
|
|
|
; void global_namespace_function() {
|
|
|
|
; global_variable.member_function();
|
|
|
|
; }
|
|
|
|
; int global_namespace_variable = 1;
|
2015-04-15 02:08:25 +08:00
|
|
|
; extern int global_namespace_variable_decl;
|
2013-10-17 10:06:06 +08:00
|
|
|
; struct D {
|
|
|
|
; int A;
|
|
|
|
; } d;
|
2013-09-13 08:35:05 +08:00
|
|
|
; }
|
2015-04-15 02:08:25 +08:00
|
|
|
;
|
|
|
|
; using ns::global_namespace_variable_decl;
|
|
|
|
;
|
|
|
|
; namespace {
|
|
|
|
; int i;
|
|
|
|
; }
|
|
|
|
;
|
|
|
|
; int *f3() {
|
|
|
|
; static int z;
|
|
|
|
; return &z;
|
|
|
|
; }
|
|
|
|
;
|
|
|
|
; namespace {
|
|
|
|
; namespace inner {
|
|
|
|
; int b;
|
|
|
|
; }
|
|
|
|
; }
|
|
|
|
;
|
|
|
|
; namespace outer {
|
|
|
|
; namespace {
|
|
|
|
; int c;
|
|
|
|
; }
|
|
|
|
; }
|
|
|
|
;
|
|
|
|
; int f7() {
|
|
|
|
; return i + *f3() + inner::b + outer::c;
|
|
|
|
; }
|
2013-09-13 08:35:05 +08:00
|
|
|
|
2013-09-24 04:55:35 +08:00
|
|
|
; ASM: .section .debug_gnu_pubnames
|
2018-11-14 04:18:08 +08:00
|
|
|
; ASM: .byte 32 # Attributes: VARIABLE, EXTERNAL
|
2013-10-17 10:06:06 +08:00
|
|
|
; ASM-NEXT: .asciz "global_variable" # External Name
|
2013-09-20 07:01:29 +08:00
|
|
|
|
2013-09-24 04:55:35 +08:00
|
|
|
; ASM: .section .debug_gnu_pubtypes
|
2018-11-14 04:59:25 +08:00
|
|
|
; ASM: .byte 16 # Attributes: TYPE, EXTERNAL
|
2013-09-25 03:50:00 +08:00
|
|
|
; ASM-NEXT: .asciz "C" # External Name
|
2013-09-24 04:55:35 +08:00
|
|
|
|
2013-09-20 07:43:46 +08:00
|
|
|
; CHECK: .debug_info contents:
|
2014-06-07 02:45:14 +08:00
|
|
|
; CHECK: Compile Unit:
|
2014-03-06 13:47:39 +08:00
|
|
|
; CHECK: DW_AT_GNU_pubnames [DW_FORM_flag_present] (true)
|
|
|
|
; CHECK-NOT: DW_AT_GNU_pubtypes [
|
2013-10-16 09:37:49 +08:00
|
|
|
|
2014-10-24 03:12:43 +08:00
|
|
|
; CHECK: [[STATIC_MEM_VAR:0x[0-9a-f]+]]: DW_TAG_variable
|
|
|
|
; CHECK-NEXT: DW_AT_specification {{.*}} "static_member_variable"
|
|
|
|
|
2014-06-07 02:45:14 +08:00
|
|
|
; CHECK: [[C:0x[0-9a-f]+]]: DW_TAG_structure_type
|
2013-09-25 03:50:00 +08:00
|
|
|
; CHECK-NEXT: DW_AT_name {{.*}} "C"
|
2013-10-16 09:37:49 +08:00
|
|
|
|
2014-10-10 23:51:02 +08:00
|
|
|
; CHECK: DW_TAG_member
|
2013-10-16 09:37:49 +08:00
|
|
|
; CHECK-NEXT: DW_AT_name {{.*}} "static_member_variable"
|
|
|
|
|
2014-10-06 11:36:31 +08:00
|
|
|
; CHECK: DW_TAG_subprogram
|
2015-03-11 06:44:45 +08:00
|
|
|
; CHECK-NEXT: DW_AT_linkage_name
|
2013-09-20 07:43:46 +08:00
|
|
|
; CHECK-NEXT: DW_AT_name {{.*}} "member_function"
|
2013-10-16 09:37:49 +08:00
|
|
|
|
2014-10-06 11:36:31 +08:00
|
|
|
; CHECK: DW_TAG_subprogram
|
2015-03-11 06:44:45 +08:00
|
|
|
; CHECK-NEXT: DW_AT_linkage_name
|
2013-09-20 07:43:46 +08:00
|
|
|
; CHECK-NEXT: DW_AT_name {{.*}} "static_member_function"
|
2013-10-16 09:37:49 +08:00
|
|
|
|
2014-06-07 02:45:14 +08:00
|
|
|
; CHECK: [[INT:0x[0-9a-f]+]]: DW_TAG_base_type
|
2013-10-30 06:49:29 +08:00
|
|
|
; CHECK-NEXT: DW_AT_name {{.*}} "int"
|
|
|
|
|
2014-06-07 02:45:14 +08:00
|
|
|
; CHECK: [[GLOB_VAR:0x[0-9a-f]+]]: DW_TAG_variable
|
2013-09-20 07:43:46 +08:00
|
|
|
; CHECK-NEXT: DW_AT_name {{.*}} "global_variable"
|
2013-10-16 09:37:49 +08:00
|
|
|
|
2014-06-07 02:45:14 +08:00
|
|
|
; CHECK: [[NS:0x[0-9a-f]+]]: DW_TAG_namespace
|
2013-10-16 09:37:49 +08:00
|
|
|
; CHECK-NEXT: DW_AT_name {{.*}} "ns"
|
|
|
|
|
2014-10-24 03:12:43 +08:00
|
|
|
; CHECK: [[GLOB_NS_VAR:0x[0-9a-f]+]]: DW_TAG_variable
|
2013-09-20 07:43:46 +08:00
|
|
|
; CHECK-NEXT: DW_AT_name {{.*}} "global_namespace_variable"
|
2014-10-24 03:12:43 +08:00
|
|
|
; CHECK-NOT: DW_AT_specification
|
|
|
|
; CHECK: DW_AT_location
|
|
|
|
; CHECK-NOT: DW_AT_specification
|
2013-10-16 09:37:49 +08:00
|
|
|
|
2014-10-24 03:12:43 +08:00
|
|
|
; CHECK: [[D_VAR:0x[0-9a-f]+]]: DW_TAG_variable
|
2013-10-17 10:06:06 +08:00
|
|
|
; CHECK-NEXT: DW_AT_name {{.*}} "d"
|
2014-10-24 03:12:43 +08:00
|
|
|
; CHECK-NOT: DW_AT_specification
|
|
|
|
; CHECK: DW_AT_location
|
|
|
|
; CHECK-NOT: DW_AT_specification
|
2013-10-17 10:06:06 +08:00
|
|
|
|
2014-06-07 02:45:14 +08:00
|
|
|
; CHECK: [[D:0x[0-9a-f]+]]: DW_TAG_structure_type
|
2013-10-29 13:49:41 +08:00
|
|
|
; CHECK-NEXT: DW_AT_name {{.*}} "D"
|
|
|
|
|
2014-06-07 02:45:14 +08:00
|
|
|
; CHECK: [[GLOB_NS_FUNC:0x[0-9a-f]+]]: DW_TAG_subprogram
|
2014-05-24 05:11:46 +08:00
|
|
|
; CHECK-NOT: DW_TAG
|
2015-03-11 06:44:45 +08:00
|
|
|
; CHECK: DW_AT_linkage_name
|
2014-05-24 05:11:46 +08:00
|
|
|
; CHECK-NOT: DW_TAG
|
|
|
|
; CHECK: DW_AT_name {{.*}} "global_namespace_function"
|
2016-04-30 09:44:07 +08:00
|
|
|
|
|
|
|
; CHECK: DW_TAG_subprogram
|
|
|
|
; CHECK-NOT: DW_TAG
|
|
|
|
; CHECK: DW_AT_name {{.*}} "f3"
|
|
|
|
; CHECK-NOT: {{DW_TAG|NULL}}
|
|
|
|
; CHECK: [[F3_Z:.*]]: DW_TAG_variable
|
|
|
|
; CHECK-NOT: DW_TAG
|
|
|
|
; CHECK: DW_AT_name {{.*}} "z"
|
|
|
|
; CHECK-NOT: {{DW_TAG|NULL}}
|
|
|
|
; CHECK: DW_AT_location
|
|
|
|
; CHECK-NOT: {{DW_TAG|NULL}}
|
2014-06-07 06:16:56 +08:00
|
|
|
; CHECK: NULL
|
|
|
|
; CHECK-NOT: {{DW_TAG|NULL}}
|
|
|
|
|
2015-04-15 01:17:04 +08:00
|
|
|
; CHECK: [[ANON:.*]]: DW_TAG_namespace
|
|
|
|
; CHECK-NOT: DW_AT_name
|
|
|
|
; CHECK: [[ANON_I:.*]]: DW_TAG_variable
|
|
|
|
; CHECK-NOT: DW_TAG
|
|
|
|
; CHECK: DW_AT_name {{.*}} "i"
|
|
|
|
; CHECK-NOT: {{DW_TAG|NULL}}
|
|
|
|
; CHECK: [[ANON_INNER:.*]]: DW_TAG_namespace
|
|
|
|
; CHECK-NOT: DW_TAG
|
|
|
|
; CHECK: DW_AT_name {{.*}} "inner"
|
|
|
|
; CHECK-NOT: {{DW_TAG|NULL}}
|
|
|
|
; CHECK: [[ANON_INNER_B:.*]]: DW_TAG_variable
|
|
|
|
; CHECK-NOT: DW_TAG
|
|
|
|
; CHECK: DW_AT_name {{.*}} "b"
|
|
|
|
; CHECK-NOT: {{DW_TAG|NULL}}
|
|
|
|
; CHECK: NULL
|
|
|
|
; CHECK-NOT: {{DW_TAG|NULL}}
|
|
|
|
; CHECK: NULL
|
|
|
|
; CHECK-NOT: {{DW_TAG|NULL}}
|
|
|
|
|
2014-06-07 06:16:56 +08:00
|
|
|
; CHECK: [[OUTER:.*]]: DW_TAG_namespace
|
|
|
|
; CHECK-NOT: DW_TAG
|
|
|
|
; CHECK: DW_AT_name {{.*}} "outer"
|
|
|
|
; CHECK-NOT: {{DW_TAG|NULL}}
|
|
|
|
; CHECK: [[OUTER_ANON:.*]]: DW_TAG_namespace
|
|
|
|
; CHECK-NOT: {{DW_TAG|NULL}}
|
|
|
|
; CHECK-NOT: DW_AT_name
|
2014-10-24 03:12:43 +08:00
|
|
|
; CHECK: [[OUTER_ANON_C:.*]]: DW_TAG_variable
|
2014-06-07 06:16:56 +08:00
|
|
|
; CHECK-NOT: DW_TAG
|
|
|
|
; CHECK: DW_AT_name {{.*}} "c"
|
|
|
|
; CHECK-NOT: {{DW_TAG|NULL}}
|
|
|
|
; CHECK: NULL
|
|
|
|
; CHECK-NOT: {{DW_TAG|NULL}}
|
|
|
|
; FIXME: We probably shouldn't bother describing the implicit
|
2014-06-08 05:23:09 +08:00
|
|
|
; import of the preceding anonymous namespace. This should be fixed
|
2014-06-07 06:16:56 +08:00
|
|
|
; in clang.
|
|
|
|
; CHECK: DW_TAG_imported_module
|
|
|
|
; CHECK-NOT: {{DW_TAG|NULL}}
|
|
|
|
; CHECK: NULL
|
|
|
|
; CHECK-NOT: {{DW_TAG|NULL}}
|
|
|
|
|
2015-04-15 02:08:25 +08:00
|
|
|
; CHECK: DW_TAG_imported_declaration
|
|
|
|
; CHECK-NOT: {{DW_TAG|NULL}}
|
|
|
|
|
2014-06-07 02:45:14 +08:00
|
|
|
; CHECK: [[MEM_FUNC:0x[0-9a-f]+]]: DW_TAG_subprogram
|
2014-05-24 05:11:46 +08:00
|
|
|
; CHECK-NOT: DW_TAG
|
2014-10-06 11:36:31 +08:00
|
|
|
; CHECK: DW_AT_specification {{.*}} "_ZN1C15member_functionEv"
|
2013-10-16 09:37:49 +08:00
|
|
|
|
2014-06-07 02:45:14 +08:00
|
|
|
; CHECK: [[STATIC_MEM_FUNC:0x[0-9a-f]+]]: DW_TAG_subprogram
|
2014-05-24 05:11:46 +08:00
|
|
|
; CHECK-NOT: DW_TAG
|
2014-10-06 11:36:31 +08:00
|
|
|
; CHECK: DW_AT_specification {{.*}} "_ZN1C22static_member_functionEv"
|
2013-10-16 09:37:49 +08:00
|
|
|
|
2014-06-07 02:45:14 +08:00
|
|
|
; CHECK: [[GLOBAL_FUNC:0x[0-9a-f]+]]: DW_TAG_subprogram
|
2014-05-24 05:11:46 +08:00
|
|
|
; CHECK-NOT: DW_TAG
|
2015-03-11 06:44:45 +08:00
|
|
|
; CHECK: DW_AT_linkage_name
|
2014-05-24 05:11:46 +08:00
|
|
|
; CHECK-NOT: DW_TAG
|
|
|
|
; CHECK: DW_AT_name {{.*}} "global_function"
|
2013-09-20 07:43:46 +08:00
|
|
|
|
|
|
|
; CHECK-LABEL: .debug_gnu_pubnames contents:
|
2014-06-07 02:45:14 +08:00
|
|
|
; CHECK-NEXT: length = {{.*}} version = 0x0002 unit_offset = 0x00000000 unit_size = {{.*}}
|
2013-09-20 07:01:29 +08:00
|
|
|
; CHECK-NEXT: Offset Linkage Kind Name
|
2015-04-15 02:08:25 +08:00
|
|
|
; CHECK-NEXT: [[GLOBAL_FUNC]] EXTERNAL FUNCTION "global_function"
|
|
|
|
; CHECK-NEXT: [[NS]] EXTERNAL TYPE "ns"
|
|
|
|
; CHECK-NEXT: [[OUTER_ANON_C]] STATIC VARIABLE "outer::(anonymous namespace)::c"
|
|
|
|
; CHECK-NEXT: [[ANON_I]] STATIC VARIABLE "(anonymous namespace)::i"
|
2014-06-07 06:16:56 +08:00
|
|
|
; GCC Doesn't put local statics in pubnames, but it seems not unreasonable and
|
|
|
|
; comes out naturally from LLVM's implementation, so I'm OK with it for now. If
|
|
|
|
; it's demonstrated that this is a major size concern or degrades debug info
|
|
|
|
; consumer behavior, feel free to change it.
|
2015-04-15 02:08:25 +08:00
|
|
|
; CHECK-NEXT: [[F3_Z]] STATIC VARIABLE "f3::z"
|
2017-04-27 07:15:10 +08:00
|
|
|
; CHECK-NEXT: [[ANON]] EXTERNAL TYPE "(anonymous namespace)"
|
|
|
|
; CHECK-NEXT: [[OUTER_ANON]] EXTERNAL TYPE "outer::(anonymous namespace)"
|
|
|
|
; CHECK-NEXT: [[ANON_INNER_B]] STATIC VARIABLE "(anonymous namespace)::inner::b"
|
|
|
|
; CHECK-NEXT: [[OUTER]] EXTERNAL TYPE "outer"
|
|
|
|
; CHECK-NEXT: [[MEM_FUNC]] EXTERNAL FUNCTION "C::member_function"
|
|
|
|
; CHECK-NEXT: [[GLOB_VAR]] EXTERNAL VARIABLE "global_variable"
|
|
|
|
; CHECK-NEXT: [[GLOB_NS_VAR]] EXTERNAL VARIABLE "ns::global_namespace_variable"
|
|
|
|
; CHECK-NEXT: [[ANON_INNER]] EXTERNAL TYPE "(anonymous namespace)::inner"
|
|
|
|
; CHECK-NEXT: [[D_VAR]] EXTERNAL VARIABLE "ns::d"
|
|
|
|
; CHECK-NEXT: [[GLOB_NS_FUNC]] EXTERNAL FUNCTION "ns::global_namespace_function"
|
|
|
|
; CHECK-NEXT: [[STATIC_MEM_VAR]] EXTERNAL VARIABLE "C::static_member_variable"
|
|
|
|
; CHECK-NEXT: [[STATIC_MEM_FUNC]] EXTERNAL FUNCTION "C::static_member_function"
|
2014-06-07 06:16:56 +08:00
|
|
|
|
2013-09-25 03:50:00 +08:00
|
|
|
; CHECK-LABEL: debug_gnu_pubtypes contents:
|
2013-11-02 01:53:30 +08:00
|
|
|
; CHECK: Offset Linkage Kind Name
|
2013-10-16 09:37:49 +08:00
|
|
|
; CHECK-DAG: [[C]] EXTERNAL TYPE "C"
|
2013-10-17 10:06:06 +08:00
|
|
|
; CHECK-DAG: [[D]] EXTERNAL TYPE "ns::D"
|
2013-10-16 09:37:49 +08:00
|
|
|
; CHECK-DAG: [[INT]] STATIC TYPE "int"
|
2013-09-25 03:50:00 +08:00
|
|
|
|
2016-12-22 08:45:21 +08:00
|
|
|
source_filename = "test/DebugInfo/X86/gnu-public-names.ll"
|
|
|
|
|
2013-09-13 08:35:05 +08:00
|
|
|
%struct.C = type { i8 }
|
2013-10-17 10:06:06 +08:00
|
|
|
%"struct.ns::D" = type { i32 }
|
2013-09-13 08:35:05 +08:00
|
|
|
|
2016-12-22 08:45:21 +08:00
|
|
|
@_ZN1C22static_member_variableE = global i32 0, align 4, !dbg !0
|
|
|
|
@global_variable = global %struct.C zeroinitializer, align 1, !dbg !22
|
|
|
|
@_ZN2ns25global_namespace_variableE = global i32 1, align 4, !dbg !24
|
|
|
|
@_ZN2ns1dE = global %"struct.ns::D" zeroinitializer, align 4, !dbg !26
|
|
|
|
@_ZZ2f3vE1z = internal global i32 0, align 4, !dbg !28
|
|
|
|
@_ZN12_GLOBAL__N_11iE = internal global i32 0, align 4, !dbg !34
|
|
|
|
@_ZN12_GLOBAL__N_15inner1bE = internal global i32 0, align 4, !dbg !37
|
|
|
|
@_ZN5outer12_GLOBAL__N_11cE = internal global i32 0, align 4, !dbg !40
|
2013-09-13 08:35:05 +08:00
|
|
|
|
2013-09-24 08:17:54 +08:00
|
|
|
; Function Attrs: nounwind uwtable
|
2016-12-22 08:45:21 +08:00
|
|
|
define void @_ZN1C15member_functionEv(%struct.C* %this) #0 align 2 !dbg !51 {
|
2013-09-13 08:35:05 +08:00
|
|
|
entry:
|
|
|
|
%this.addr = alloca %struct.C*, align 8
|
|
|
|
store %struct.C* %this, %struct.C** %this.addr, align 8
|
2016-12-22 08:45:21 +08:00
|
|
|
call void @llvm.dbg.declare(metadata %struct.C** %this.addr, metadata !52, metadata !54), !dbg !55
|
2015-02-28 05:17:42 +08:00
|
|
|
%this1 = load %struct.C*, %struct.C** %this.addr
|
2016-12-22 08:45:21 +08:00
|
|
|
store i32 0, i32* @_ZN1C22static_member_variableE, align 4, !dbg !56
|
|
|
|
ret void, !dbg !57
|
2013-09-13 08:35:05 +08:00
|
|
|
}
|
|
|
|
|
2013-09-24 08:17:54 +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-09-13 08:35:05 +08:00
|
|
|
|
2013-09-24 08:17:54 +08:00
|
|
|
; Function Attrs: nounwind uwtable
|
2016-12-22 08:45:21 +08:00
|
|
|
define i32 @_ZN1C22static_member_functionEv() #0 align 2 !dbg !58 {
|
2013-09-13 08:35:05 +08:00
|
|
|
entry:
|
2016-12-22 08:45:21 +08:00
|
|
|
%0 = load i32, i32* @_ZN1C22static_member_variableE, align 4, !dbg !59
|
|
|
|
ret i32 %0, !dbg !59
|
2013-09-13 08:35:05 +08:00
|
|
|
}
|
|
|
|
|
2013-09-24 08:17:54 +08:00
|
|
|
; Function Attrs: nounwind uwtable
|
2016-12-22 08:45:21 +08:00
|
|
|
define i32 @_Z15global_functionv() #0 !dbg !60 {
|
2013-09-13 08:35:05 +08:00
|
|
|
entry:
|
2016-12-22 08:45:21 +08:00
|
|
|
ret i32 -1, !dbg !61
|
2013-09-13 08:35:05 +08:00
|
|
|
}
|
|
|
|
|
2013-09-24 08:17:54 +08:00
|
|
|
; Function Attrs: nounwind uwtable
|
2016-12-22 08:45:21 +08:00
|
|
|
define void @_ZN2ns25global_namespace_functionEv() #0 !dbg !62 {
|
2013-09-13 08:35:05 +08:00
|
|
|
entry:
|
2016-12-22 08:45:21 +08:00
|
|
|
call void @_ZN1C15member_functionEv(%struct.C* @global_variable), !dbg !65
|
|
|
|
ret void, !dbg !66
|
2014-06-07 06:16:56 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
; Function Attrs: nounwind uwtable
|
2016-12-22 08:45:21 +08:00
|
|
|
define i32* @_Z2f3v() #0 !dbg !30 {
|
2014-06-07 06:16:56 +08:00
|
|
|
entry:
|
2016-12-22 08:45:21 +08:00
|
|
|
ret i32* @_ZZ2f3vE1z, !dbg !67
|
2014-06-07 06:16:56 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
; Function Attrs: nounwind uwtable
|
2016-12-22 08:45:21 +08:00
|
|
|
define i32 @_Z2f7v() #0 !dbg !68 {
|
2014-06-07 06:16:56 +08:00
|
|
|
entry:
|
2016-12-22 08:45:21 +08:00
|
|
|
%0 = load i32, i32* @_ZN12_GLOBAL__N_11iE, align 4, !dbg !69
|
|
|
|
%call = call i32* @_Z2f3v(), !dbg !69
|
|
|
|
%1 = load i32, i32* %call, align 4, !dbg !69
|
|
|
|
%add = add nsw i32 %0, %1, !dbg !69
|
|
|
|
%2 = load i32, i32* @_ZN12_GLOBAL__N_15inner1bE, align 4, !dbg !69
|
|
|
|
%add1 = add nsw i32 %add, %2, !dbg !69
|
|
|
|
%3 = load i32, i32* @_ZN5outer12_GLOBAL__N_11cE, align 4, !dbg !69
|
|
|
|
%add2 = add nsw i32 %add1, %3, !dbg !69
|
|
|
|
ret i32 %add2, !dbg !69
|
2013-09-13 08:35:05 +08:00
|
|
|
}
|
|
|
|
|
2015-04-15 01:17:04 +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" "target-cpu"="x86-64" "unsafe-fp-math"="false" "use-soft-float"="false" }
|
2013-09-13 08:35:05 +08:00
|
|
|
attributes #1 = { nounwind readnone }
|
|
|
|
|
2016-12-22 08:45:21 +08:00
|
|
|
!llvm.dbg.cu = !{!2}
|
2015-04-15 02:08:25 +08:00
|
|
|
!llvm.module.flags = !{!48, !49}
|
|
|
|
!llvm.ident = !{!50}
|
2013-09-13 08:35:05 +08:00
|
|
|
|
2017-08-31 02:06:51 +08:00
|
|
|
!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
|
2016-12-22 08:45:21 +08:00
|
|
|
!1 = !DIGlobalVariable(name: "static_member_variable", linkageName: "_ZN1C22static_member_variableE", scope: !2, file: !3, line: 7, type: !9, isLocal: false, isDefinition: true, declaration: !8)
|
2018-08-17 05:29:55 +08:00
|
|
|
!2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !3, producer: "clang version 3.7.0 (trunk 234897) (llvm/trunk 234911)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, retainedTypes: !5, globals: !21, imports: !44, nameTableKind: GNU)
|
2016-12-22 08:45:21 +08:00
|
|
|
!3 = !DIFile(filename: "gnu-public-names.cpp", directory: "/tmp/dbginfo")
|
|
|
|
!4 = !{}
|
|
|
|
!5 = !{!6, !17}
|
|
|
|
!6 = !DICompositeType(tag: DW_TAG_structure_type, name: "C", file: !3, line: 1, size: 8, align: 8, elements: !7, identifier: "_ZTS1C")
|
|
|
|
!7 = !{!8, !10, !14}
|
|
|
|
!8 = !DIDerivedType(tag: DW_TAG_member, name: "static_member_variable", scope: !6, file: !3, line: 4, baseType: !9, flags: DIFlagStaticMember)
|
|
|
|
!9 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
|
|
|
|
!10 = !DISubprogram(name: "member_function", linkageName: "_ZN1C15member_functionEv", scope: !6, file: !3, line: 2, type: !11, isLocal: false, isDefinition: false, scopeLine: 2, flags: DIFlagPrototyped, isOptimized: false)
|
|
|
|
!11 = !DISubroutineType(types: !12)
|
|
|
|
!12 = !{null, !13}
|
|
|
|
!13 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !6, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
|
|
|
|
!14 = !DISubprogram(name: "static_member_function", linkageName: "_ZN1C22static_member_functionEv", scope: !6, file: !3, line: 3, type: !15, isLocal: false, isDefinition: false, scopeLine: 3, flags: DIFlagPrototyped, isOptimized: false)
|
|
|
|
!15 = !DISubroutineType(types: !16)
|
|
|
|
!16 = !{!9}
|
|
|
|
!17 = !DICompositeType(tag: DW_TAG_structure_type, name: "D", scope: !18, file: !3, line: 29, size: 32, align: 32, elements: !19, identifier: "_ZTSN2ns1DE")
|
2017-04-29 06:25:46 +08:00
|
|
|
!18 = !DINamespace(name: "ns", scope: null)
|
2016-12-22 08:45:21 +08:00
|
|
|
!19 = !{!20}
|
|
|
|
!20 = !DIDerivedType(tag: DW_TAG_member, name: "A", scope: !17, file: !3, line: 30, baseType: !9, size: 32, align: 32)
|
|
|
|
!21 = !{!0, !22, !24, !26, !28, !34, !37, !40}
|
2017-08-31 02:06:51 +08:00
|
|
|
!22 = !DIGlobalVariableExpression(var: !23, expr: !DIExpression())
|
2016-12-22 08:45:21 +08:00
|
|
|
!23 = !DIGlobalVariable(name: "global_variable", scope: !2, file: !3, line: 17, type: !6, isLocal: false, isDefinition: true)
|
2017-08-31 02:06:51 +08:00
|
|
|
!24 = !DIGlobalVariableExpression(var: !25, expr: !DIExpression())
|
2016-12-22 08:45:21 +08:00
|
|
|
!25 = !DIGlobalVariable(name: "global_namespace_variable", linkageName: "_ZN2ns25global_namespace_variableE", scope: !18, file: !3, line: 27, type: !9, isLocal: false, isDefinition: true)
|
2017-08-31 02:06:51 +08:00
|
|
|
!26 = !DIGlobalVariableExpression(var: !27, expr: !DIExpression())
|
2016-12-22 08:45:21 +08:00
|
|
|
!27 = !DIGlobalVariable(name: "d", linkageName: "_ZN2ns1dE", scope: !18, file: !3, line: 31, type: !17, isLocal: false, isDefinition: true)
|
2017-08-31 02:06:51 +08:00
|
|
|
!28 = !DIGlobalVariableExpression(var: !29, expr: !DIExpression())
|
2016-12-22 08:45:21 +08:00
|
|
|
!29 = !DIGlobalVariable(name: "z", scope: !30, file: !3, line: 41, type: !9, isLocal: true, isDefinition: true)
|
[DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label.
In order to set breakpoints on labels and list source code around
labels, we need collect debug information for labels, i.e., label
name, the function label belong, line number in the file, and the
address label located. In order to keep these information in LLVM
IR and to allow backend to generate debug information correctly.
We create a new kind of metadata for labels, DILabel. The format
of DILabel is
!DILabel(scope: !1, name: "foo", file: !2, line: 3)
We hope to keep debug information as much as possible even the
code is optimized. So, we create a new kind of intrinsic for label
metadata to avoid the metadata is eliminated with basic block.
The intrinsic will keep existing if we keep it from optimized out.
The format of the intrinsic is
llvm.dbg.label(metadata !1)
It has only one argument, that is the DILabel metadata. The
intrinsic will follow the label immediately. Backend could get the
label metadata through the intrinsic's parameter.
We also create DIBuilder API for labels to be used by Frontend.
Frontend could use createLabel() to allocate DILabel objects, and use
insertLabel() to insert llvm.dbg.label intrinsic in LLVM IR.
Differential Revision: https://reviews.llvm.org/D45024
Patch by Hsiangkai Wang.
llvm-svn: 331841
2018-05-09 10:40:45 +08:00
|
|
|
!30 = distinct !DISubprogram(name: "f3", linkageName: "_Z2f3v", scope: !3, file: !3, line: 40, type: !31, isLocal: false, isDefinition: true, scopeLine: 40, flags: DIFlagPrototyped, isOptimized: false, unit: !2, retainedNodes: !4)
|
2016-12-22 08:45:21 +08:00
|
|
|
!31 = !DISubroutineType(types: !32)
|
|
|
|
!32 = !{!33}
|
|
|
|
!33 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !9, size: 64, align: 64)
|
2017-08-31 02:06:51 +08:00
|
|
|
!34 = !DIGlobalVariableExpression(var: !35, expr: !DIExpression())
|
2016-12-22 08:45:21 +08:00
|
|
|
!35 = !DIGlobalVariable(name: "i", linkageName: "_ZN12_GLOBAL__N_11iE", scope: !36, file: !3, line: 37, type: !9, isLocal: true, isDefinition: true)
|
2017-04-29 06:25:46 +08:00
|
|
|
!36 = !DINamespace(scope: null)
|
2017-08-31 02:06:51 +08:00
|
|
|
!37 = !DIGlobalVariableExpression(var: !38, expr: !DIExpression())
|
2016-12-22 08:45:21 +08:00
|
|
|
!38 = !DIGlobalVariable(name: "b", linkageName: "_ZN12_GLOBAL__N_15inner1bE", scope: !39, file: !3, line: 47, type: !9, isLocal: true, isDefinition: true)
|
2017-04-29 06:25:46 +08:00
|
|
|
!39 = !DINamespace(name: "inner", scope: !36)
|
2017-08-31 02:06:51 +08:00
|
|
|
!40 = !DIGlobalVariableExpression(var: !41, expr: !DIExpression())
|
2016-12-22 08:45:21 +08:00
|
|
|
!41 = !DIGlobalVariable(name: "c", linkageName: "_ZN5outer12_GLOBAL__N_11cE", scope: !42, file: !3, line: 53, type: !9, isLocal: true, isDefinition: true)
|
2017-04-29 06:25:46 +08:00
|
|
|
!42 = !DINamespace(scope: !43)
|
|
|
|
!43 = !DINamespace(name: "outer", scope: null)
|
2015-04-15 02:08:25 +08:00
|
|
|
!44 = !{!45, !47}
|
2017-07-19 08:09:54 +08:00
|
|
|
!45 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !2, entity: !46, file:!3, line: 34)
|
2016-12-22 08:45:21 +08:00
|
|
|
!46 = !DIGlobalVariable(name: "global_namespace_variable_decl", linkageName: "_ZN2ns30global_namespace_variable_declE", scope: !18, file: !3, line: 28, type: !9, isLocal: false, isDefinition: false)
|
2017-07-19 08:09:54 +08:00
|
|
|
!47 = !DIImportedEntity(tag: DW_TAG_imported_module, scope: !43, entity: !42, file: !3, line: 43)
|
2015-04-15 02:08:25 +08:00
|
|
|
!48 = !{i32 2, !"Dwarf Version", i32 4}
|
|
|
|
!49 = !{i32 2, !"Debug Info Version", i32 3}
|
|
|
|
!50 = !{!"clang version 3.7.0 (trunk 234897) (llvm/trunk 234911)"}
|
[DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label.
In order to set breakpoints on labels and list source code around
labels, we need collect debug information for labels, i.e., label
name, the function label belong, line number in the file, and the
address label located. In order to keep these information in LLVM
IR and to allow backend to generate debug information correctly.
We create a new kind of metadata for labels, DILabel. The format
of DILabel is
!DILabel(scope: !1, name: "foo", file: !2, line: 3)
We hope to keep debug information as much as possible even the
code is optimized. So, we create a new kind of intrinsic for label
metadata to avoid the metadata is eliminated with basic block.
The intrinsic will keep existing if we keep it from optimized out.
The format of the intrinsic is
llvm.dbg.label(metadata !1)
It has only one argument, that is the DILabel metadata. The
intrinsic will follow the label immediately. Backend could get the
label metadata through the intrinsic's parameter.
We also create DIBuilder API for labels to be used by Frontend.
Frontend could use createLabel() to allocate DILabel objects, and use
insertLabel() to insert llvm.dbg.label intrinsic in LLVM IR.
Differential Revision: https://reviews.llvm.org/D45024
Patch by Hsiangkai Wang.
llvm-svn: 331841
2018-05-09 10:40:45 +08:00
|
|
|
!51 = distinct !DISubprogram(name: "member_function", linkageName: "_ZN1C15member_functionEv", scope: !6, file: !3, line: 9, type: !11, isLocal: false, isDefinition: true, scopeLine: 9, flags: DIFlagPrototyped, isOptimized: false, unit: !2, declaration: !10, retainedNodes: !4)
|
2016-12-22 08:45:21 +08:00
|
|
|
!52 = !DILocalVariable(name: "this", arg: 1, scope: !51, type: !53, flags: DIFlagArtificial | DIFlagObjectPointer)
|
|
|
|
!53 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !6, size: 64, align: 64)
|
|
|
|
!54 = !DIExpression()
|
|
|
|
!55 = !DILocation(line: 0, scope: !51)
|
|
|
|
!56 = !DILocation(line: 10, scope: !51)
|
|
|
|
!57 = !DILocation(line: 11, scope: !51)
|
[DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label.
In order to set breakpoints on labels and list source code around
labels, we need collect debug information for labels, i.e., label
name, the function label belong, line number in the file, and the
address label located. In order to keep these information in LLVM
IR and to allow backend to generate debug information correctly.
We create a new kind of metadata for labels, DILabel. The format
of DILabel is
!DILabel(scope: !1, name: "foo", file: !2, line: 3)
We hope to keep debug information as much as possible even the
code is optimized. So, we create a new kind of intrinsic for label
metadata to avoid the metadata is eliminated with basic block.
The intrinsic will keep existing if we keep it from optimized out.
The format of the intrinsic is
llvm.dbg.label(metadata !1)
It has only one argument, that is the DILabel metadata. The
intrinsic will follow the label immediately. Backend could get the
label metadata through the intrinsic's parameter.
We also create DIBuilder API for labels to be used by Frontend.
Frontend could use createLabel() to allocate DILabel objects, and use
insertLabel() to insert llvm.dbg.label intrinsic in LLVM IR.
Differential Revision: https://reviews.llvm.org/D45024
Patch by Hsiangkai Wang.
llvm-svn: 331841
2018-05-09 10:40:45 +08:00
|
|
|
!58 = distinct !DISubprogram(name: "static_member_function", linkageName: "_ZN1C22static_member_functionEv", scope: !6, file: !3, line: 13, type: !15, isLocal: false, isDefinition: true, scopeLine: 13, flags: DIFlagPrototyped, isOptimized: false, unit: !2, declaration: !14, retainedNodes: !4)
|
2016-12-22 08:45:21 +08:00
|
|
|
!59 = !DILocation(line: 14, scope: !58)
|
[DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label.
In order to set breakpoints on labels and list source code around
labels, we need collect debug information for labels, i.e., label
name, the function label belong, line number in the file, and the
address label located. In order to keep these information in LLVM
IR and to allow backend to generate debug information correctly.
We create a new kind of metadata for labels, DILabel. The format
of DILabel is
!DILabel(scope: !1, name: "foo", file: !2, line: 3)
We hope to keep debug information as much as possible even the
code is optimized. So, we create a new kind of intrinsic for label
metadata to avoid the metadata is eliminated with basic block.
The intrinsic will keep existing if we keep it from optimized out.
The format of the intrinsic is
llvm.dbg.label(metadata !1)
It has only one argument, that is the DILabel metadata. The
intrinsic will follow the label immediately. Backend could get the
label metadata through the intrinsic's parameter.
We also create DIBuilder API for labels to be used by Frontend.
Frontend could use createLabel() to allocate DILabel objects, and use
insertLabel() to insert llvm.dbg.label intrinsic in LLVM IR.
Differential Revision: https://reviews.llvm.org/D45024
Patch by Hsiangkai Wang.
llvm-svn: 331841
2018-05-09 10:40:45 +08:00
|
|
|
!60 = distinct !DISubprogram(name: "global_function", linkageName: "_Z15global_functionv", scope: !3, file: !3, line: 19, type: !15, isLocal: false, isDefinition: true, scopeLine: 19, flags: DIFlagPrototyped, isOptimized: false, unit: !2, retainedNodes: !4)
|
2016-12-22 08:45:21 +08:00
|
|
|
!61 = !DILocation(line: 20, scope: !60)
|
[DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label.
In order to set breakpoints on labels and list source code around
labels, we need collect debug information for labels, i.e., label
name, the function label belong, line number in the file, and the
address label located. In order to keep these information in LLVM
IR and to allow backend to generate debug information correctly.
We create a new kind of metadata for labels, DILabel. The format
of DILabel is
!DILabel(scope: !1, name: "foo", file: !2, line: 3)
We hope to keep debug information as much as possible even the
code is optimized. So, we create a new kind of intrinsic for label
metadata to avoid the metadata is eliminated with basic block.
The intrinsic will keep existing if we keep it from optimized out.
The format of the intrinsic is
llvm.dbg.label(metadata !1)
It has only one argument, that is the DILabel metadata. The
intrinsic will follow the label immediately. Backend could get the
label metadata through the intrinsic's parameter.
We also create DIBuilder API for labels to be used by Frontend.
Frontend could use createLabel() to allocate DILabel objects, and use
insertLabel() to insert llvm.dbg.label intrinsic in LLVM IR.
Differential Revision: https://reviews.llvm.org/D45024
Patch by Hsiangkai Wang.
llvm-svn: 331841
2018-05-09 10:40:45 +08:00
|
|
|
!62 = distinct !DISubprogram(name: "global_namespace_function", linkageName: "_ZN2ns25global_namespace_functionEv", scope: !18, file: !3, line: 24, type: !63, isLocal: false, isDefinition: true, scopeLine: 24, flags: DIFlagPrototyped, isOptimized: false, unit: !2, retainedNodes: !4)
|
2016-12-22 08:45:21 +08:00
|
|
|
!63 = !DISubroutineType(types: !64)
|
|
|
|
!64 = !{null}
|
|
|
|
!65 = !DILocation(line: 25, scope: !62)
|
|
|
|
!66 = !DILocation(line: 26, scope: !62)
|
|
|
|
!67 = !DILocation(line: 42, scope: !30)
|
[DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label.
In order to set breakpoints on labels and list source code around
labels, we need collect debug information for labels, i.e., label
name, the function label belong, line number in the file, and the
address label located. In order to keep these information in LLVM
IR and to allow backend to generate debug information correctly.
We create a new kind of metadata for labels, DILabel. The format
of DILabel is
!DILabel(scope: !1, name: "foo", file: !2, line: 3)
We hope to keep debug information as much as possible even the
code is optimized. So, we create a new kind of intrinsic for label
metadata to avoid the metadata is eliminated with basic block.
The intrinsic will keep existing if we keep it from optimized out.
The format of the intrinsic is
llvm.dbg.label(metadata !1)
It has only one argument, that is the DILabel metadata. The
intrinsic will follow the label immediately. Backend could get the
label metadata through the intrinsic's parameter.
We also create DIBuilder API for labels to be used by Frontend.
Frontend could use createLabel() to allocate DILabel objects, and use
insertLabel() to insert llvm.dbg.label intrinsic in LLVM IR.
Differential Revision: https://reviews.llvm.org/D45024
Patch by Hsiangkai Wang.
llvm-svn: 331841
2018-05-09 10:40:45 +08:00
|
|
|
!68 = distinct !DISubprogram(name: "f7", linkageName: "_Z2f7v", scope: !3, file: !3, line: 57, type: !15, isLocal: false, isDefinition: true, scopeLine: 57, flags: DIFlagPrototyped, isOptimized: false, unit: !2, retainedNodes: !4)
|
2016-12-22 08:45:21 +08:00
|
|
|
!69 = !DILocation(line: 58, scope: !68)
|
|
|
|
|