[llvm] 6de8611 - [Alignment][NFC] Use Align in Hexagon emit(local)?CommonSymbolSorted
Guillaume Chatelet via llvm-commits
llvm-commits at lists.llvm.org
Mon Dec 12 06:39:51 PST 2022
Author: Guillaume Chatelet
Date: 2022-12-12T14:39:38Z
New Revision: 6de861125aee22ebd7ab39ea9732080d781e8814
URL: https://github.com/llvm/llvm-project/commit/6de861125aee22ebd7ab39ea9732080d781e8814
DIFF: https://github.com/llvm/llvm-project/commit/6de861125aee22ebd7ab39ea9732080d781e8814.diff
LOG: [Alignment][NFC] Use Align in Hexagon emit(local)?CommonSymbolSorted
Added:
Modified:
llvm/lib/Target/Hexagon/AsmParser/HexagonAsmParser.cpp
llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCELFStreamer.cpp
llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCELFStreamer.h
llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCTargetDesc.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/Hexagon/AsmParser/HexagonAsmParser.cpp b/llvm/lib/Target/Hexagon/AsmParser/HexagonAsmParser.cpp
index b55500e27bf8c..6aa322bdd3bb5 100644
--- a/llvm/lib/Target/Hexagon/AsmParser/HexagonAsmParser.cpp
+++ b/llvm/lib/Target/Hexagon/AsmParser/HexagonAsmParser.cpp
@@ -799,12 +799,12 @@ bool HexagonAsmParser::ParseDirectiveComm(bool IsLocal, SMLoc Loc) {
HexagonMCELFStreamer &HexagonELFStreamer =
static_cast<HexagonMCELFStreamer &>(getStreamer());
if (IsLocal) {
- HexagonELFStreamer.HexagonMCEmitLocalCommonSymbol(Sym, Size, ByteAlignment,
- AccessAlignment);
+ HexagonELFStreamer.HexagonMCEmitLocalCommonSymbol(
+ Sym, Size, Align(ByteAlignment), AccessAlignment);
return false;
}
- HexagonELFStreamer.HexagonMCEmitCommonSymbol(Sym, Size, ByteAlignment,
+ HexagonELFStreamer.HexagonMCEmitCommonSymbol(Sym, Size, Align(ByteAlignment),
AccessAlignment);
return false;
}
diff --git a/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCELFStreamer.cpp b/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCELFStreamer.cpp
index 13ff9327ec031..1aa664009fa63 100644
--- a/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCELFStreamer.cpp
+++ b/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCELFStreamer.cpp
@@ -87,7 +87,7 @@ void HexagonMCELFStreamer::EmitSymbol(const MCInst &Inst) {
// parameter.
void HexagonMCELFStreamer::HexagonMCEmitCommonSymbol(MCSymbol *Symbol,
uint64_t Size,
- unsigned ByteAlignment,
+ Align ByteAlignment,
unsigned AccessSize) {
getAssembler().registerSymbol(*Symbol);
StringRef sbss[4] = {".sbss.1", ".sbss.2", ".sbss.4", ".sbss.8"};
@@ -111,17 +111,17 @@ void HexagonMCELFStreamer::HexagonMCEmitCommonSymbol(MCSymbol *Symbol,
switchSection(&Section);
if (ELFSymbol->isUndefined()) {
- emitValueToAlignment(Align(ByteAlignment), 0, 1, 0);
+ emitValueToAlignment(ByteAlignment, 0, 1, 0);
emitLabel(Symbol);
emitZeros(Size);
}
// Update the maximum alignment of the section if necessary.
- Section.ensureMinAlignment(Align(ByteAlignment));
+ Section.ensureMinAlignment(ByteAlignment);
switchSection(P.first, P.second);
} else {
- if (ELFSymbol->declareCommon(Size, Align(ByteAlignment)))
+ if (ELFSymbol->declareCommon(Size, ByteAlignment))
report_fatal_error("Symbol: " + Symbol->getName() +
" redeclared as
diff erent type");
if ((AccessSize) && (Size <= GPSize)) {
@@ -137,9 +137,9 @@ void HexagonMCELFStreamer::HexagonMCEmitCommonSymbol(MCSymbol *Symbol,
}
void HexagonMCELFStreamer::HexagonMCEmitLocalCommonSymbol(MCSymbol *Symbol,
- uint64_t Size,
- unsigned ByteAlignment,
- unsigned AccessSize) {
+ uint64_t Size,
+ Align ByteAlignment,
+ unsigned AccessSize) {
getAssembler().registerSymbol(*Symbol);
auto ELFSymbol = cast<MCSymbolELF>(Symbol);
ELFSymbol->setBinding(ELF::STB_LOCAL);
@@ -147,7 +147,6 @@ void HexagonMCELFStreamer::HexagonMCEmitLocalCommonSymbol(MCSymbol *Symbol,
HexagonMCEmitCommonSymbol(Symbol, Size, ByteAlignment, AccessSize);
}
-
namespace llvm {
MCStreamer *createHexagonELFStreamer(Triple const &TT, MCContext &Context,
std::unique_ptr<MCAsmBackend> MAB,
diff --git a/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCELFStreamer.h b/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCELFStreamer.h
index edf4ce29f908c..ba25a0eb4c0a5 100644
--- a/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCELFStreamer.h
+++ b/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCELFStreamer.h
@@ -33,10 +33,9 @@ class HexagonMCELFStreamer : public MCELFStreamer {
void emitInstruction(const MCInst &Inst, const MCSubtargetInfo &STI) override;
void EmitSymbol(const MCInst &Inst);
void HexagonMCEmitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size,
- unsigned ByteAlignment,
- unsigned AccessSize);
+ Align ByteAlignment, unsigned AccessSize);
void HexagonMCEmitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
- unsigned ByteAlignment, unsigned AccessSize);
+ Align ByteAlignment, unsigned AccessSize);
};
MCStreamer *createHexagonELFStreamer(Triple const &TT, MCContext &Context,
diff --git a/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCTargetDesc.cpp b/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCTargetDesc.cpp
index f848757882319..60ea105b425b1 100644
--- a/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCTargetDesc.cpp
+++ b/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCTargetDesc.cpp
@@ -285,8 +285,8 @@ class HexagonTargetELFStreamer : public HexagonTargetStreamer {
unsigned AccessSize) override {
HexagonMCELFStreamer &HexagonELFStreamer =
static_cast<HexagonMCELFStreamer &>(getStreamer());
- HexagonELFStreamer.HexagonMCEmitCommonSymbol(Symbol, Size, ByteAlignment,
- AccessSize);
+ HexagonELFStreamer.HexagonMCEmitCommonSymbol(
+ Symbol, Size, Align(ByteAlignment), AccessSize);
}
void emitLocalCommonSymbolSorted(MCSymbol *Symbol, uint64_t Size,
@@ -295,7 +295,7 @@ class HexagonTargetELFStreamer : public HexagonTargetStreamer {
HexagonMCELFStreamer &HexagonELFStreamer =
static_cast<HexagonMCELFStreamer &>(getStreamer());
HexagonELFStreamer.HexagonMCEmitLocalCommonSymbol(
- Symbol, Size, ByteAlignment, AccessSize);
+ Symbol, Size, Align(ByteAlignment), AccessSize);
}
};
More information about the llvm-commits
mailing list