aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/MC
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/MC')
-rw-r--r--llvm/lib/MC/ELFObjectWriter.cpp5
-rw-r--r--llvm/lib/MC/MCContext.cpp4
-rw-r--r--llvm/lib/MC/MCELFStreamer.cpp4
3 files changed, 6 insertions, 7 deletions
diff --git a/llvm/lib/MC/ELFObjectWriter.cpp b/llvm/lib/MC/ELFObjectWriter.cpp
index 76294ef..8f3814a 100644
--- a/llvm/lib/MC/ELFObjectWriter.cpp
+++ b/llvm/lib/MC/ELFObjectWriter.cpp
@@ -409,8 +409,7 @@ static bool isIFunc(const MCSymbolELF *Symbol) {
void ELFWriter::writeSymbol(SymbolTableWriter &Writer, uint32_t StringIndex,
ELFSymbolData &MSD) {
auto &Symbol = static_cast<const MCSymbolELF &>(*MSD.Symbol);
- const MCSymbolELF *Base =
- cast_or_null<MCSymbolELF>(Asm.getBaseSymbol(Symbol));
+ auto *Base = static_cast<const MCSymbolELF *>(Asm.getBaseSymbol(Symbol));
// This has to be in sync with when computeSymbolTable uses SHN_ABS or
// SHN_COMMON.
@@ -1317,7 +1316,7 @@ void ELFObjectWriter::recordRelocation(const MCFragment &F,
auto &Section = static_cast<const MCSectionELF &>(*F.getParent());
MCContext &Ctx = getContext();
- const auto *SymA = cast_or_null<MCSymbolELF>(Target.getAddSym());
+ auto *SymA = static_cast<const MCSymbolELF *>(Target.getAddSym());
const MCSectionELF *SecA =
(SymA && SymA->isInSection())
? static_cast<const MCSectionELF *>(&SymA->getSection())
diff --git a/llvm/lib/MC/MCContext.cpp b/llvm/lib/MC/MCContext.cpp
index ce5edc5..dc14736 100644
--- a/llvm/lib/MC/MCContext.cpp
+++ b/llvm/lib/MC/MCContext.cpp
@@ -446,7 +446,7 @@ Symbol *MCContext::getOrCreateSectionSymbol(StringRef Section) {
// Use the symbol's index to track if it has been used as a section symbol.
// Set to -1 to catch potential bugs if misused as a symbol index.
if (Sym && Sym->getIndex() != -1u) {
- R = cast<Symbol>(Sym);
+ R = static_cast<Symbol *>(Sym);
} else {
SymEntry.second.Used = true;
R = new (&SymEntry, *this) Symbol(&SymEntry, /*isTemporary=*/false);
@@ -586,7 +586,7 @@ MCContext::createELFRelSection(const Twine &Name, unsigned Type, unsigned Flags,
return createELFSectionImpl(
I->getKey(), Type, Flags, EntrySize, Group, true, true,
- cast<MCSymbolELF>(RelInfoSection->getBeginSymbol()));
+ static_cast<const MCSymbolELF *>(RelInfoSection->getBeginSymbol()));
}
MCSectionELF *MCContext::getELFNamedSection(const Twine &Prefix,
diff --git a/llvm/lib/MC/MCELFStreamer.cpp b/llvm/lib/MC/MCELFStreamer.cpp
index 5ffe17c..275e76e 100644
--- a/llvm/lib/MC/MCELFStreamer.cpp
+++ b/llvm/lib/MC/MCELFStreamer.cpp
@@ -272,8 +272,8 @@ void MCELFStreamer::emitCommonSymbol(MCSymbol *S, uint64_t Size,
" redeclared as different type");
}
- cast<MCSymbolELF>(Symbol)
- ->setSize(MCConstantExpr::create(Size, getContext()));
+ static_cast<MCSymbolELF *>(Symbol)->setSize(
+ MCConstantExpr::create(Size, getContext()));
}
void MCELFStreamer::emitELFSize(MCSymbol *Symbol, const MCExpr *Value) {