[llvm] 5bf8e14 - [Alignment] Use Align in MCStreamer::emitCommonSymbol
Guillaume Chatelet via llvm-commits
llvm-commits at lists.llvm.org
Fri Dec 9 02:18:48 PST 2022
Author: Guillaume Chatelet
Date: 2022-12-09T10:10:34Z
New Revision: 5bf8e14350105b19d3815a3e357fbe7b964cbd45
URL: https://github.com/llvm/llvm-project/commit/5bf8e14350105b19d3815a3e357fbe7b964cbd45
DIFF: https://github.com/llvm/llvm-project/commit/5bf8e14350105b19d3815a3e357fbe7b964cbd45.diff
LOG: [Alignment] Use Align in MCStreamer::emitCommonSymbol
Next patch after D139548 and D139439. Same expectations, the change seems safe with as far as llvm goes, we cannot check downstream implementations.
Differential Revision: https://reviews.llvm.org/D139614
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/MasmParser.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/lib/Target/PowerPC/PPCAsmPrinter.cpp
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 60a5a28dec997..91d4ea9bc1065 100644
--- a/llvm/include/llvm/MC/MCDXContainerStreamer.h
+++ b/llvm/include/llvm/MC/MCDXContainerStreamer.h
@@ -34,7 +34,7 @@ class MCDXContainerStreamer : public MCObjectStreamer {
std::move(Emitter)) {}
bool emitSymbolAttribute(MCSymbol *, MCSymbolAttr) override { return false; }
- void emitCommonSymbol(MCSymbol *, uint64_t, unsigned) override {}
+ void emitCommonSymbol(MCSymbol *, uint64_t, Align) override {}
void emitZerofill(MCSection *, MCSymbol *Symbol = nullptr, uint64_t Size = 0,
Align ByteAlignment = Align(1),
SMLoc Loc = SMLoc()) override {}
diff --git a/llvm/include/llvm/MC/MCELFStreamer.h b/llvm/include/llvm/MC/MCELFStreamer.h
index 71c229a96ac7a..1309b17bff9c1 100644
--- a/llvm/include/llvm/MC/MCELFStreamer.h
+++ b/llvm/include/llvm/MC/MCELFStreamer.h
@@ -57,7 +57,7 @@ class MCELFStreamer : public MCObjectStreamer {
bool emitSymbolAttribute(MCSymbol *Symbol, MCSymbolAttr Attribute) override;
void emitSymbolDesc(MCSymbol *Symbol, unsigned DescValue) override;
void emitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
- unsigned ByteAlignment) override;
+ Align ByteAlignment) override;
void emitELFSize(MCSymbol *Symbol, const MCExpr *Value) override;
void emitELFSymverDirective(const MCSymbol *OriginalSym, StringRef Name,
diff --git a/llvm/include/llvm/MC/MCSPIRVStreamer.h b/llvm/include/llvm/MC/MCSPIRVStreamer.h
index acfeea47195e3..b03ae5d4599c9 100644
--- a/llvm/include/llvm/MC/MCSPIRVStreamer.h
+++ b/llvm/include/llvm/MC/MCSPIRVStreamer.h
@@ -34,7 +34,7 @@ class MCSPIRVStreamer : public MCObjectStreamer {
return false;
}
void emitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
- unsigned ByteAlignment) override {}
+ Align ByteAlignment) override {}
void emitZerofill(MCSection *Section, MCSymbol *Symbol = nullptr,
uint64_t Size = 0, Align ByteAlignment = Align(1),
SMLoc Loc = SMLoc()) override {}
diff --git a/llvm/include/llvm/MC/MCStreamer.h b/llvm/include/llvm/MC/MCStreamer.h
index ff13cae1e7551..622dad3d2c835 100644
--- a/llvm/include/llvm/MC/MCStreamer.h
+++ b/llvm/include/llvm/MC/MCStreamer.h
@@ -667,10 +667,9 @@ class MCStreamer {
///
/// \param Symbol - The common symbol to emit.
/// \param Size - The size of the common symbol.
- /// \param ByteAlignment - The alignment of the symbol if
- /// non-zero. This must be a power of 2.
+ /// \param ByteAlignment - The alignment of the symbol.
virtual void emitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
- unsigned ByteAlignment) = 0;
+ Align ByteAlignment) = 0;
/// Emit a local common (.lcomm) symbol.
///
diff --git a/llvm/include/llvm/MC/MCWasmStreamer.h b/llvm/include/llvm/MC/MCWasmStreamer.h
index 1a4947a53bfc3..f58405214a80a 100644
--- a/llvm/include/llvm/MC/MCWasmStreamer.h
+++ b/llvm/include/llvm/MC/MCWasmStreamer.h
@@ -50,7 +50,7 @@ class MCWasmStreamer : public MCObjectStreamer {
bool emitSymbolAttribute(MCSymbol *Symbol, MCSymbolAttr Attribute) override;
void emitSymbolDesc(MCSymbol *Symbol, unsigned DescValue) override;
void emitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
- unsigned ByteAlignment) override;
+ Align ByteAlignment) override;
void emitELFSize(MCSymbol *Symbol, const MCExpr *Value) override;
diff --git a/llvm/include/llvm/MC/MCWinCOFFStreamer.h b/llvm/include/llvm/MC/MCWinCOFFStreamer.h
index fc8325eb0d099..52563f120fdb4 100644
--- a/llvm/include/llvm/MC/MCWinCOFFStreamer.h
+++ b/llvm/include/llvm/MC/MCWinCOFFStreamer.h
@@ -55,7 +55,7 @@ class MCWinCOFFStreamer : public MCObjectStreamer {
void emitCOFFSecRel32(MCSymbol const *Symbol, uint64_t Offset) override;
void emitCOFFImgRel32(MCSymbol const *Symbol, int64_t Offset) override;
void emitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
- unsigned ByteAlignment) override;
+ Align ByteAlignment) override;
void emitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size,
Align ByteAlignment) override;
void emitWeakReference(MCSymbol *Alias, const MCSymbol *Symbol) override;
diff --git a/llvm/include/llvm/MC/MCXCOFFStreamer.h b/llvm/include/llvm/MC/MCXCOFFStreamer.h
index 02c2d97f50b73..a437faeccbff4 100644
--- a/llvm/include/llvm/MC/MCXCOFFStreamer.h
+++ b/llvm/include/llvm/MC/MCXCOFFStreamer.h
@@ -21,7 +21,7 @@ class MCXCOFFStreamer : public MCObjectStreamer {
bool emitSymbolAttribute(MCSymbol *Symbol, MCSymbolAttr Attribute) override;
void emitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
- unsigned ByteAlignment) override;
+ Align ByteAlignment) override;
void emitZerofill(MCSection *Section, MCSymbol *Symbol = nullptr,
uint64_t Size = 0, Align ByteAlignment = Align(1),
SMLoc Loc = SMLoc()) override;
diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
index e7f96a75ecc79..770a270235396 100644
--- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
@@ -754,7 +754,7 @@ void AsmPrinter::emitGlobalVariable(const GlobalVariable *GV) {
if (GVKind.isCommon()) {
if (Size == 0) Size = 1; // .comm Foo, 0 is undefined, avoid it.
// .comm _foo, 42, 4
- OutStreamer->emitCommonSymbol(GVSym, Size, Alignment.value());
+ OutStreamer->emitCommonSymbol(GVSym, Size, Alignment);
return;
}
@@ -795,7 +795,7 @@ void AsmPrinter::emitGlobalVariable(const GlobalVariable *GV) {
// .local _foo
OutStreamer->emitSymbolAttribute(GVSym, MCSA_Local);
// .comm _foo, 42, 4
- OutStreamer->emitCommonSymbol(GVSym, Size, Alignment.value());
+ OutStreamer->emitCommonSymbol(GVSym, Size, Alignment);
return;
}
diff --git a/llvm/lib/MC/MCAsmStreamer.cpp b/llvm/lib/MC/MCAsmStreamer.cpp
index 952da7def4c8f..f562289305b0b 100644
--- a/llvm/lib/MC/MCAsmStreamer.cpp
+++ b/llvm/lib/MC/MCAsmStreamer.cpp
@@ -203,7 +203,7 @@ class MCAsmStreamer final : public MCStreamer {
void emitELFSize(MCSymbol *Symbol, const MCExpr *Value) override;
void emitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
- unsigned ByteAlignment) override;
+ Align ByteAlignment) override;
/// Emit a local common (.lcomm) symbol.
///
@@ -970,15 +970,15 @@ void MCAsmStreamer::emitELFSize(MCSymbol *Symbol, const MCExpr *Value) {
}
void MCAsmStreamer::emitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
- unsigned ByteAlignment) {
+ Align ByteAlignment) {
OS << "\t.comm\t";
Symbol->print(OS, MAI);
OS << ',' << Size;
if (MAI->getCOMMDirectiveAlignmentIsInBytes())
- OS << ',' << ByteAlignment;
+ OS << ',' << ByteAlignment.value();
else
- OS << ',' << Log2_32(ByteAlignment);
+ OS << ',' << Log2(ByteAlignment);
EmitEOL();
// Print symbol's rename (original name contains invalid character(s)) if
@@ -986,7 +986,6 @@ void MCAsmStreamer::emitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
MCSymbolXCOFF *XSym = dyn_cast<MCSymbolXCOFF>(Symbol);
if (XSym && XSym->hasRename())
emitXCOFFRenameDirective(XSym, XSym->getSymbolTableName());
-
}
void MCAsmStreamer::emitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size,
diff --git a/llvm/lib/MC/MCELFStreamer.cpp b/llvm/lib/MC/MCELFStreamer.cpp
index f01ba9815026e..e3db13ee54746 100644
--- a/llvm/lib/MC/MCELFStreamer.cpp
+++ b/llvm/lib/MC/MCELFStreamer.cpp
@@ -310,7 +310,7 @@ bool MCELFStreamer::emitSymbolAttribute(MCSymbol *S, MCSymbolAttr Attribute) {
}
void MCELFStreamer::emitCommonSymbol(MCSymbol *S, uint64_t Size,
- unsigned ByteAlignment) {
+ Align ByteAlignment) {
auto *Symbol = cast<MCSymbolELF>(S);
getAssembler().registerSymbol(*Symbol);
@@ -325,13 +325,13 @@ void MCELFStreamer::emitCommonSymbol(MCSymbol *S, uint64_t Size,
MCSectionSubPair P = getCurrentSection();
switchSection(&Section);
- emitValueToAlignment(Align(ByteAlignment), 0, 1, 0);
+ emitValueToAlignment(ByteAlignment, 0, 1, 0);
emitLabel(Symbol);
emitZeros(Size);
switchSection(P.first, P.second);
} else {
- if(Symbol->declareCommon(Size, ByteAlignment))
+ if (Symbol->declareCommon(Size, ByteAlignment.value()))
report_fatal_error(Twine("Symbol: ") + Symbol->getName() +
" redeclared as
diff erent type");
}
@@ -357,7 +357,7 @@ void MCELFStreamer::emitLocalCommonSymbol(MCSymbol *S, uint64_t Size,
// 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,
diff --git a/llvm/lib/MC/MCMachOStreamer.cpp b/llvm/lib/MC/MCMachOStreamer.cpp
index 3a0f913d7f9ac..9d6e6d71a1136 100644
--- a/llvm/lib/MC/MCMachOStreamer.cpp
+++ b/llvm/lib/MC/MCMachOStreamer.cpp
@@ -104,7 +104,7 @@ class MCMachOStreamer : public MCObjectStreamer {
bool emitSymbolAttribute(MCSymbol *Symbol, MCSymbolAttr Attribute) override;
void emitSymbolDesc(MCSymbol *Symbol, unsigned DescValue) override;
void emitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
- unsigned ByteAlignment) override;
+ Align ByteAlignment) override;
void emitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size,
Align ByteAlignment) override;
@@ -431,13 +431,13 @@ void MCMachOStreamer::emitSymbolDesc(MCSymbol *Symbol, unsigned DescValue) {
}
void MCMachOStreamer::emitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
- unsigned ByteAlignment) {
+ Align ByteAlignment) {
// FIXME: Darwin 'as' does appear to allow redef of a .comm by itself.
assert(Symbol->isUndefined() && "Cannot define a symbol twice!");
getAssembler().registerSymbol(*Symbol);
Symbol->setExternal(true);
- Symbol->setCommon(Size, ByteAlignment);
+ Symbol->setCommon(Size, ByteAlignment.value());
}
void MCMachOStreamer::emitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size,
diff --git a/llvm/lib/MC/MCNullStreamer.cpp b/llvm/lib/MC/MCNullStreamer.cpp
index 2692e938faa4c..7d5a823b389ab 100644
--- a/llvm/lib/MC/MCNullStreamer.cpp
+++ b/llvm/lib/MC/MCNullStreamer.cpp
@@ -37,7 +37,7 @@ namespace {
}
void emitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
- unsigned ByteAlignment) override {}
+ Align ByteAlignment) override {}
void emitZerofill(MCSection *Section, MCSymbol *Symbol = nullptr,
uint64_t Size = 0, Align ByteAlignment = Align(1),
SMLoc Loc = SMLoc()) override {}
diff --git a/llvm/lib/MC/MCParser/AsmParser.cpp b/llvm/lib/MC/MCParser/AsmParser.cpp
index c82ebd6822fd8..05ed66658357d 100644
--- a/llvm/lib/MC/MCParser/AsmParser.cpp
+++ b/llvm/lib/MC/MCParser/AsmParser.cpp
@@ -5064,7 +5064,7 @@ bool AsmParser::parseDirectiveComm(bool IsLocal) {
return false;
}
- getStreamer().emitCommonSymbol(Sym, Size, 1 << Pow2Alignment);
+ getStreamer().emitCommonSymbol(Sym, Size, Align(1ULL << Pow2Alignment));
return false;
}
diff --git a/llvm/lib/MC/MCParser/MasmParser.cpp b/llvm/lib/MC/MCParser/MasmParser.cpp
index 8637ae514937f..918c614f9b8db 100644
--- a/llvm/lib/MC/MCParser/MasmParser.cpp
+++ b/llvm/lib/MC/MCParser/MasmParser.cpp
@@ -6125,7 +6125,7 @@ bool MasmParser::parseDirectiveComm(bool IsLocal) {
return false;
}
- getStreamer().emitCommonSymbol(Sym, Size, 1 << Pow2Alignment);
+ getStreamer().emitCommonSymbol(Sym, Size, Align(1ULL << Pow2Alignment));
return false;
}
diff --git a/llvm/lib/MC/MCWasmStreamer.cpp b/llvm/lib/MC/MCWasmStreamer.cpp
index d035e373ed4eb..823e98a871bdf 100644
--- a/llvm/lib/MC/MCWasmStreamer.cpp
+++ b/llvm/lib/MC/MCWasmStreamer.cpp
@@ -164,7 +164,7 @@ bool MCWasmStreamer::emitSymbolAttribute(MCSymbol *S, MCSymbolAttr Attribute) {
}
void MCWasmStreamer::emitCommonSymbol(MCSymbol *S, uint64_t Size,
- unsigned ByteAlignment) {
+ Align ByteAlignment) {
llvm_unreachable("Common symbols are not yet implemented for Wasm");
}
diff --git a/llvm/lib/MC/MCWinCOFFStreamer.cpp b/llvm/lib/MC/MCWinCOFFStreamer.cpp
index 4334eb1e0ed7e..2bb5bb53fc351 100644
--- a/llvm/lib/MC/MCWinCOFFStreamer.cpp
+++ b/llvm/lib/MC/MCWinCOFFStreamer.cpp
@@ -260,7 +260,7 @@ void MCWinCOFFStreamer::emitCOFFImgRel32(const MCSymbol *Symbol,
}
void MCWinCOFFStreamer::emitCommonSymbol(MCSymbol *S, uint64_t Size,
- unsigned ByteAlignment) {
+ Align ByteAlignment) {
auto *Symbol = cast<MCSymbolCOFF>(S);
const Triple &T = getContext().getTargetTriple();
@@ -269,12 +269,12 @@ void MCWinCOFFStreamer::emitCommonSymbol(MCSymbol *S, uint64_t Size,
report_fatal_error("alignment is limited to 32-bytes");
// Round size up to alignment so that we will honor the alignment request.
- Size = std::max(Size, static_cast<uint64_t>(ByteAlignment));
+ Size = std::max(Size, ByteAlignment.value());
}
getAssembler().registerSymbol(*Symbol);
Symbol->setExternal(true);
- Symbol->setCommon(Size, ByteAlignment);
+ Symbol->setCommon(Size, ByteAlignment.value());
if (!T.isWindowsMSVCEnvironment() && ByteAlignment > 1) {
SmallString<128> Directive;
@@ -282,7 +282,7 @@ void MCWinCOFFStreamer::emitCommonSymbol(MCSymbol *S, uint64_t Size,
const MCObjectFileInfo *MFI = getContext().getObjectFileInfo();
OS << " -aligncomm:\"" << Symbol->getName() << "\","
- << Log2_32_Ceil(ByteAlignment);
+ << Log2_32_Ceil(ByteAlignment.value());
pushSection();
switchSection(MFI->getDrectveSection());
diff --git a/llvm/lib/MC/MCXCOFFStreamer.cpp b/llvm/lib/MC/MCXCOFFStreamer.cpp
index 6d3deed03512a..b521b164a0468 100644
--- a/llvm/lib/MC/MCXCOFFStreamer.cpp
+++ b/llvm/lib/MC/MCXCOFFStreamer.cpp
@@ -91,19 +91,19 @@ void MCXCOFFStreamer::emitXCOFFExceptDirective(const MCSymbol *Symbol,
}
void MCXCOFFStreamer::emitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
- unsigned ByteAlignment) {
+ Align ByteAlignment) {
getAssembler().registerSymbol(*Symbol);
Symbol->setExternal(cast<MCSymbolXCOFF>(Symbol)->getStorageClass() !=
XCOFF::C_HIDEXT);
- Symbol->setCommon(Size, ByteAlignment);
+ Symbol->setCommon(Size, ByteAlignment.value());
// Default csect align is 4, but common symbols have explicit alignment values
// and we should honor it.
cast<MCSymbolXCOFF>(Symbol)->getRepresentedCsect()->setAlignment(
- Align(ByteAlignment));
+ ByteAlignment);
// Emit the alignment and storage for the variable to the section.
- emitValueToAlignment(Align(ByteAlignment));
+ emitValueToAlignment(ByteAlignment);
emitZeros(Size);
}
@@ -150,5 +150,5 @@ void MCXCOFFStreamer::emitXCOFFLocalCommonSymbol(MCSymbol *LabelSym,
uint64_t Size,
MCSymbol *CsectSym,
Align Alignment) {
- emitCommonSymbol(CsectSym, Size, Alignment.value());
+ emitCommonSymbol(CsectSym, Size, Alignment);
}
diff --git a/llvm/lib/Object/RecordStreamer.cpp b/llvm/lib/Object/RecordStreamer.cpp
index e8bdf07d7374b..2548dd6c84d2a 100644
--- a/llvm/lib/Object/RecordStreamer.cpp
+++ b/llvm/lib/Object/RecordStreamer.cpp
@@ -112,7 +112,7 @@ void RecordStreamer::emitZerofill(MCSection *Section, MCSymbol *Symbol,
}
void RecordStreamer::emitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
- unsigned ByteAlignment) {
+ Align ByteAlignment) {
markDefined(*Symbol);
}
diff --git a/llvm/lib/Object/RecordStreamer.h b/llvm/lib/Object/RecordStreamer.h
index 596e2646ec3c3..a568739d3763c 100644
--- a/llvm/lib/Object/RecordStreamer.h
+++ b/llvm/lib/Object/RecordStreamer.h
@@ -52,7 +52,7 @@ class RecordStreamer : public MCStreamer {
void emitZerofill(MCSection *Section, MCSymbol *Symbol, uint64_t Size,
Align ByteAlignment, SMLoc Loc = SMLoc()) override;
void emitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
- unsigned ByteAlignment) override;
+ Align ByteAlignment) override;
// Ignore COFF-specific directives; we do not need any information from them,
// but the default implementation of these methods crashes, so we override
diff --git a/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp b/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
index 0952e1cbd81c1..955f8cd44e8d2 100644
--- a/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
+++ b/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
@@ -2434,7 +2434,7 @@ void PPCAIXAsmPrinter::emitGlobalVariableHelper(const GlobalVariable *GV) {
OutContext.getOrCreateSymbol(GVSym->getSymbolTableName()), Size,
GVSym, Alignment);
else
- OutStreamer->emitCommonSymbol(GVSym, Size, Alignment.value());
+ OutStreamer->emitCommonSymbol(GVSym, Size, Alignment);
return;
}
diff --git a/llvm/tools/llvm-exegesis/lib/SnippetFile.cpp b/llvm/tools/llvm-exegesis/lib/SnippetFile.cpp
index 97734c529bdc0..706c794f08a9a 100644
--- a/llvm/tools/llvm-exegesis/lib/SnippetFile.cpp
+++ b/llvm/tools/llvm-exegesis/lib/SnippetFile.cpp
@@ -89,7 +89,7 @@ class BenchmarkCodeStreamer : public MCStreamer, public AsmCommentConsumer {
private:
// We only care about instructions, we don't implement this part of the API.
void emitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
- unsigned ByteAlignment) override {}
+ Align ByteAlignment) override {}
bool emitSymbolAttribute(MCSymbol *Symbol, MCSymbolAttr Attribute) override {
return false;
}
diff --git a/llvm/tools/llvm-mca/CodeRegionGenerator.cpp b/llvm/tools/llvm-mca/CodeRegionGenerator.cpp
index b1a2dad925518..b8e10fa69c2dd 100644
--- a/llvm/tools/llvm-mca/CodeRegionGenerator.cpp
+++ b/llvm/tools/llvm-mca/CodeRegionGenerator.cpp
@@ -48,7 +48,7 @@ class MCStreamerWrapper final : public MCStreamer {
}
void emitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
- unsigned ByteAlignment) override {}
+ Align ByteAlignment) override {}
void emitZerofill(MCSection *Section, MCSymbol *Symbol = nullptr,
uint64_t Size = 0, Align ByteAlignment = Align(1),
SMLoc Loc = SMLoc()) override {}
diff --git a/llvm/unittests/CodeGen/TestAsmPrinter.h b/llvm/unittests/CodeGen/TestAsmPrinter.h
index fd2cd37d27c33..372214a55fcfe 100644
--- a/llvm/unittests/CodeGen/TestAsmPrinter.h
+++ b/llvm/unittests/CodeGen/TestAsmPrinter.h
@@ -31,7 +31,7 @@ class MockMCStreamer : public MCStreamer {
MOCK_METHOD2(emitSymbolAttribute,
bool(MCSymbol *Symbol, MCSymbolAttr Attribute));
MOCK_METHOD3(emitCommonSymbol,
- void(MCSymbol *Symbol, uint64_t Size, unsigned ByteAlignment));
+ void(MCSymbol *Symbol, uint64_t Size, Align ByteAlignment));
MOCK_METHOD5(emitZerofill,
void(MCSection *Section, MCSymbol *Symbol, uint64_t Size,
Align ByteAlignment, SMLoc Loc));
More information about the llvm-commits
mailing list