Skip to content

Commit 8dd4b52

Browse files
Address more comments
1 parent 3415154 commit 8dd4b52

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

llvm/lib/MC/MCSFrame.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,7 @@ class SFrameEmitterImpl {
145145
case MCCFIInstruction::OpLLVMDefAspaceCfa:
146146
if (!setCFARegister(FRE, CFI))
147147
return false;
148-
setCFAOffset(FRE, CFI.getLoc(), CFI.getOffset());
149-
return true;
148+
return setCFAOffset(FRE, CFI.getLoc(), CFI.getOffset());
150149
case MCCFIInstruction::OpOffset:
151150
if (CFI.getRegister() == FPReg)
152151
FRE.FPOffset = CFI.getOffset();
@@ -250,9 +249,12 @@ class SFrameEmitterImpl {
250249
FDE.FREs.push_back(BaseFRE);
251250

252251
for (const auto &CFI : DF.Instructions) {
253-
// Instructions from InitialFrameState may not have a label, but if
254-
// these instructions don't, then they are in dead code or otherwise
255-
// unused.
252+
// Instructions from InitialFrameState may not have a label, but if these
253+
// instructions don't, then they are in dead code or otherwise unused.
254+
// TODO: This check follows MCDwarf.cpp
255+
// FrameEmitterImplementation::emitCFIInstructions, but nothing in the
256+
// testsuite triggers it. We should see if it can be removed in both
257+
// places, or alternately, add a test to exercise it.
256258
auto *L = CFI.getLabel();
257259
if (L && !L->isDefined())
258260
continue;

llvm/test/MC/ELF/cfi-sframe-errors.s

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,21 @@
88
f1:
99
.cfi_startproc simple
1010
// CHECK: Non-default RA register {{.*}}
11-
.cfi_return_column 0
11+
.cfi_return_column 0
1212
nop
1313
// CHECK: {{.*}} Adjusting CFA offset without a base register.{{.*}}
14-
.cfi_def_cfa_offset 16 // no line number reported here.
14+
.cfi_def_cfa_offset 16 // no line number reported here.
1515
nop
1616
// CHECK: [[@LINE+1]]:{{.*}} Adjusting CFA offset without a base register.{{.*}}
17-
.cfi_adjust_cfa_offset 16
17+
.cfi_adjust_cfa_offset 16
1818
nop
19-
.cfi_endproc
19+
.cfi_endproc
2020

2121
f2:
22-
.cfi_startproc
22+
.cfi_startproc
2323
nop
2424
// CHECK: Canonical Frame Address not in stack- or frame-pointer. {{.*}}
25-
.cfi_def_cfa 0, 4
25+
.cfi_def_cfa 0, 4
2626
nop
2727

2828
.cfi_endproc

0 commit comments

Comments
 (0)