forked from llvm-mirror/llvm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MIR Serialization: Serialize MMI's variable debug information.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245396 91177308-0d34-0410-b5e6-96231b3b80d8
- Loading branch information
Showing
8 changed files
with
263 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
test/CodeGen/MIR/X86/expected-metadata-node-in-stack-object.mir
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# RUN: not llc -march=x86-64 -start-after branch-folder -stop-after branch-folder -o /dev/null %s 2>&1 | FileCheck %s | ||
--- | | ||
define i32 @test(i32 %x) { | ||
entry: | ||
%xa = alloca i32, align 4 | ||
store i32 %x, i32* %xa, align 4 | ||
%0 = load i32, i32* %xa, align 4 | ||
ret i32 %0 | ||
} | ||
... | ||
--- | ||
name: test | ||
liveins: | ||
- { reg: '%edi' } | ||
stack: | ||
# CHECK: [[@LINE+1]]:74: expected a metadata node | ||
- { id: 0, name: xa, offset: -12, size: 4, alignment: 4, di-variable: '0' } | ||
body: | | ||
bb.0.entry: | ||
liveins: %edi | ||
MOV32mr %rsp, 1, _, -4, _, %edi :: (store 4 into %ir.xa) | ||
%eax = COPY killed %edi | ||
RETQ killed %eax | ||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# RUN: not llc -march=x86-64 -start-after machine-sink -stop-after machine-sink -o /dev/null %s 2>&1 | FileCheck %s | ||
--- | | ||
declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 | ||
|
||
define void @foo() #1 { | ||
entry: | ||
%x.i = alloca i8, align 1 | ||
%y.i = alloca [256 x i8], align 16 | ||
%0 = bitcast [256 x i8]* %y.i to i8* | ||
br label %for.body | ||
|
||
for.body: | ||
%1 = bitcast [256 x i8]* %y.i to i8* | ||
call void @llvm.dbg.declare(metadata i8* %0, metadata !4, metadata !7) #3, !dbg !8 | ||
br label %for.body | ||
} | ||
|
||
attributes #0 = { nounwind readnone } | ||
attributes #1 = { nounwind ssp uwtable } | ||
attributes #3 = { nounwind } | ||
|
||
!llvm.dbg.cu = !{!0} | ||
!llvm.module.flags = !{!3} | ||
|
||
!0 = distinct !DICompileUnit(language: DW_LANG_C89, file: !1, producer: "clang", isOptimized: true, runtimeVersion: 0, emissionKind: 0, enums: !2, retainedTypes: !2) | ||
!1 = !DIFile(filename: "t.c", directory: "") | ||
!2 = !{} | ||
!3 = !{i32 1, !"Debug Info Version", i32 3} | ||
!4 = !DILocalVariable(name: "x", scope: !5, file: !1, line: 16, type: !6) | ||
!5 = !DISubprogram(scope: null, isLocal: false, isDefinition: true, isOptimized: false) | ||
!6 = !DIBasicType(name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char) | ||
!7 = !DIExpression() | ||
!8 = !DILocation(line: 0, scope: !5) | ||
... | ||
--- | ||
name: foo | ||
isSSA: true | ||
tracksRegLiveness: true | ||
frameInfo: | ||
maxAlignment: 16 | ||
stack: | ||
# CHECK: [[@LINE+1]]:75: expected a reference to a 'DILocalVariable' metadata node | ||
- { id: 0, name: y.i, offset: 0, size: 256, alignment: 16, di-variable: '!8', | ||
di-expression: '!7', di-location: '!8' } | ||
body: | | ||
bb.0.entry: | ||
successors: %bb.1.for.body | ||
bb.1.for.body: | ||
successors: %bb.1.for.body | ||
DBG_VALUE %stack.0.y.i, 0, !4, !7, debug-location !8 | ||
JMP_1 %bb.1.for.body | ||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
# RUN: llc -march=x86-64 -start-after machine-sink -stop-after machine-sink -o /dev/null %s | FileCheck %s | ||
# This test ensures that the MIR parser parses the stack object's debug info | ||
# correctly. | ||
--- | | ||
declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 | ||
|
||
define void @foo() #1 { | ||
entry: | ||
%x.i = alloca i8, align 1 | ||
%y.i = alloca [256 x i8], align 16 | ||
%0 = bitcast [256 x i8]* %y.i to i8* | ||
br label %for.body | ||
|
||
for.body: | ||
%1 = bitcast [256 x i8]* %y.i to i8* | ||
call void @llvm.lifetime.end(i64 -1, i8* %1) #3 | ||
call void @llvm.lifetime.start(i64 -1, i8* %0) #3 | ||
call void @llvm.dbg.declare(metadata i8* %0, metadata !4, metadata !7) #3, !dbg !8 | ||
br label %for.body | ||
} | ||
|
||
declare void @llvm.lifetime.start(i64, i8* nocapture) #2 | ||
|
||
declare void @llvm.lifetime.end(i64, i8* nocapture) #2 | ||
|
||
attributes #0 = { nounwind readnone } | ||
attributes #1 = { nounwind ssp uwtable } | ||
attributes #2 = { nounwind argmemonly } | ||
attributes #3 = { nounwind } | ||
|
||
!llvm.dbg.cu = !{!0} | ||
!llvm.module.flags = !{!3} | ||
|
||
!0 = distinct !DICompileUnit(language: DW_LANG_C89, file: !1, producer: "clang", isOptimized: true, runtimeVersion: 0, emissionKind: 0, enums: !2, retainedTypes: !2) | ||
!1 = !DIFile(filename: "t.c", directory: "") | ||
!2 = !{} | ||
!3 = !{i32 1, !"Debug Info Version", i32 3} | ||
!4 = !DILocalVariable(name: "x", scope: !5, file: !1, line: 16, type: !6) | ||
!5 = !DISubprogram(scope: null, isLocal: false, isDefinition: true, isOptimized: false) | ||
!6 = !DIBasicType(name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char) | ||
!7 = !DIExpression() | ||
!8 = !DILocation(line: 0, scope: !5) | ||
... | ||
--- | ||
name: foo | ||
isSSA: true | ||
tracksRegLiveness: true | ||
frameInfo: | ||
maxAlignment: 16 | ||
# CHECK-LABEL: foo | ||
# CHECK: stack: | ||
# CHECK: - { id: 0, name: y.i, offset: 0, size: 256, alignment: 16, di-variable: '!4', | ||
# CHECK-NEXT: di-expression: '!7', di-location: '!8' } | ||
stack: | ||
- { id: 0, name: y.i, offset: 0, size: 256, alignment: 16, di-variable: '!4', | ||
di-expression: '!7', di-location: '!8' } | ||
body: | | ||
bb.0.entry: | ||
successors: %bb.1.for.body | ||
bb.1.for.body: | ||
successors: %bb.1.for.body | ||
DBG_VALUE %stack.0.y.i, 0, !4, !7, debug-location !8 | ||
JMP_1 %bb.1.for.body | ||
... |