[llvm] b822063 - Revert D139439 "[Alignment] Use Align in MCStreamer emitZeroFill/emitLocalCommonSymbol"
Guillaume Chatelet via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 7 06:51:38 PST 2022
Author: Guillaume Chatelet
Date: 2022-12-07T14:51:26Z
New Revision: b822063669641570ab5edae72956d18a5bcde8c4
URL: https://github.com/llvm/llvm-project/commit/b822063669641570ab5edae72956d18a5bcde8c4
DIFF: https://github.com/llvm/llvm-project/commit/b822063669641570ab5edae72956d18a5bcde8c4.diff
LOG: Revert D139439 "[Alignment] Use Align in MCStreamer emitZeroFill/emitLocalCommonSymbol"
This breaks Windows bots with
`warning C4334: '<<': result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?)`
Some shift operators are lacking a proper literal unit ('1ULL' instead of
'1'). Will reland once fixed.
This reverts commit c621c1a8e81856e6bf2be79714767d80466e9ede.
Added:
Modified:
llvm/include/llvm/MC/MCDXContainerStreamer.h
llvm/include/llvm/MC/MCELFStreamer.h
llvm/include/llvm/MC/MCSPIRVStreamer.h
llvm/include/llvm/MC/MCStreamer.h
llvm/include/llvm/MC/MCWasmStreamer.h
llvm/include/llvm/MC/MCWinCOFFStreamer.h
llvm/include/llvm/MC/MCXCOFFStreamer.h
llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
llvm/lib/MC/MCAsmStreamer.cpp
llvm/lib/MC/MCELFStreamer.cpp
llvm/lib/MC/MCMachOStreamer.cpp
llvm/lib/MC/MCNullStreamer.cpp
llvm/lib/MC/MCParser/AsmParser.cpp
llvm/lib/MC/MCParser/DarwinAsmParser.cpp
llvm/lib/MC/MCParser/MasmParser.cpp
llvm/lib/MC/MCStreamer.cpp
llvm/lib/MC/MCWasmStreamer.cpp
llvm/lib/MC/MCWinCOFFStreamer.cpp
llvm/lib/MC/MCXCOFFStreamer.cpp
llvm/lib/Object/RecordStreamer.cpp
llvm/lib/Object/RecordStreamer.h
llvm/tools/llvm-exegesis/lib/SnippetFile.cpp
llvm/tools/llvm-mca/CodeRegionGenerator.cpp
llvm/unittests/CodeGen/TestAsmPrinter.h
Removed:
################################################################################
diff --git a/llvm/include/llvm/MC/MCDXContainerStreamer.h b/llvm/include/llvm/MC/MCDXContainerStreamer.h
index 60a5a28dec99..ac2fbc6cdff3 100644
--- a/llvm/include/llvm/MC/MCDXContainerStreamer.h
+++ b/llvm/include/llvm/MC/MCDXContainerStreamer.h
@@ -36,8 +36,7 @@ class MCDXContainerStreamer : public MCObjectStreamer {
bool emitSymbolAttribute(MCSymbol *, MCSymbolAttr) override { return false; }
void emitCommonSymbol(MCSymbol *, uint64_t, unsigned) override {}
void emitZerofill(MCSection *, MCSymbol *Symbol = nullptr, uint64_t Size = 0,
- Align ByteAlignment = Align(1),
- SMLoc Loc = SMLoc()) override {}
+ unsigned ByteAlignment = 0, SMLoc Loc = SMLoc()) override {}
private:
void emitInstToData(const MCInst &, const MCSubtargetInfo &) override;
diff --git a/llvm/include/llvm/MC/MCELFStreamer.h b/llvm/include/llvm/MC/MCELFStreamer.h
index f097c3d2e20a..7f1f0e689a17 100644
--- a/llvm/include/llvm/MC/MCELFStreamer.h
+++ b/llvm/include/llvm/MC/MCELFStreamer.h
@@ -64,10 +64,10 @@ class MCELFStreamer : public MCObjectStreamer {
bool KeepOriginalSym) override;
void emitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size,
- Align ByteAlignment) override;
+ unsigned ByteAlignment) override;
void emitZerofill(MCSection *Section, MCSymbol *Symbol = nullptr,
- uint64_t Size = 0, Align ByteAlignment = Align(1),
+ uint64_t Size = 0, unsigned ByteAlignment = 0,
SMLoc L = SMLoc()) override;
void emitTBSSSymbol(MCSection *Section, MCSymbol *Symbol, uint64_t Size,
unsigned ByteAlignment = 0) override;
diff --git a/llvm/include/llvm/MC/MCSPIRVStreamer.h b/llvm/include/llvm/MC/MCSPIRVStreamer.h
index acfeea47195e..fc1e41c636d8 100644
--- a/llvm/include/llvm/MC/MCSPIRVStreamer.h
+++ b/llvm/include/llvm/MC/MCSPIRVStreamer.h
@@ -36,7 +36,7 @@ class MCSPIRVStreamer : public MCObjectStreamer {
void emitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
unsigned ByteAlignment) override {}
void emitZerofill(MCSection *Section, MCSymbol *Symbol = nullptr,
- uint64_t Size = 0, Align ByteAlignment = Align(1),
+ uint64_t Size = 0, unsigned ByteAlignment = 0,
SMLoc Loc = SMLoc()) override {}
private:
diff --git a/llvm/include/llvm/MC/MCStreamer.h b/llvm/include/llvm/MC/MCStreamer.h
index 5f5335a65518..a53435e09b4f 100644
--- a/llvm/include/llvm/MC/MCStreamer.h
+++ b/llvm/include/llvm/MC/MCStreamer.h
@@ -679,7 +679,7 @@ class MCStreamer {
/// \param Size - The size of the common symbol.
/// \param ByteAlignment - The alignment of the common symbol in bytes.
virtual void emitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size,
- Align ByteAlignment);
+ unsigned ByteAlignment);
/// Emit the zerofill section and an optional symbol.
///
@@ -689,7 +689,7 @@ class MCStreamer {
/// \param ByteAlignment - The alignment of the zerofill symbol if
/// non-zero. This must be a power of 2 on some targets.
virtual void emitZerofill(MCSection *Section, MCSymbol *Symbol = nullptr,
- uint64_t Size = 0, Align ByteAlignment = Align(1),
+ uint64_t Size = 0, unsigned ByteAlignment = 0,
SMLoc Loc = SMLoc()) = 0;
/// Emit a thread local bss (.tbss) symbol.
diff --git a/llvm/include/llvm/MC/MCWasmStreamer.h b/llvm/include/llvm/MC/MCWasmStreamer.h
index d3365df650f5..818f59e5ab3e 100644
--- a/llvm/include/llvm/MC/MCWasmStreamer.h
+++ b/llvm/include/llvm/MC/MCWasmStreamer.h
@@ -55,10 +55,10 @@ class MCWasmStreamer : public MCObjectStreamer {
void emitELFSize(MCSymbol *Symbol, const MCExpr *Value) override;
void emitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size,
- Align ByteAlignment) override;
+ unsigned ByteAlignment) override;
void emitZerofill(MCSection *Section, MCSymbol *Symbol = nullptr,
- uint64_t Size = 0, Align ByteAlignment = Align(1),
+ uint64_t Size = 0, unsigned ByteAlignment = 0,
SMLoc Loc = SMLoc()) override;
void emitTBSSSymbol(MCSection *Section, MCSymbol *Symbol, uint64_t Size,
unsigned ByteAlignment = 0) override;
diff --git a/llvm/include/llvm/MC/MCWinCOFFStreamer.h b/llvm/include/llvm/MC/MCWinCOFFStreamer.h
index 8cc69c7ea33f..0778c4d52c5e 100644
--- a/llvm/include/llvm/MC/MCWinCOFFStreamer.h
+++ b/llvm/include/llvm/MC/MCWinCOFFStreamer.h
@@ -57,10 +57,10 @@ class MCWinCOFFStreamer : public MCObjectStreamer {
void emitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
unsigned ByteAlignment) override;
void emitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size,
- Align ByteAlignment) override;
+ unsigned ByteAlignment) override;
void emitWeakReference(MCSymbol *Alias, const MCSymbol *Symbol) override;
void emitZerofill(MCSection *Section, MCSymbol *Symbol, uint64_t Size,
- Align ByteAlignment, SMLoc Loc = SMLoc()) override;
+ unsigned ByteAlignment, SMLoc Loc = SMLoc()) override;
void emitTBSSSymbol(MCSection *Section, MCSymbol *Symbol, uint64_t Size,
unsigned ByteAlignment) override;
void emitIdent(StringRef IdentString) override;
diff --git a/llvm/include/llvm/MC/MCXCOFFStreamer.h b/llvm/include/llvm/MC/MCXCOFFStreamer.h
index 02c2d97f50b7..b1ff692a435c 100644
--- a/llvm/include/llvm/MC/MCXCOFFStreamer.h
+++ b/llvm/include/llvm/MC/MCXCOFFStreamer.h
@@ -23,7 +23,7 @@ class MCXCOFFStreamer : public MCObjectStreamer {
void emitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
unsigned ByteAlignment) override;
void emitZerofill(MCSection *Section, MCSymbol *Symbol = nullptr,
- uint64_t Size = 0, Align ByteAlignment = Align(1),
+ uint64_t Size = 0, unsigned ByteAlignment = 0,
SMLoc Loc = SMLoc()) override;
void emitInstToData(const MCInst &Inst, const MCSubtargetInfo &) override;
void emitXCOFFLocalCommonSymbol(MCSymbol *LabelSym, uint64_t Size,
diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
index 257f9613a86a..f87e2cd38f75 100644
--- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
@@ -769,7 +769,7 @@ void AsmPrinter::emitGlobalVariable(const GlobalVariable *GV) {
Size = 1; // zerofill of 0 bytes is undefined.
emitLinkage(GV, GVSym);
// .zerofill __DATA, __bss, _foo, 400, 5
- OutStreamer->emitZerofill(TheSection, GVSym, Size, Alignment);
+ OutStreamer->emitZerofill(TheSection, GVSym, Size, Alignment.value());
return;
}
@@ -788,7 +788,7 @@ void AsmPrinter::emitGlobalVariable(const GlobalVariable *GV) {
// Prefer to simply fall back to .local / .comm in this case.
if (MAI->getLCOMMDirectiveAlignmentType() != LCOMM::NoAlignment) {
// .lcomm _foo, 42
- OutStreamer->emitLocalCommonSymbol(GVSym, Size, Alignment);
+ OutStreamer->emitLocalCommonSymbol(GVSym, Size, Alignment.value());
return;
}
diff --git a/llvm/lib/MC/MCAsmStreamer.cpp b/llvm/lib/MC/MCAsmStreamer.cpp
index 3474ab184cbb..223bcd7cd8d1 100644
--- a/llvm/lib/MC/MCAsmStreamer.cpp
+++ b/llvm/lib/MC/MCAsmStreamer.cpp
@@ -211,10 +211,10 @@ class MCAsmStreamer final : public MCStreamer {
/// @param Size - The size of the common symbol.
/// @param ByteAlignment - The alignment of the common symbol in bytes.
void emitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size,
- Align ByteAlignment) override;
+ unsigned ByteAlignment) override;
void emitZerofill(MCSection *Section, MCSymbol *Symbol = nullptr,
- uint64_t Size = 0, Align ByteAlignment = Align(1),
+ uint64_t Size = 0, unsigned ByteAlignment = 0,
SMLoc Loc = SMLoc()) override;
void emitTBSSSymbol(MCSection *Section, MCSymbol *Symbol, uint64_t Size,
@@ -975,10 +975,12 @@ void MCAsmStreamer::emitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
Symbol->print(OS, MAI);
OS << ',' << Size;
- if (MAI->getCOMMDirectiveAlignmentIsInBytes())
- OS << ',' << ByteAlignment;
- else
- OS << ',' << Log2_32(ByteAlignment);
+ if (ByteAlignment != 0) {
+ if (MAI->getCOMMDirectiveAlignmentIsInBytes())
+ OS << ',' << ByteAlignment;
+ else
+ OS << ',' << Log2_32(ByteAlignment);
+ }
EmitEOL();
// Print symbol's rename (original name contains invalid character(s)) if
@@ -990,7 +992,7 @@ void MCAsmStreamer::emitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
}
void MCAsmStreamer::emitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size,
- Align ByteAlign) {
+ unsigned ByteAlign) {
OS << "\t.lcomm\t";
Symbol->print(OS, MAI);
OS << ',' << Size;
@@ -1000,10 +1002,11 @@ void MCAsmStreamer::emitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size,
case LCOMM::NoAlignment:
llvm_unreachable("alignment not supported on .lcomm!");
case LCOMM::ByteAlignment:
- OS << ',' << ByteAlign.value();
+ OS << ',' << ByteAlign;
break;
case LCOMM::Log2Alignment:
- OS << ',' << Log2(ByteAlign);
+ assert(isPowerOf2_32(ByteAlign) && "alignment must be a power of 2");
+ OS << ',' << Log2_32(ByteAlign);
break;
}
}
@@ -1011,7 +1014,7 @@ void MCAsmStreamer::emitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size,
}
void MCAsmStreamer::emitZerofill(MCSection *Section, MCSymbol *Symbol,
- uint64_t Size, Align ByteAlignment,
+ uint64_t Size, unsigned ByteAlignment,
SMLoc Loc) {
if (Symbol)
assignFragment(Symbol, &Section->getDummyFragment());
@@ -1030,7 +1033,8 @@ void MCAsmStreamer::emitZerofill(MCSection *Section, MCSymbol *Symbol,
OS << ',';
Symbol->print(OS, MAI);
OS << ',' << Size;
- OS << ',' << Log2(ByteAlignment);
+ if (ByteAlignment != 0)
+ OS << ',' << Log2_32(ByteAlignment);
}
EmitEOL();
}
diff --git a/llvm/lib/MC/MCELFStreamer.cpp b/llvm/lib/MC/MCELFStreamer.cpp
index 71d556abd699..6e0e80f4f97a 100644
--- a/llvm/lib/MC/MCELFStreamer.cpp
+++ b/llvm/lib/MC/MCELFStreamer.cpp
@@ -352,12 +352,12 @@ void MCELFStreamer::emitELFSymverDirective(const MCSymbol *OriginalSym,
}
void MCELFStreamer::emitLocalCommonSymbol(MCSymbol *S, uint64_t Size,
- Align ByteAlignment) {
+ unsigned ByteAlignment) {
auto *Symbol = cast<MCSymbolELF>(S);
// FIXME: Should this be caught and done earlier?
getAssembler().registerSymbol(*Symbol);
Symbol->setBinding(ELF::STB_LOCAL);
- emitCommonSymbol(Symbol, Size, ByteAlignment.value());
+ emitCommonSymbol(Symbol, Size, ByteAlignment);
}
void MCELFStreamer::emitValueImpl(const MCExpr *Value, unsigned Size,
@@ -727,7 +727,7 @@ void MCELFStreamer::emitSymbolDesc(MCSymbol *Symbol, unsigned DescValue) {
}
void MCELFStreamer::emitZerofill(MCSection *Section, MCSymbol *Symbol,
- uint64_t Size, Align ByteAlignment,
+ uint64_t Size, unsigned ByteAlignment,
SMLoc Loc) {
llvm_unreachable("ELF doesn't support this directive");
}
diff --git a/llvm/lib/MC/MCMachOStreamer.cpp b/llvm/lib/MC/MCMachOStreamer.cpp
index 9352ae9e17f6..a1cbc99068f1 100644
--- a/llvm/lib/MC/MCMachOStreamer.cpp
+++ b/llvm/lib/MC/MCMachOStreamer.cpp
@@ -107,9 +107,9 @@ class MCMachOStreamer : public MCObjectStreamer {
unsigned ByteAlignment) override;
void emitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size,
- Align ByteAlignment) override;
+ unsigned ByteAlignment) override;
void emitZerofill(MCSection *Section, MCSymbol *Symbol = nullptr,
- uint64_t Size = 0, Align ByteAlignment = Align(1),
+ uint64_t Size = 0, unsigned ByteAlignment = 0,
SMLoc Loc = SMLoc()) override;
void emitTBSSSymbol(MCSection *Section, MCSymbol *Symbol, uint64_t Size,
unsigned ByteAlignment = 0) override;
@@ -441,14 +441,14 @@ void MCMachOStreamer::emitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
}
void MCMachOStreamer::emitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size,
- Align ByteAlignment) {
+ unsigned ByteAlignment) {
// '.lcomm' is equivalent to '.zerofill'.
return emitZerofill(getContext().getObjectFileInfo()->getDataBSSSection(),
Symbol, Size, ByteAlignment);
}
void MCMachOStreamer::emitZerofill(MCSection *Section, MCSymbol *Symbol,
- uint64_t Size, Align ByteAlignment,
+ uint64_t Size, unsigned ByteAlignment,
SMLoc Loc) {
// On darwin all virtual sections have zerofill type. Disallow the usage of
// .zerofill in non-virtual functions. If something similar is needed, use
@@ -466,7 +466,7 @@ void MCMachOStreamer::emitZerofill(MCSection *Section, MCSymbol *Symbol,
// The symbol may not be present, which only creates the section.
if (Symbol) {
- emitValueToAlignment(ByteAlignment, 0, 1, 0);
+ emitValueToAlignment(Align(ByteAlignment), 0, 1, 0);
emitLabel(Symbol);
emitZeros(Size);
}
@@ -477,7 +477,7 @@ void MCMachOStreamer::emitZerofill(MCSection *Section, MCSymbol *Symbol,
// .zerofill directive this doesn't actually switch sections on us.
void MCMachOStreamer::emitTBSSSymbol(MCSection *Section, MCSymbol *Symbol,
uint64_t Size, unsigned ByteAlignment) {
- emitZerofill(Section, Symbol, Size, Align(ByteAlignment));
+ emitZerofill(Section, Symbol, Size, ByteAlignment);
}
void MCMachOStreamer::emitInstToData(const MCInst &Inst,
diff --git a/llvm/lib/MC/MCNullStreamer.cpp b/llvm/lib/MC/MCNullStreamer.cpp
index 2692e938faa4..83e8962451d5 100644
--- a/llvm/lib/MC/MCNullStreamer.cpp
+++ b/llvm/lib/MC/MCNullStreamer.cpp
@@ -39,7 +39,7 @@ namespace {
void emitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
unsigned ByteAlignment) override {}
void emitZerofill(MCSection *Section, MCSymbol *Symbol = nullptr,
- uint64_t Size = 0, Align ByteAlignment = Align(1),
+ uint64_t Size = 0, unsigned ByteAlignment = 0,
SMLoc Loc = SMLoc()) override {}
void emitGPRel32Value(const MCExpr *Value) override {}
void beginCOFFSymbolDef(const MCSymbol *Symbol) override {}
diff --git a/llvm/lib/MC/MCParser/AsmParser.cpp b/llvm/lib/MC/MCParser/AsmParser.cpp
index 87c2122231da..d3a6f51e0aa6 100644
--- a/llvm/lib/MC/MCParser/AsmParser.cpp
+++ b/llvm/lib/MC/MCParser/AsmParser.cpp
@@ -5059,7 +5059,7 @@ bool AsmParser::parseDirectiveComm(bool IsLocal) {
// Create the Symbol as a common or local common with Size and Pow2Alignment
if (IsLocal) {
- getStreamer().emitLocalCommonSymbol(Sym, Size, Align(1 << Pow2Alignment));
+ getStreamer().emitLocalCommonSymbol(Sym, Size, 1 << Pow2Alignment);
return false;
}
diff --git a/llvm/lib/MC/MCParser/DarwinAsmParser.cpp b/llvm/lib/MC/MCParser/DarwinAsmParser.cpp
index ed2abf934236..f9a377b0745a 100644
--- a/llvm/lib/MC/MCParser/DarwinAsmParser.cpp
+++ b/llvm/lib/MC/MCParser/DarwinAsmParser.cpp
@@ -902,7 +902,7 @@ bool DarwinAsmParser::parseDirectiveZerofill(StringRef, SMLoc) {
getStreamer().emitZerofill(
getContext().getMachOSection(Segment, Section, MachO::S_ZEROFILL, 0,
SectionKind::getBSS()),
- /*Symbol=*/nullptr, /*Size=*/0, Align(1), SectionLoc);
+ /*Symbol=*/nullptr, /*Size=*/0, /*ByteAlignment=*/0, SectionLoc);
return false;
}
@@ -958,10 +958,10 @@ bool DarwinAsmParser::parseDirectiveZerofill(StringRef, SMLoc) {
// Create the zerofill Symbol with Size and Pow2Alignment
//
// FIXME: Arch specific.
- getStreamer().emitZerofill(
- getContext().getMachOSection(Segment, Section, MachO::S_ZEROFILL, 0,
- SectionKind::getBSS()),
- Sym, Size, Align(1 << Pow2Alignment), SectionLoc);
+ getStreamer().emitZerofill(getContext().getMachOSection(
+ Segment, Section, MachO::S_ZEROFILL,
+ 0, SectionKind::getBSS()),
+ Sym, Size, 1 << Pow2Alignment, SectionLoc);
return false;
}
diff --git a/llvm/lib/MC/MCParser/MasmParser.cpp b/llvm/lib/MC/MCParser/MasmParser.cpp
index ce5541b30c70..e2d18802f3bb 100644
--- a/llvm/lib/MC/MCParser/MasmParser.cpp
+++ b/llvm/lib/MC/MCParser/MasmParser.cpp
@@ -6120,7 +6120,7 @@ bool MasmParser::parseDirectiveComm(bool IsLocal) {
// Create the Symbol as a common or local common with Size and Pow2Alignment.
if (IsLocal) {
- getStreamer().emitLocalCommonSymbol(Sym, Size, Align(1 << Pow2Alignment));
+ getStreamer().emitLocalCommonSymbol(Sym, Size, 1 << Pow2Alignment);
return false;
}
diff --git a/llvm/lib/MC/MCStreamer.cpp b/llvm/lib/MC/MCStreamer.cpp
index c87b841b879b..968bd8b97167 100644
--- a/llvm/lib/MC/MCStreamer.cpp
+++ b/llvm/lib/MC/MCStreamer.cpp
@@ -1202,7 +1202,7 @@ void MCStreamer::emitELFSize(MCSymbol *Symbol, const MCExpr *Value) {}
void MCStreamer::emitELFSymverDirective(const MCSymbol *OriginalSym,
StringRef Name, bool KeepOriginalSym) {}
void MCStreamer::emitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size,
- Align ByteAlignment) {}
+ unsigned ByteAlignment) {}
void MCStreamer::emitTBSSSymbol(MCSection *Section, MCSymbol *Symbol,
uint64_t Size, unsigned ByteAlignment) {}
void MCStreamer::changeSection(MCSection *, const MCExpr *) {}
diff --git a/llvm/lib/MC/MCWasmStreamer.cpp b/llvm/lib/MC/MCWasmStreamer.cpp
index 351951bf7d2e..ce948c7435f5 100644
--- a/llvm/lib/MC/MCWasmStreamer.cpp
+++ b/llvm/lib/MC/MCWasmStreamer.cpp
@@ -173,7 +173,7 @@ void MCWasmStreamer::emitELFSize(MCSymbol *Symbol, const MCExpr *Value) {
}
void MCWasmStreamer::emitLocalCommonSymbol(MCSymbol *S, uint64_t Size,
- Align ByteAlignment) {
+ unsigned ByteAlignment) {
llvm_unreachable("Local common symbols are not yet implemented for Wasm");
}
@@ -263,7 +263,7 @@ void MCWasmStreamer::emitSymbolDesc(MCSymbol *Symbol, unsigned DescValue) {
}
void MCWasmStreamer::emitZerofill(MCSection *Section, MCSymbol *Symbol,
- uint64_t Size, Align ByteAlignment,
+ uint64_t Size, unsigned ByteAlignment,
SMLoc Loc) {
llvm_unreachable("Wasm doesn't support this directive");
}
diff --git a/llvm/lib/MC/MCWinCOFFStreamer.cpp b/llvm/lib/MC/MCWinCOFFStreamer.cpp
index 173e8b52e1d6..67902472f471 100644
--- a/llvm/lib/MC/MCWinCOFFStreamer.cpp
+++ b/llvm/lib/MC/MCWinCOFFStreamer.cpp
@@ -292,13 +292,13 @@ void MCWinCOFFStreamer::emitCommonSymbol(MCSymbol *S, uint64_t Size,
}
void MCWinCOFFStreamer::emitLocalCommonSymbol(MCSymbol *S, uint64_t Size,
- Align ByteAlignment) {
+ unsigned ByteAlignment) {
auto *Symbol = cast<MCSymbolCOFF>(S);
MCSection *Section = getContext().getObjectFileInfo()->getBSSSection();
pushSection();
switchSection(Section);
- emitValueToAlignment(ByteAlignment, 0, 1, 0);
+ emitValueToAlignment(Align(ByteAlignment), 0, 1, 0);
emitLabel(Symbol);
Symbol->setExternal(false);
emitZeros(Size);
@@ -316,7 +316,7 @@ void MCWinCOFFStreamer::emitWeakReference(MCSymbol *AliasS,
}
void MCWinCOFFStreamer::emitZerofill(MCSection *Section, MCSymbol *Symbol,
- uint64_t Size, Align ByteAlignment,
+ uint64_t Size, unsigned ByteAlignment,
SMLoc Loc) {
llvm_unreachable("not implemented");
}
diff --git a/llvm/lib/MC/MCXCOFFStreamer.cpp b/llvm/lib/MC/MCXCOFFStreamer.cpp
index 6d3deed03512..f77d7df2bbf5 100644
--- a/llvm/lib/MC/MCXCOFFStreamer.cpp
+++ b/llvm/lib/MC/MCXCOFFStreamer.cpp
@@ -108,7 +108,7 @@ void MCXCOFFStreamer::emitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
}
void MCXCOFFStreamer::emitZerofill(MCSection *Section, MCSymbol *Symbol,
- uint64_t Size, Align ByteAlignment,
+ uint64_t Size, unsigned ByteAlignment,
SMLoc Loc) {
report_fatal_error("Zero fill not implemented for XCOFF.");
}
diff --git a/llvm/lib/Object/RecordStreamer.cpp b/llvm/lib/Object/RecordStreamer.cpp
index e8bdf07d7374..2d07d34bbf97 100644
--- a/llvm/lib/Object/RecordStreamer.cpp
+++ b/llvm/lib/Object/RecordStreamer.cpp
@@ -106,7 +106,7 @@ bool RecordStreamer::emitSymbolAttribute(MCSymbol *Symbol,
}
void RecordStreamer::emitZerofill(MCSection *Section, MCSymbol *Symbol,
- uint64_t Size, Align ByteAlignment,
+ uint64_t Size, unsigned ByteAlignment,
SMLoc Loc) {
markDefined(*Symbol);
}
diff --git a/llvm/lib/Object/RecordStreamer.h b/llvm/lib/Object/RecordStreamer.h
index 596e2646ec3c..5c6541e5052d 100644
--- a/llvm/lib/Object/RecordStreamer.h
+++ b/llvm/lib/Object/RecordStreamer.h
@@ -50,7 +50,7 @@ class RecordStreamer : public MCStreamer {
void emitAssignment(MCSymbol *Symbol, const MCExpr *Value) override;
bool emitSymbolAttribute(MCSymbol *Symbol, MCSymbolAttr Attribute) override;
void emitZerofill(MCSection *Section, MCSymbol *Symbol, uint64_t Size,
- Align ByteAlignment, SMLoc Loc = SMLoc()) override;
+ unsigned ByteAlignment, SMLoc Loc = SMLoc()) override;
void emitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
unsigned ByteAlignment) override;
diff --git a/llvm/tools/llvm-exegesis/lib/SnippetFile.cpp b/llvm/tools/llvm-exegesis/lib/SnippetFile.cpp
index 97734c529bdc..3983b83910ef 100644
--- a/llvm/tools/llvm-exegesis/lib/SnippetFile.cpp
+++ b/llvm/tools/llvm-exegesis/lib/SnippetFile.cpp
@@ -96,7 +96,7 @@ class BenchmarkCodeStreamer : public MCStreamer, public AsmCommentConsumer {
void emitValueToAlignment(Align Alignment, int64_t Value, unsigned ValueSize,
unsigned MaxBytesToEmit) override {}
void emitZerofill(MCSection *Section, MCSymbol *Symbol, uint64_t Size,
- Align ByteAlignment, SMLoc Loc) override {}
+ unsigned ByteAlignment, SMLoc Loc) override {}
unsigned findRegisterByName(const StringRef RegName) const {
// FIXME: Can we do better than this ?
diff --git a/llvm/tools/llvm-mca/CodeRegionGenerator.cpp b/llvm/tools/llvm-mca/CodeRegionGenerator.cpp
index b1a2dad92551..d64323419b7e 100644
--- a/llvm/tools/llvm-mca/CodeRegionGenerator.cpp
+++ b/llvm/tools/llvm-mca/CodeRegionGenerator.cpp
@@ -50,7 +50,7 @@ class MCStreamerWrapper final : public MCStreamer {
void emitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
unsigned ByteAlignment) override {}
void emitZerofill(MCSection *Section, MCSymbol *Symbol = nullptr,
- uint64_t Size = 0, Align ByteAlignment = Align(1),
+ uint64_t Size = 0, unsigned ByteAlignment = 0,
SMLoc Loc = SMLoc()) override {}
void emitGPRel32Value(const MCExpr *Value) override {}
void beginCOFFSymbolDef(const MCSymbol *Symbol) override {}
diff --git a/llvm/unittests/CodeGen/TestAsmPrinter.h b/llvm/unittests/CodeGen/TestAsmPrinter.h
index fd2cd37d27c3..1414b8229ed3 100644
--- a/llvm/unittests/CodeGen/TestAsmPrinter.h
+++ b/llvm/unittests/CodeGen/TestAsmPrinter.h
@@ -34,7 +34,7 @@ class MockMCStreamer : public MCStreamer {
void(MCSymbol *Symbol, uint64_t Size, unsigned ByteAlignment));
MOCK_METHOD5(emitZerofill,
void(MCSection *Section, MCSymbol *Symbol, uint64_t Size,
- Align ByteAlignment, SMLoc Loc));
+ unsigned ByteAlignment, SMLoc Loc));
// The following are mock methods to be used in tests.
More information about the llvm-commits
mailing list