Skip to content

Commit adad119

Browse files
Sterling-Augustinemahesh-attarde
authored andcommitted
Revert "Support SFrame command-line and .cfi_section syntax (llvm#149935)" (llvm#150316)
This reverts commit f9d0bd0.
1 parent c133850 commit adad119

File tree

13 files changed

+19
-51
lines changed

13 files changed

+19
-51
lines changed

llvm/include/llvm/MC/MCObjectStreamer.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ class MCObjectStreamer : public MCStreamer {
4040
std::unique_ptr<MCAssembler> Assembler;
4141
bool EmitEHFrame;
4242
bool EmitDebugFrame;
43-
bool EmitSFrame;
4443

4544
struct PendingAssignment {
4645
MCSymbol *Symbol;
@@ -71,7 +70,7 @@ class MCObjectStreamer : public MCStreamer {
7170

7271
void emitFrames(MCAsmBackend *MAB);
7372
MCSymbol *emitCFILabel() override;
74-
void emitCFISections(bool EH, bool Debug, bool SFrame) override;
73+
void emitCFISections(bool EH, bool Debug) override;
7574

7675
public:
7776
void visitUsedSymbol(const MCSymbol &Sym) override;

llvm/include/llvm/MC/MCStreamer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -986,7 +986,7 @@ class LLVM_ABI MCStreamer {
986986
const MCSymbol *Lo);
987987

988988
virtual MCSymbol *getDwarfLineTableSymbol(unsigned CUID);
989-
virtual void emitCFISections(bool EH, bool Debug, bool SFrame);
989+
virtual void emitCFISections(bool EH, bool Debug);
990990
void emitCFIStartProc(bool IsSimple, SMLoc Loc = SMLoc());
991991
void emitCFIEndProc();
992992
virtual void emitCFIDefCfa(int64_t Register, int64_t Offset, SMLoc Loc = {});

llvm/include/llvm/MC/MCTargetOptions.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,6 @@ class MCTargetOptions {
102102
// functions on Darwins.
103103
bool EmitCompactUnwindNonCanonical : 1;
104104

105-
// Whether to emit SFrame unwind sections.
106-
bool EmitSFrameUnwind : 1;
107-
108105
// Whether or not to use full register names on PowerPC.
109106
bool PPCUseFullRegisterNames : 1;
110107

llvm/include/llvm/MC/MCTargetOptionsCommandFlags.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ LLVM_ABI EmitDwarfUnwindType getEmitDwarfUnwind();
4040

4141
LLVM_ABI bool getEmitCompactUnwindNonCanonical();
4242

43-
LLVM_ABI bool getEmitSFrameUnwind();
44-
4543
LLVM_ABI bool getShowMCInst();
4644

4745
LLVM_ABI bool getFatalWarnings();

llvm/lib/CodeGen/AsmPrinter/ARMException.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ void ARMException::beginFunction(const MachineFunction *MF) {
3939
if (CFISecType == AsmPrinter::CFISection::Debug) {
4040
if (!hasEmittedCFISections) {
4141
if (Asm->getModuleCFISectionType() == AsmPrinter::CFISection::Debug)
42-
Asm->OutStreamer->emitCFISections(false, true, false);
42+
Asm->OutStreamer->emitCFISections(false, true);
4343
hasEmittedCFISections = true;
4444
}
4545

llvm/lib/CodeGen/AsmPrinter/DwarfCFIException.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,9 @@ void DwarfCFIException::beginBasicBlockSection(const MachineBasicBlock &MBB) {
109109
// chose not to be verbose in that case. And with `ForceDwarfFrameSection`,
110110
// we should always emit .debug_frame.
111111
if (CFISecType == AsmPrinter::CFISection::Debug ||
112-
Asm->TM.Options.ForceDwarfFrameSection ||
113-
Asm->TM.Options.MCOptions.EmitSFrameUnwind)
112+
Asm->TM.Options.ForceDwarfFrameSection)
114113
Asm->OutStreamer->emitCFISections(
115-
CFISecType == AsmPrinter::CFISection::EH, true,
116-
Asm->TM.Options.MCOptions.EmitSFrameUnwind);
114+
CFISecType == AsmPrinter::CFISection::EH, true);
117115
hasEmittedCFISections = true;
118116
}
119117

llvm/lib/MC/MCAsmStreamer.cpp

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ class MCAsmStreamer final : public MCStreamer {
345345
void emitIdent(StringRef IdentString) override;
346346
void emitCFIBKeyFrame() override;
347347
void emitCFIMTETaggedFrame() override;
348-
void emitCFISections(bool EH, bool Debug, bool SFrame) override;
348+
void emitCFISections(bool EH, bool Debug) override;
349349
void emitCFIDefCfa(int64_t Register, int64_t Offset, SMLoc Loc) override;
350350
void emitCFIDefCfaOffset(int64_t Offset, SMLoc Loc) override;
351351
void emitCFIDefCfaRegister(int64_t Register, SMLoc Loc) override;
@@ -1906,24 +1906,15 @@ void MCAsmStreamer::emitIdent(StringRef IdentString) {
19061906
EmitEOL();
19071907
}
19081908

1909-
void MCAsmStreamer::emitCFISections(bool EH, bool Debug, bool SFrame) {
1910-
MCStreamer::emitCFISections(EH, Debug, SFrame);
1909+
void MCAsmStreamer::emitCFISections(bool EH, bool Debug) {
1910+
MCStreamer::emitCFISections(EH, Debug);
19111911
OS << "\t.cfi_sections ";
1912-
bool C = false;
19131912
if (EH) {
19141913
OS << ".eh_frame";
1915-
C = true;
1916-
}
1917-
if (Debug) {
1918-
if (C)
1919-
OS << ", ";
1914+
if (Debug)
1915+
OS << ", .debug_frame";
1916+
} else if (Debug) {
19201917
OS << ".debug_frame";
1921-
C = true;
1922-
}
1923-
if (SFrame) {
1924-
if (C)
1925-
OS << ", ";
1926-
OS << ".sframe";
19271918
}
19281919

19291920
EmitEOL();

llvm/lib/MC/MCObjectStreamer.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,11 +130,10 @@ void MCObjectStreamer::visitUsedSymbol(const MCSymbol &Sym) {
130130
Assembler->registerSymbol(Sym);
131131
}
132132

133-
void MCObjectStreamer::emitCFISections(bool EH, bool Debug, bool SFrame) {
134-
MCStreamer::emitCFISections(EH, Debug, SFrame);
133+
void MCObjectStreamer::emitCFISections(bool EH, bool Debug) {
134+
MCStreamer::emitCFISections(EH, Debug);
135135
EmitEHFrame = EH;
136136
EmitDebugFrame = Debug;
137-
EmitSFrame = SFrame;
138137
}
139138

140139
void MCObjectStreamer::emitValueImpl(const MCExpr *Value, unsigned Size,

llvm/lib/MC/MCParser/AsmParser.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4093,30 +4093,27 @@ bool AsmParser::parseDirectiveCVFPOData() {
40934093
}
40944094

40954095
/// parseDirectiveCFISections
4096-
/// ::= .cfi_sections section [, section][, section]
4096+
/// ::= .cfi_sections section [, section]
40974097
bool AsmParser::parseDirectiveCFISections() {
40984098
StringRef Name;
40994099
bool EH = false;
41004100
bool Debug = false;
4101-
bool SFrame = false;
41024101

41034102
if (!parseOptionalToken(AsmToken::EndOfStatement)) {
41044103
for (;;) {
41054104
if (parseIdentifier(Name))
4106-
return TokError("expected .eh_frame, .debug_frame, or .sframe");
4105+
return TokError("expected .eh_frame or .debug_frame");
41074106
if (Name == ".eh_frame")
41084107
EH = true;
41094108
else if (Name == ".debug_frame")
41104109
Debug = true;
4111-
else if (Name == ".sframe")
4112-
SFrame = true;
41134110
if (parseOptionalToken(AsmToken::EndOfStatement))
41144111
break;
41154112
if (parseComma())
41164113
return true;
41174114
}
41184115
}
4119-
getStreamer().emitCFISections(EH, Debug, SFrame);
4116+
getStreamer().emitCFISections(EH, Debug);
41204117
return false;
41214118
}
41224119

llvm/lib/MC/MCStreamer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ void MCStreamer::emitLabel(MCSymbol *Symbol, SMLoc Loc) {
415415
void MCStreamer::emitConditionalAssignment(MCSymbol *Symbol,
416416
const MCExpr *Value) {}
417417

418-
void MCStreamer::emitCFISections(bool EH, bool Debug, bool SFrame) {}
418+
void MCStreamer::emitCFISections(bool EH, bool Debug) {}
419419

420420
void MCStreamer::emitCFIStartProc(bool IsSimple, SMLoc Loc) {
421421
if (!FrameInfoStack.empty() &&

0 commit comments

Comments
 (0)