2014-01-31 01:53:45 +08:00
; RUN: llc -mcpu=core2 -mtriple=i686-pc-win32 -O0 < %s | FileCheck --check-prefix=X86 %s
2016-11-22 04:13:32 +08:00
; RUN: llc -mcpu=core2 -mtriple=i686-pc-win32-itanium -O0 < %s | FileCheck --check-prefix=X86 %s
2018-05-09 04:56:04 +08:00
; RUN: llc -mcpu=core2 -mtriple=i686-pc-win32-gnu -O0 < %s | FileCheck --check-prefix=X86 %s
2015-02-19 03:32:05 +08:00
; RUN: llc -mcpu=core2 -mtriple=i686-pc-win32 -o - -O0 < %s | llvm-mc -triple=i686-pc-win32 -filetype=obj | llvm-readobj -s -sr -codeview -section-symbols | FileCheck --check-prefix=OBJ32 %s
2016-11-22 04:13:32 +08:00
; RUN: llc -mcpu=core2 -mtriple=i686-pc-win32-itanium -o - -O0 < %s | llvm-mc -triple=i686-pc-win32 -filetype=obj | llvm-readobj -s -sr -codeview -section-symbols | FileCheck --check-prefix=OBJ32 %s
2018-05-09 04:56:04 +08:00
; RUN: llc -mcpu=core2 -mtriple=i686-pc-win32-gnu -o - -O0 < %s | llvm-mc -triple=i686-pc-win32 -filetype=obj | llvm-readobj -s -sr -codeview -section-symbols | FileCheck --check-prefix=OBJ32 %s
2014-01-31 01:53:45 +08:00
; RUN: llc -mcpu=core2 -mtriple=x86_64-pc-win32 -O0 < %s | FileCheck --check-prefix=X64 %s
2016-11-22 04:13:32 +08:00
; RUN: llc -mcpu=core2 -mtriple=x86_64-pc-win32-itanium -O0 < %s | FileCheck --check-prefix=X64 %s
2018-05-09 04:56:04 +08:00
; RUN: llc -mcpu=core2 -mtriple=x86_64-pc-win32-gnu -O0 < %s | FileCheck --check-prefix=X64 %s
2015-02-19 03:32:05 +08:00
; RUN: llc -mcpu=core2 -mtriple=x86_64-pc-win32 -o - -O0 < %s | llvm-mc -triple=x86_64-pc-win32 -filetype=obj | llvm-readobj -s -sr -codeview -section-symbols | FileCheck --check-prefix=OBJ64 %s
2016-11-22 04:13:32 +08:00
; RUN: llc -mcpu=core2 -mtriple=x86_64-pc-win32-itanium -o - -O0 < %s | llvm-mc -triple=x86_64-pc-win32 -filetype=obj | llvm-readobj -s -sr -codeview -section-symbols | FileCheck --check-prefix=OBJ64 %s
2018-05-09 04:56:04 +08:00
; RUN: llc -mcpu=core2 -mtriple=x86_64-pc-win32-gnu -o - -O0 < %s | llvm-mc -triple=x86_64-pc-win32 -filetype=obj | llvm-readobj -s -sr -codeview -section-symbols | FileCheck --check-prefix=OBJ64 %s
2014-01-30 09:39:17 +08:00
; This LL file was generated by running clang on the following code:
; D:\test.c:
; 1 void g(void);
; 2
; 3 void f(void) {
; 4 g();
; 5 }
2014-03-26 16:45:02 +08:00
; X86-LABEL: _f:
2017-12-05 01:18:51 +08:00
; X86: # %bb.
2017-09-20 02:14:45 +08:00
; X86: .cv_file 1 "D:\\test.c" "F310AB26998CA831CBDF169E4EECACFA" 1
2016-01-29 08:49:42 +08:00
; X86: .cv_loc 0 1 4 2 is_stmt 0 # test.c:4:2
2014-11-04 16:03:31 +08:00
; X86: calll _g
2016-01-29 08:49:42 +08:00
; X86: .cv_loc 0 1 5 0 # test.c:5:0
2014-11-04 16:03:31 +08:00
; X86: ret
2016-02-11 04:55:49 +08:00
; X86: [[END_OF_F:Lfunc_end.*]]:
2014-01-30 09:39:17 +08:00
;
2015-02-07 16:26:40 +08:00
; X86-LABEL: .section .debug$S,"dr"
2016-05-26 07:16:12 +08:00
; X86-NEXT: .p2align 2
2014-01-30 09:39:17 +08:00
; X86-NEXT: .long 4
2014-10-24 09:27:45 +08:00
; Symbol subsection
; X86-NEXT: .long 241
2016-11-03 05:30:35 +08:00
; X86-NEXT: .long [[COMPILE_END:.*]]-[[COMPILE_START:.*]] #
2016-09-21 01:20:51 +08:00
; Compiler information record
2016-11-03 05:30:35 +08:00
; X86-NEXT: [[COMPILE_START]]:
2016-09-21 01:20:51 +08:00
; X86-NEXT: .short [[C1_END:.*]]-[[C1_START:.*]] #
; X86: [[C1_END]]:
2016-11-03 05:30:35 +08:00
; X86-NEXT: [[COMPILE_END]]:
; X86-NEXT: .p2align 2
[codeview] Implement FPO data assembler directives
Summary:
This adds a set of new directives that describe 32-bit x86 prologues.
The directives are limited and do not expose the full complexity of
codeview FPO data. They are merely a convenience for the compiler to
generate more readable assembly so we don't need to generate tons of
labels in CodeGen. If our prologue emission changes in the future, we
can change the set of available directives to suit our needs. These are
modelled after the .seh_ directives, which use a different format that
interacts with exception handling.
The directives are:
.cv_fpo_proc _foo
.cv_fpo_pushreg ebp/ebx/etc
.cv_fpo_setframe ebp/esi/etc
.cv_fpo_stackalloc 200
.cv_fpo_endprologue
.cv_fpo_endproc
.cv_fpo_data _foo
I tried to follow the implementation of ARM EHABI CFI directives by
sinking most directives out of MCStreamer and into X86TargetStreamer.
This helps avoid polluting non-X86 code with WinCOFF specific logic.
I used cdb to confirm that this can show locals in parent CSRs in a few
cases, most importantly the one where we use ESI as a frame pointer,
i.e. the one in http://crbug.com/756153#c28
Once we have cdb integration in debuginfo-tests, we can add integration
tests there.
Reviewers: majnemer, hans
Subscribers: aemerson, mgorny, kristof.beyls, llvm-commits, hiraditya
Differential Revision: https://reviews.llvm.org/D38776
llvm-svn: 315513
2017-10-12 05:24:33 +08:00
; X86-NEXT: .cv_fpo_data _f
2016-11-03 05:30:35 +08:00
; X86-NEXT: .long 241 # Symbol subsection for f
; X86-NEXT: .long [[F1_END:.*]]-[[F1_START:.*]] # Subsection size
; X86-NEXT: [[F1_START]]:
2016-02-03 07:18:23 +08:00
; X86-NEXT: .short [[PROC_SEGMENT_END:.*]]-[[PROC_SEGMENT_START:.*]] #
2014-10-24 09:27:45 +08:00
; X86-NEXT: [[PROC_SEGMENT_START]]:
; X86-NEXT: .short 4423
2016-02-03 07:18:23 +08:00
; X86-NEXT: .long 0
; X86-NEXT: .long 0
; X86-NEXT: .long 0
2014-10-24 09:27:45 +08:00
; X86-NEXT: .long [[END_OF_F]]-_f
2016-02-03 07:18:23 +08:00
; X86-NEXT: .long 0
; X86-NEXT: .long 0
2016-06-07 07:41:38 +08:00
; X86-NEXT: .long 4098
2014-10-24 09:27:45 +08:00
; X86-NEXT: .secrel32 _f
; X86-NEXT: .secidx _f
; X86-NEXT: .byte 0
2016-02-03 07:18:23 +08:00
; X86-NEXT: .asciz "f"
2014-10-24 09:27:45 +08:00
; X86-NEXT: [[PROC_SEGMENT_END]]:
; X86-NEXT: .short 2
; X86-NEXT: .short 4431
; X86-NEXT: [[F1_END]]:
2016-02-03 01:41:18 +08:00
; X86-NEXT: .p2align 2
2014-10-24 09:27:45 +08:00
; Line table
2016-01-29 08:49:42 +08:00
; X86-NEXT: .cv_linetable 0, _f, [[END_OF_F]]
2014-01-30 09:39:17 +08:00
; File index to string table offset subsection
2016-06-07 07:41:38 +08:00
; X86-NEXT: .cv_filechecksums
2014-01-30 09:39:17 +08:00
; String table
2016-06-07 07:41:38 +08:00
; X86-NEXT: .cv_stringtable
2014-01-30 09:39:17 +08:00
; OBJ32: Section {
; OBJ32: Name: .debug$S (2E 64 65 62 75 67 24 53)
2016-01-29 08:49:42 +08:00
; OBJ32: Characteristics [ (0x42300040)
2014-01-30 09:39:17 +08:00
; OBJ32: ]
; OBJ32: Relocations [
[codeview] Implement FPO data assembler directives
Summary:
This adds a set of new directives that describe 32-bit x86 prologues.
The directives are limited and do not expose the full complexity of
codeview FPO data. They are merely a convenience for the compiler to
generate more readable assembly so we don't need to generate tons of
labels in CodeGen. If our prologue emission changes in the future, we
can change the set of available directives to suit our needs. These are
modelled after the .seh_ directives, which use a different format that
interacts with exception handling.
The directives are:
.cv_fpo_proc _foo
.cv_fpo_pushreg ebp/ebx/etc
.cv_fpo_setframe ebp/esi/etc
.cv_fpo_stackalloc 200
.cv_fpo_endprologue
.cv_fpo_endproc
.cv_fpo_data _foo
I tried to follow the implementation of ARM EHABI CFI directives by
sinking most directives out of MCStreamer and into X86TargetStreamer.
This helps avoid polluting non-X86 code with WinCOFF specific logic.
I used cdb to confirm that this can show locals in parent CSRs in a few
cases, most importantly the one where we use ESI as a frame pointer,
i.e. the one in http://crbug.com/756153#c28
Once we have cdb integration in debuginfo-tests, we can add integration
tests there.
Reviewers: majnemer, hans
Subscribers: aemerson, mgorny, kristof.beyls, llvm-commits, hiraditya
Differential Revision: https://reviews.llvm.org/D38776
llvm-svn: 315513
2017-10-12 05:24:33 +08:00
; OBJ32-NEXT: 0x44 IMAGE_REL_I386_DIR32NB _f
; OBJ32-NEXT: 0x90 IMAGE_REL_I386_SECREL _f
; OBJ32-NEXT: 0x94 IMAGE_REL_I386_SECTION _f
; OBJ32-NEXT: 0xA8 IMAGE_REL_I386_SECREL _f
; OBJ32-NEXT: 0xAC IMAGE_REL_I386_SECTION _f
2014-10-24 09:27:45 +08:00
; OBJ32-NEXT: ]
; OBJ32: Subsection [
2016-01-14 03:32:35 +08:00
; OBJ32-NEXT: SubSectionType: Symbols (0xF1)
[codeview] Implement FPO data assembler directives
Summary:
This adds a set of new directives that describe 32-bit x86 prologues.
The directives are limited and do not expose the full complexity of
codeview FPO data. They are merely a convenience for the compiler to
generate more readable assembly so we don't need to generate tons of
labels in CodeGen. If our prologue emission changes in the future, we
can change the set of available directives to suit our needs. These are
modelled after the .seh_ directives, which use a different format that
interacts with exception handling.
The directives are:
.cv_fpo_proc _foo
.cv_fpo_pushreg ebp/ebx/etc
.cv_fpo_setframe ebp/esi/etc
.cv_fpo_stackalloc 200
.cv_fpo_endprologue
.cv_fpo_endproc
.cv_fpo_data _foo
I tried to follow the implementation of ARM EHABI CFI directives by
sinking most directives out of MCStreamer and into X86TargetStreamer.
This helps avoid polluting non-X86 code with WinCOFF specific logic.
I used cdb to confirm that this can show locals in parent CSRs in a few
cases, most importantly the one where we use ESI as a frame pointer,
i.e. the one in http://crbug.com/756153#c28
Once we have cdb integration in debuginfo-tests, we can add integration
tests there.
Reviewers: majnemer, hans
Subscribers: aemerson, mgorny, kristof.beyls, llvm-commits, hiraditya
Differential Revision: https://reviews.llvm.org/D38776
llvm-svn: 315513
2017-10-12 05:24:33 +08:00
; OBJ32: Compile3Sym
; OBJ32: ]
; OBJ32: Subsection [
; OBJ32-NEXT: SubSectionType: FrameData (0xF5)
; OBJ32: ]
; OBJ32: Subsection [
; OBJ32-NEXT: SubSectionType: Symbols (0xF1)
2017-07-12 07:41:41 +08:00
; OBJ32: {{.*}}Proc{{.*}}Sym {
2016-01-14 03:32:35 +08:00
; OBJ32: CodeSize: 0x6
; OBJ32: DisplayName: f
; OBJ32: LinkageName: _f
; OBJ32: }
2016-05-25 01:30:25 +08:00
; OBJ32-NEXT: ProcEnd {
2017-07-12 07:41:41 +08:00
; OBJ32: }
2014-01-30 09:39:17 +08:00
; OBJ32-NEXT: ]
2017-09-20 02:14:45 +08:00
; OBJ32: Subsection [
; OBJ32: SubSectionType: FileChecksums (0xF4)
; OBJ32-NEXT: SubSectionSize: 0x18
; OBJ32-NEXT: FileChecksum {
; OBJ32-NEXT: Filename: D:\test.c (0x1)
; OBJ32-NEXT: ChecksumSize: 0x10
; OBJ32-NEXT: ChecksumKind: MD5 (0x1)
; OBJ32-NEXT: ChecksumBytes: (F3 10 AB 26 99 8C A8 31 CB DF 16 9E 4E EC AC FA)
; OBJ32-NEXT: }
; OBJ32-NEXT: ]
2014-01-30 09:39:17 +08:00
; OBJ32: FunctionLineTable [
; OBJ32-NEXT: Name: _f
2015-07-09 08:19:51 +08:00
; OBJ32-NEXT: Flags: 0x1
2014-01-30 09:39:17 +08:00
; OBJ32-NEXT: CodeSize: 0x6
; OBJ32-NEXT: FilenameSegment [
; OBJ32-NEXT: Filename: D:\test.c
2016-01-13 09:05:16 +08:00
; OBJ32-NEXT: +0x0 [
; OBJ32-NEXT: LineNumberStart: 4
; OBJ32-NEXT: LineNumberEndDelta: 0
2016-01-30 00:39:04 +08:00
; OBJ32-NEXT: IsStatement: No
2016-01-29 08:49:42 +08:00
; OBJ32-NEXT: ColStart: 2
2016-01-13 09:05:16 +08:00
; OBJ32-NEXT: ColEnd: 0
; OBJ32-NEXT: ]
; OBJ32-NEXT: +0x5 [
; OBJ32-NEXT: LineNumberStart: 5
; OBJ32-NEXT: LineNumberEndDelta: 0
2016-01-30 00:39:04 +08:00
; OBJ32-NEXT: IsStatement: No
2016-01-13 09:05:16 +08:00
; OBJ32-NEXT: ColStart: 0
; OBJ32-NEXT: ColEnd: 0
; OBJ32-NEXT: ]
2014-01-30 09:39:17 +08:00
; OBJ32-NEXT: ]
; OBJ32-NEXT: ]
2014-03-26 16:45:02 +08:00
; X64-LABEL: f:
2015-03-05 10:05:42 +08:00
; X64-NEXT: .L{{.*}}:{{$}}
2017-09-20 02:14:45 +08:00
; X64: .cv_file 1 "D:\\test.c" "F310AB26998CA831CBDF169E4EECACFA" 1
2016-01-29 08:49:42 +08:00
; X64: .cv_loc 0 1 3 0 is_stmt 0 # test.c:3:0
2017-12-05 01:18:51 +08:00
; X64: # %bb.
2014-11-04 16:03:31 +08:00
; X64: subq $40, %rsp
2016-01-29 08:49:42 +08:00
; X64: .cv_loc 0 1 4 2 # test.c:4:2
2014-01-30 09:39:17 +08:00
; X64-NEXT: callq g
2016-01-29 08:49:42 +08:00
; X64: .cv_loc 0 1 5 0 # test.c:5:0
2014-11-04 16:03:31 +08:00
; X64: addq $40, %rsp
2014-01-30 09:39:17 +08:00
; X64-NEXT: ret
2016-02-11 04:55:49 +08:00
; X64: [[END_OF_F:.?Lfunc_end.*]]:
2014-01-30 09:39:17 +08:00
;
2015-02-07 16:26:40 +08:00
; X64-LABEL: .section .debug$S,"dr"
2016-05-26 07:16:12 +08:00
; X64-NEXT: .p2align 2
2014-01-30 09:39:17 +08:00
; X64-NEXT: .long 4
2014-10-24 09:27:45 +08:00
; Symbol subsection
; X64-NEXT: .long 241
2016-11-03 05:30:35 +08:00
; X64-NEXT: .long [[COMPILE_END:.*]]-[[COMPILE_START:.*]] #
2016-09-21 01:20:51 +08:00
; Compiler information record
2016-11-03 05:30:35 +08:00
; X64-NEXT: [[COMPILE_START]]:
2016-09-21 01:20:51 +08:00
; X64-NEXT: .short [[C1_END:.*]]-[[C1_START:.*]] #
; X64: [[C1_END]]:
2016-11-03 05:30:35 +08:00
; X64-NEXT: [[COMPILE_END]]:
; X64-NEXT: .p2align 2
; X64-NEXT: .long 241 # Symbol subsection for f
; X64-NEXT: .long [[F1_END:.*]]-[[F1_START:.*]] # Subsection size
; X64-NEXT: [[F1_START]]:
2016-02-03 07:18:23 +08:00
; X64-NEXT: .short [[PROC_SEGMENT_END:.*]]-[[PROC_SEGMENT_START:.*]] #
2014-10-24 09:27:45 +08:00
; X64-NEXT: [[PROC_SEGMENT_START]]:
; X64-NEXT: .short 4423
2016-02-03 07:18:23 +08:00
; X64-NEXT: .long 0
; X64-NEXT: .long 0
; X64-NEXT: .long 0
2014-10-24 09:27:45 +08:00
; X64-NEXT: .long [[END_OF_F]]-f
2016-02-03 07:18:23 +08:00
; X64-NEXT: .long 0
; X64-NEXT: .long 0
2016-06-07 07:41:38 +08:00
; X64-NEXT: .long 4098
2014-10-24 09:27:45 +08:00
; X64-NEXT: .secrel32 f
; X64-NEXT: .secidx f
; X64-NEXT: .byte 0
2016-02-03 07:18:23 +08:00
; X64-NEXT: .asciz "f"
2014-10-24 09:27:45 +08:00
; X64-NEXT: [[PROC_SEGMENT_END]]:
; X64-NEXT: .short 2
; X64-NEXT: .short 4431
; X64-NEXT: [[F1_END]]:
2016-02-03 01:41:18 +08:00
; X64-NEXT: .p2align 2
2014-10-24 09:27:45 +08:00
; Line table
2016-01-29 08:49:42 +08:00
; X64-NEXT: .cv_linetable 0, f, [[END_OF_F]]
2014-01-30 09:39:17 +08:00
; File index to string table offset subsection
2016-06-07 07:41:38 +08:00
; X64-NEXT: .cv_filechecksums
2014-01-30 09:39:17 +08:00
; String table
2016-06-07 07:41:38 +08:00
; X64-NEXT: .cv_stringtable
2014-01-30 09:39:17 +08:00
; OBJ64: Section {
; OBJ64: Name: .debug$S (2E 64 65 62 75 67 24 53)
2016-01-29 08:49:42 +08:00
; OBJ64: Characteristics [ (0x42300040)
2014-01-30 09:39:17 +08:00
; OBJ64: ]
; OBJ64: Relocations [
2016-11-03 05:30:35 +08:00
; OBJ64-NEXT: 0x64 IMAGE_REL_AMD64_SECREL f
; OBJ64-NEXT: 0x68 IMAGE_REL_AMD64_SECTION f
; OBJ64-NEXT: 0x7C IMAGE_REL_AMD64_SECREL f
; OBJ64-NEXT: 0x80 IMAGE_REL_AMD64_SECTION f
2014-10-24 09:27:45 +08:00
; OBJ64-NEXT: ]
; OBJ64: Subsection [
2016-01-14 03:32:35 +08:00
; OBJ64-NEXT: SubSectionType: Symbols (0xF1)
2017-07-12 07:41:41 +08:00
; OBJ64: {{.*}}Proc{{.*}}Sym {
2016-01-14 03:32:35 +08:00
; OBJ64: CodeSize: 0xE
; OBJ64: DisplayName: f
; OBJ64: LinkageName: f
; OBJ64: }
2016-05-25 01:30:25 +08:00
; OBJ64-NEXT: ProcEnd {
2017-07-12 07:41:41 +08:00
; OBJ64: }
2014-01-30 09:39:17 +08:00
; OBJ64-NEXT: ]
2017-09-20 02:14:45 +08:00
; OBJ64: Subsection [
; OBJ64: SubSectionType: FileChecksums (0xF4)
; OBJ64-NEXT: SubSectionSize: 0x18
; OBJ64-NEXT: FileChecksum {
; OBJ64-NEXT: Filename: D:\test.c (0x1)
; OBJ64-NEXT: ChecksumSize: 0x10
; OBJ64-NEXT: ChecksumKind: MD5 (0x1)
; OBJ64-NEXT: ChecksumBytes: (F3 10 AB 26 99 8C A8 31 CB DF 16 9E 4E EC AC FA)
; OBJ64-NEXT: }
; OBJ64-NEXT: ]
2014-01-30 09:39:17 +08:00
; OBJ64: FunctionLineTable [
; OBJ64-NEXT: Name: f
2015-07-09 08:19:51 +08:00
; OBJ64-NEXT: Flags: 0x1
2014-01-30 09:39:17 +08:00
; OBJ64-NEXT: CodeSize: 0xE
; OBJ64-NEXT: FilenameSegment [
; OBJ64-NEXT: Filename: D:\test.c
2016-01-13 09:05:16 +08:00
; OBJ64-NEXT: +0x0 [
; OBJ64-NEXT: LineNumberStart: 3
; OBJ64-NEXT: LineNumberEndDelta: 0
2016-01-30 00:39:04 +08:00
; OBJ64-NEXT: IsStatement: No
2016-01-13 09:05:16 +08:00
; OBJ64-NEXT: ColStart: 0
; OBJ64-NEXT: ColEnd: 0
; OBJ64-NEXT: ]
; OBJ64-NEXT: +0x4 [
; OBJ64-NEXT: LineNumberStart: 4
; OBJ64-NEXT: LineNumberEndDelta: 0
2016-01-30 00:39:04 +08:00
; OBJ64-NEXT: IsStatement: No
2016-01-29 08:49:42 +08:00
; OBJ64-NEXT: ColStart: 2
2016-01-13 09:05:16 +08:00
; OBJ64-NEXT: ColEnd: 0
; OBJ64-NEXT: ]
; OBJ64-NEXT: +0x9 [
; OBJ64-NEXT: LineNumberStart: 5
; OBJ64-NEXT: LineNumberEndDelta: 0
2016-01-30 00:39:04 +08:00
; OBJ64-NEXT: IsStatement: No
2016-01-13 09:05:16 +08:00
; OBJ64-NEXT: ColStart: 0
; OBJ64-NEXT: ColEnd: 0
; OBJ64-NEXT: ]
2014-01-30 09:39:17 +08:00
; OBJ64-NEXT: ]
; OBJ64-NEXT: ]
; Function Attrs: nounwind
2015-11-06 06:03:56 +08:00
define void @f ( ) #0 !dbg !4 {
2014-01-30 09:39:17 +08:00
entry:
call void @g ( ) , !dbg !12
ret void , !dbg !13
}
declare void @g ( ) #1
attributes #0 = { nounwind "less-precise-fpmad" = "false" "no-frame-pointer-elim" = "false" "no-infs-fp-math" = "false" "no-nans-fp-math" = "false" "no-realign-stack" "stack-protector-buffer-size" = "8" "unsafe-fp-math" = "false" "use-soft-float" = "false" }
attributes #1 = { "less-precise-fpmad" = "false" "no-frame-pointer-elim" = "false" "no-infs-fp-math" = "false" "no-nans-fp-math" = "false" "no-realign-stack" "stack-protector-buffer-size" = "8" "unsafe-fp-math" = "false" "use-soft-float" = "false" }
!llvm.dbg.cu = ! { !0 }
!llvm.module.flags = ! { !9 , !10 }
!llvm.ident = ! { !11 }
2016-04-15 23:57:41 +08:00
!0 = distinct !DICompileUnit ( language: D W _ L A N G _ C 99 , producer: "clang version 3.5 " , isOptimized: false , emissionKind: F u l l D e b u g , file: !1 , enums: !2 , retainedTypes: !2 , globals: !2 , imports: !2 )
2015-04-30 00:38:44 +08:00
!1 = !DIFile ( filename: "<unknown>" , directory: "D:\5C" )
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 = ! { }
[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
!4 = distinct !DISubprogram ( name: "f" , line: 3 , 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 , unit: !0 , scopeLine: 3 , file: !5 , scope: !6 , type: !7 , retainedNodes: !2 )
2017-09-20 02:14:45 +08:00
!5 = !DIFile ( filename: "test.c" , directory: "D:\5C" , checksumkind: C S K _ M D 5 , checksum: "f310ab26998ca831cbdf169e4eecacfa" )
!6 = !DIFile ( filename: "test.c" , directory: "D:C" , checksumkind: C S K _ M D 5 , checksum: "f310ab26998ca831cbdf169e4eecacfa" )
2015-04-30 00:38:44 +08:00
!7 = !DISubroutineType ( types: !8 )
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
!8 = ! { null }
2015-08-06 06:26:20 +08:00
!9 = ! { i32 2 , !"CodeView" , i32 1 }
2015-03-04 01:24:31 +08:00
!10 = ! { 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
!11 = ! { !"clang version 3.5 " }
2016-01-29 08:49:42 +08:00
!12 = !DILocation ( line: 4 , column: 2 , scope: !4 )
2015-04-30 00:38:44 +08:00
!13 = !DILocation ( line: 5 , scope: !4 )