[llvm] c0c24d8 - [MC] Replace getCurrentSection().first with getCurrentSectionOnly. NFC
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 28 09:50:42 PDT 2024
Author: Fangrui Song
Date: 2024-06-28T09:50:38-07:00
New Revision: c0c24d8322283be7403addf18b92449eda29fb36
URL: https://github.com/llvm/llvm-project/commit/c0c24d8322283be7403addf18b92449eda29fb36
DIFF: https://github.com/llvm/llvm-project/commit/c0c24d8322283be7403addf18b92449eda29fb36.diff
LOG: [MC] Replace getCurrentSection().first with getCurrentSectionOnly. NFC
Added:
Modified:
llvm/lib/MC/MCParser/ELFAsmParser.cpp
llvm/lib/MC/MCParser/WasmAsmParser.cpp
llvm/lib/Target/WebAssembly/AsmParser/WebAssemblyAsmParser.cpp
Removed:
################################################################################
diff --git a/llvm/lib/MC/MCParser/ELFAsmParser.cpp b/llvm/lib/MC/MCParser/ELFAsmParser.cpp
index bb48ee78248e5..e8a22d3defd6e 100644
--- a/llvm/lib/MC/MCParser/ELFAsmParser.cpp
+++ b/llvm/lib/MC/MCParser/ELFAsmParser.cpp
@@ -682,9 +682,8 @@ bool ELFAsmParser::ParseSectionArguments(bool IsPush, SMLoc loc) {
}
if (UseLastGroup) {
- MCSectionSubPair CurrentSection = getStreamer().getCurrentSection();
if (const MCSectionELF *Section =
- cast_or_null<MCSectionELF>(CurrentSection.first))
+ cast_or_null<MCSectionELF>(getStreamer().getCurrentSectionOnly()))
if (const MCSymbol *Group = Section->getGroup()) {
GroupName = Group->getName();
IsComdat = Section->isComdat();
diff --git a/llvm/lib/MC/MCParser/WasmAsmParser.cpp b/llvm/lib/MC/MCParser/WasmAsmParser.cpp
index b95ee33debc37..d8ab30f296c3c 100644
--- a/llvm/lib/MC/MCParser/WasmAsmParser.cpp
+++ b/llvm/lib/MC/MCParser/WasmAsmParser.cpp
@@ -252,7 +252,7 @@ class WasmAsmParser : public MCAsmParserExtension {
if (TypeName == "function") {
WasmSym->setType(wasm::WASM_SYMBOL_TYPE_FUNCTION);
auto *Current =
- cast<MCSectionWasm>(getStreamer().getCurrentSection().first);
+ cast<MCSectionWasm>(getStreamer().getCurrentSectionOnly());
if (Current->getGroup())
WasmSym->setComdat(true);
} else if (TypeName == "global")
diff --git a/llvm/lib/Target/WebAssembly/AsmParser/WebAssemblyAsmParser.cpp b/llvm/lib/Target/WebAssembly/AsmParser/WebAssemblyAsmParser.cpp
index 3cc2cc0e830f1..67fa789af4a77 100644
--- a/llvm/lib/Target/WebAssembly/AsmParser/WebAssemblyAsmParser.cpp
+++ b/llvm/lib/Target/WebAssembly/AsmParser/WebAssemblyAsmParser.cpp
@@ -756,7 +756,7 @@ class WebAssemblyAsmParser final : public MCTargetAsmParser {
bool CheckDataSection() {
if (CurrentState != DataSection) {
- auto WS = cast<MCSectionWasm>(getStreamer().getCurrentSection().first);
+ auto WS = cast<MCSectionWasm>(getStreamer().getCurrentSectionOnly());
if (WS && WS->isText())
return error("data directive must occur in a data segment: ",
Lexer.getTok());
@@ -1073,8 +1073,8 @@ class WebAssemblyAsmParser final : public MCTargetAsmParser {
void doBeforeLabelEmit(MCSymbol *Symbol, SMLoc IDLoc) override {
// Code below only applies to labels in text sections.
- auto CWS = cast<MCSectionWasm>(getStreamer().getCurrentSection().first);
- if (!CWS || !CWS->isText())
+ auto CWS = cast<MCSectionWasm>(getStreamer().getCurrentSectionOnly());
+ if (!CWS->isText())
return;
auto WasmSym = cast<MCSymbolWasm>(Symbol);
More information about the llvm-commits
mailing list