Skip to content

Commit 2537967

Browse files
Address style comments
1 parent 08df48e commit 2537967

File tree

3 files changed

+56
-57
lines changed

3 files changed

+56
-57
lines changed

llvm/lib/MC/MCSFrame.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,8 +231,8 @@ class SFrameEmitterImpl {
231231
// FDE or CIE. We don't have one here. Alignments are used for scaling
232232
// factors for ops like CFA_def_cfa_offset_sf. But this particular function
233233
// is only interested in registers.
234-
dwarf::CFIProgram P(/* CodeAlignmentFactor */ 1,
235-
/* DataAlignmentFactor*/ 1,
234+
dwarf::CFIProgram P(/*CodeAlignmentFactor=*/1,
235+
/*DataAlignmentFactor=*/1,
236236
Streamer.getContext().getTargetTriple().getArch());
237237
uint64_t Offset = 0;
238238
if (P.parse(data, &Offset, CFI.getValues().size())) {
Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,36 @@
11
# RUN: llvm-mc --filetype=obj --gsframe -triple x86_64 %s -o %t.o 2>&1 | FileCheck %s
22
# RUN: llvm-readelf --sframe %t.o | FileCheck %s --check-prefix=NOFDES
33

4-
# Tests that .cfi_escape sequences that are unrepresentable in sframe warn
5-
# and do not produce FDEs.
4+
## Tests that .cfi_escape sequences that are unrepresentable in sframe warn
5+
## and do not produce FDEs.
66

77
.align 1024
88
cfi_escape_sp:
99
.cfi_startproc
1010
.long 0
11-
# Setting SP via other registers makes it unrepresentable in sframe
12-
# DW_CFA_expression,reg 0x7,length 2,DW_OP_breg6,SLEB(-8)
13-
# CHECK: skipping SFrame FDE; .cfi_escape DW_CFA_expression with SP reg 7
14-
.cfi_escape 0x10, 0x7, 0x2, 0x76, 0x78
11+
## Setting SP via other registers makes it unrepresentable in sframe
12+
## DW_CFA_expression,reg 0x7,length 2,DW_OP_breg6,SLEB(-8)
13+
# CHECK: {{.*}}.s:[[#@LINE+1]]:9: warning: skipping SFrame FDE; .cfi_escape DW_CFA_expression with SP reg 7
14+
.cfi_escape 0x10, 0x7, 0x2, 0x76, 0x78
1515
.long 0
1616
.cfi_endproc
1717

1818
cfi_escape_args_sp:
19-
.cfi_startproc
20-
.long 0
21-
# DW_CFA_GNU_args_size is not OK if cfa is SP
22-
# CHECK: skipping SFrame FDE; .cfi_escape DW_CFA_GNU_args_size with non frame-pointer CFA
23-
.cfi_escape 0x2e, 0x20
24-
.cfi_endproc
19+
.cfi_startproc
20+
.long 0
21+
## DW_CFA_GNU_args_size is not OK if cfa is SP
22+
# CHECK: {{.*}}.s:[[#@LINE+1]]:9: warning: skipping SFrame FDE; .cfi_escape DW_CFA_GNU_args_size with non frame-pointer CFA
23+
.cfi_escape 0x2e, 0x20
24+
.cfi_endproc
2525

2626
cfi_escape_val_offset:
27-
.cfi_startproc
28-
.long 0
29-
.cfi_def_cfa_offset 16
30-
# DW_CFA_val_offset,rbp,ULEB scaled offset(16)
31-
# CHECK: skipping SFrame FDE; .cfi_escape DW_CFA_val_offset with FP reg 6
32-
.cfi_escape 0x14,0x6,0x2
33-
.long 0
34-
.cfi_endproc
35-
27+
.cfi_startproc
28+
.long 0
29+
.cfi_def_cfa_offset 16
30+
## DW_CFA_val_offset,rbp,ULEB scaled offset(16)
31+
# CHECK: {{.*}}.s:[[#@LINE+1]]:9: warning: skipping SFrame FDE; .cfi_escape DW_CFA_val_offset with FP reg 6
32+
.cfi_escape 0x14,0x6,0x2
33+
.long 0
34+
.cfi_endproc
3635

3736
# NOFDES: Num FDEs: 0
Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,46 @@
11
# RUN: llvm-mc --filetype=obj --gsframe -triple x86_64 %s -o %t.o
22
# RUN: llvm-readelf --sframe %t.o | FileCheck %s
33

4-
# Tests that .cfi_escape sequences that are ok to pass through work.
4+
## Tests that .cfi_escape sequences that are ok to pass through work.
55

66
.align 1024
77
cfi_escape_ok:
8-
.cfi_startproc
9-
.long 0
10-
.cfi_def_cfa_offset 16
11-
# Uninteresting register
12-
# DW_CFA_expression,reg 0xc,length 2,DW_OP_breg6,SLEB(-8)
13-
.cfi_escape 0x10,0xc,0x2,0x76,0x78
14-
# DW_CFA_nop
15-
.cfi_escape 0x0
16-
.cfi_escape 0x0,0x0,0x0,0x0
17-
# Uninteresting register
18-
# DW_CFA_val_offset,reg 0xc,ULEB scaled offset
19-
.cfi_escape 0x14,0xc,0x4
20-
.long 0
21-
.cfi_endproc
8+
.cfi_startproc
9+
.long 0
10+
.cfi_def_cfa_offset 16
11+
## Uninteresting register
12+
## DW_CFA_expression,reg 0xc,length 2,DW_OP_breg6,SLEB(-8)
13+
.cfi_escape 0x10,0xc,0x2,0x76,0x78
14+
## DW_CFA_nop
15+
.cfi_escape 0x0
16+
.cfi_escape 0x0,0x0,0x0,0x0
17+
## Uninteresting register
18+
## DW_CFA_val_offset,reg 0xc,ULEB scaled offset
19+
.cfi_escape 0x14,0xc,0x4
20+
.long 0
21+
.cfi_endproc
2222

2323
cfi_escape_gnu_args_fp:
24-
.cfi_startproc
25-
.long 0
26-
# DW_CFA_GNU_args_size is OK if arg size is zero
27-
.cfi_escape 0x2e, 0x0
28-
.long 0
29-
.cfi_def_cfa_register 6
30-
.long 0
31-
# DW_CFA_GNU_args_size is OK if cfa is FP
32-
.cfi_escape 0x2e, 0x20
33-
.cfi_endproc
24+
.cfi_startproc
25+
.long 0
26+
## DW_CFA_GNU_args_size is OK if arg size is zero
27+
.cfi_escape 0x2e, 0x0
28+
.long 0
29+
.cfi_def_cfa_register 6
30+
.long 0
31+
## DW_CFA_GNU_args_size is OK if cfa is FP
32+
.cfi_escape 0x2e, 0x20
33+
.cfi_endproc
3434

3535
cfi_escape_long_expr:
36-
.cfi_startproc
37-
.long 0
38-
.cfi_def_cfa_offset 16
39-
# This is a long, but valid, dwarf expression without sframe
40-
# implications. An FDE can still be created.
41-
# DW_CFA_val_offset,rcx,ULEB scaled offset(16), DW_CFA_expr,r10,length,DW_OP_deref,SLEB(-8)
42-
.cfi_escape 0x14,0x2,0x2,0x10,0xa,0x2,0x76,0x78
43-
.long 0
44-
.cfi_endproc
36+
.cfi_startproc
37+
.long 0
38+
.cfi_def_cfa_offset 16
39+
## This is a long, but valid, dwarf expression without sframe
40+
## implications. An FDE can still be created.
41+
## DW_CFA_val_offset,rcx,ULEB scaled offset(16), DW_CFA_expr,r10,length,DW_OP_deref,SLEB(-8)
42+
.cfi_escape 0x14,0x2,0x2,0x10,0xa,0x2,0x76,0x78
43+
.long 0
44+
.cfi_endproc
4545

4646
# CHECK: Num FDEs: 3

0 commit comments

Comments
 (0)