Skip to content

Commit c0c24d8

Browse files
committed
[MC] Replace getCurrentSection().first with getCurrentSectionOnly. NFC
1 parent ecd6742 commit c0c24d8

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

llvm/lib/MC/MCParser/ELFAsmParser.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -682,9 +682,8 @@ bool ELFAsmParser::ParseSectionArguments(bool IsPush, SMLoc loc) {
682682
}
683683

684684
if (UseLastGroup) {
685-
MCSectionSubPair CurrentSection = getStreamer().getCurrentSection();
686685
if (const MCSectionELF *Section =
687-
cast_or_null<MCSectionELF>(CurrentSection.first))
686+
cast_or_null<MCSectionELF>(getStreamer().getCurrentSectionOnly()))
688687
if (const MCSymbol *Group = Section->getGroup()) {
689688
GroupName = Group->getName();
690689
IsComdat = Section->isComdat();

llvm/lib/MC/MCParser/WasmAsmParser.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ class WasmAsmParser : public MCAsmParserExtension {
252252
if (TypeName == "function") {
253253
WasmSym->setType(wasm::WASM_SYMBOL_TYPE_FUNCTION);
254254
auto *Current =
255-
cast<MCSectionWasm>(getStreamer().getCurrentSection().first);
255+
cast<MCSectionWasm>(getStreamer().getCurrentSectionOnly());
256256
if (Current->getGroup())
257257
WasmSym->setComdat(true);
258258
} else if (TypeName == "global")

llvm/lib/Target/WebAssembly/AsmParser/WebAssemblyAsmParser.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -756,7 +756,7 @@ class WebAssemblyAsmParser final : public MCTargetAsmParser {
756756

757757
bool CheckDataSection() {
758758
if (CurrentState != DataSection) {
759-
auto WS = cast<MCSectionWasm>(getStreamer().getCurrentSection().first);
759+
auto WS = cast<MCSectionWasm>(getStreamer().getCurrentSectionOnly());
760760
if (WS && WS->isText())
761761
return error("data directive must occur in a data segment: ",
762762
Lexer.getTok());
@@ -1073,8 +1073,8 @@ class WebAssemblyAsmParser final : public MCTargetAsmParser {
10731073

10741074
void doBeforeLabelEmit(MCSymbol *Symbol, SMLoc IDLoc) override {
10751075
// Code below only applies to labels in text sections.
1076-
auto CWS = cast<MCSectionWasm>(getStreamer().getCurrentSection().first);
1077-
if (!CWS || !CWS->isText())
1076+
auto CWS = cast<MCSectionWasm>(getStreamer().getCurrentSectionOnly());
1077+
if (!CWS->isText())
10781078
return;
10791079

10801080
auto WasmSym = cast<MCSymbolWasm>(Symbol);

0 commit comments

Comments
 (0)