Skip to content

Commit 62f3d02

Browse files
author
Amirhossein Pashaeehir
committed
Change register naming format from %{reg} to register ${regName}
1 parent e9b7d78 commit 62f3d02

File tree

7 files changed

+26
-24
lines changed

7 files changed

+26
-24
lines changed

llvm/lib/DWARFCFIChecker/DWARFCFIAnalysis.cpp

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -206,16 +206,18 @@ void DWARFCFIAnalysis::checkRegDiff(
206206
if (PrevLoc.getLocation() == NextLoc.getLocation()) {
207207
Context->reportWarning(
208208
Inst.getLoc(),
209-
formatv("unknown change happened to %{0} unwinding rule values",
210-
RegName));
209+
formatv(
210+
"unknown change happened to register {0} unwinding rule values",
211+
RegName));
211212
//! FIXME: Check if the register is changed or not
212213
return;
213214
}
214215

215216
Context->reportWarning(
216217
Inst.getLoc(),
217-
formatv("unknown change happened to %{0} unwinding rule structure",
218-
RegName));
218+
formatv(
219+
"unknown change happened to register {0} unwinding rule structure",
220+
RegName));
219221
return;
220222
}
221223

@@ -228,7 +230,7 @@ void DWARFCFIAnalysis::checkRegDiff(
228230
if (Writes.count(MaybePrevRefReg.value())) {
229231
Context->reportError(
230232
Inst.getLoc(),
231-
formatv("changed %{1}, that %{0} unwinding rule "
233+
formatv("changed register {1}, that register {0}'s unwinding rule "
232234
"uses, but there is no CFI directives about it",
233235
RegName, MCRI->getName(*PrevRefLLVMReg)));
234236
return;
@@ -289,7 +291,7 @@ void DWARFCFIAnalysis::checkCFADiff(
289291
return;
290292
Context->reportError(
291293
Inst.getLoc(),
292-
formatv("modified CFA register (%{0}) but not changed CFA rule",
294+
formatv("modified CFA register ({0}) but not changed CFA rule",
293295
PrevCFARegName));
294296
}
295297

@@ -299,6 +301,6 @@ void DWARFCFIAnalysis::checkCFADiff(
299301

300302
Context->reportError(
301303
Inst.getLoc(),
302-
formatv("did not modify CFA register (%{0}) but changed CFA rule",
304+
formatv("did not modify CFA register ({0}) but changed CFA rule",
303305
PrevCFARegName));
304306
}

llvm/test/DWARFCFIChecker/X86/multiple-sections.s

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66
f:
77
.cfi_startproc
88
pushq %rax
9-
# CHECK: error: modified CFA register (%RSP) but not changed CFA rule
9+
# CHECK: error: modified CFA register (RSP) but not changed CFA rule
1010
pushq %rax
1111
.cfi_def_cfa %rbp, -24
1212
pushq %rax
1313
.cfi_endproc
1414

1515
.cfi_startproc
1616
pushq %rax
17-
# CHECK: error: modified CFA register (%RSP) but not changed CFA rule
17+
# CHECK: error: modified CFA register (RSP) but not changed CFA rule
1818
pushq %rax
1919
.cfi_def_cfa %rbp, -24
2020
pushq %rax

llvm/test/DWARFCFIChecker/X86/single-func-cfa-mistake.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ f:
99
.cfi_undefined %rax
1010

1111
pushq %rbp
12-
# CHECK: warning: unknown change happened to %RBP unwinding rule structure
12+
# CHECK: warning: unknown change happened to register RBP unwinding rule structure
1313
.cfi_def_cfa_offset 17
1414
.cfi_offset %rbp, -16
1515

llvm/test/DWARFCFIChecker/X86/single-func-missed-cfi-directive.s

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ f:
1212
.cfi_def_cfa_offset 16
1313

1414
movq %rsp, %rbp
15-
# CHECK: error: changed %RBP, that %RBP unwinding rule uses, but there is no CFI directives about it
15+
# CHECK: error: changed register RBP, that register RBP's unwinding rule uses, but there is no CFI directives about it
1616
.cfi_def_cfa_register %rbp
1717

1818
movl %edi, -4(%rbp)
@@ -22,7 +22,7 @@ f:
2222
addl $10, %eax
2323

2424
popq %rbp
25-
# CHECK: error: changed %RBP, that %RBP unwinding rule uses, but there is no CFI directives about it
25+
# CHECK: error: changed register RBP, that register RBP's unwinding rule uses, but there is no CFI directives about it
2626
.cfi_def_cfa %rsp, 8
2727

2828
retq

llvm/test/DWARFCFIChecker/X86/single-func.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ f:
88
.cfi_undefined %rax
99

1010
pushq %rbp
11-
# CHECK: warning: unknown change happened to %RBP unwinding rule structure
11+
# CHECK: warning: unknown change happened to register RBP unwinding rule structure
1212
.cfi_def_cfa_offset 16
1313
.cfi_offset %rbp, -16
1414

llvm/test/DWARFCFIChecker/X86/spill-two-reg-reversed.s

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,35 +11,35 @@ _start:
1111
.cfi_same_value %rsi
1212

1313
pushq %rbp
14-
# CHECK: warning: unknown change happened to %RBP unwinding rule structure
14+
# CHECK: warning: unknown change happened to register RBP unwinding rule structure
1515
.cfi_adjust_cfa_offset 8
1616
.cfi_offset %rbp, -16
1717

1818
movq %rsp, %rbp
1919

2020
pushq %rdi
21-
# CHECK: warning: unknown change happened to %RDI unwinding rule structure
21+
# CHECK: warning: unknown change happened to register RDI unwinding rule structure
2222
.cfi_adjust_cfa_offset 8
2323
.cfi_rel_offset %rdi, 0
2424

2525
pushq %rsi
26-
# CHECK: warning: unknown change happened to %RSI unwinding rule structure
26+
# CHECK: warning: unknown change happened to register RSI unwinding rule structure
2727
.cfi_adjust_cfa_offset 8
2828
.cfi_rel_offset %rsi, 0
2929

3030
popq %rsi
31-
# CHECK: warning: unknown change happened to %RDI unwinding rule structure
31+
# CHECK: warning: unknown change happened to register RDI unwinding rule structure
3232
.cfi_adjust_cfa_offset -8
3333
.cfi_same_value %rdi
3434

3535
popq %rdi
36-
# CHECK: error: changed %RDI, that %RDI unwinding rule uses, but there is no CFI directives about it
37-
# CHECK: warning: unknown change happened to %RSI unwinding rule structure
36+
# CHECK: error: changed register RDI, that register RDI's unwinding rule uses, but there is no CFI directives about it
37+
# CHECK: warning: unknown change happened to register RSI unwinding rule structure
3838
.cfi_adjust_cfa_offset -8
3939
.cfi_same_value %rsi
4040

4141
popq %rbp
42-
# CHECK: warning: unknown change happened to %RBP unwinding rule structure
42+
# CHECK: warning: unknown change happened to register RBP unwinding rule structure
4343
.cfi_adjust_cfa_offset -8
4444
.cfi_same_value %rbp
4545

llvm/test/DWARFCFIChecker/X86/update-with-no-cfi.s

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,16 @@ f:
1212
.cfi_same_value %rdx
1313

1414
movq $10, %rax
15-
# CHECK: error: changed %RAX, that %RAX unwinding rule uses, but there is no CFI directives about it
15+
# CHECK: error: changed register RAX, that register RAX's unwinding rule uses, but there is no CFI directives about it
1616

1717
movq $10, %rbx
18-
# CHECK: error: changed %RBX, that %RBX unwinding rule uses, but there is no CFI directives about it
18+
# CHECK: error: changed register RBX, that register RBX's unwinding rule uses, but there is no CFI directives about it
1919

2020
movq $10, %rcx
21-
# CHECK: error: changed %RCX, that %RCX unwinding rule uses, but there is no CFI directives about it
21+
# CHECK: error: changed register RCX, that register RCX's unwinding rule uses, but there is no CFI directives about it
2222

2323
movq $10, %rdx
24-
# CHECK: error: changed %RDX, that %RDX unwinding rule uses, but there is no CFI directives about it
24+
# CHECK: error: changed register RDX, that register RDX's unwinding rule uses, but there is no CFI directives about it
2525

2626
retq
2727

0 commit comments

Comments
 (0)