aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/MC/MCXCOFFStreamer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/MC/MCXCOFFStreamer.cpp')
-rw-r--r--llvm/lib/MC/MCXCOFFStreamer.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/llvm/lib/MC/MCXCOFFStreamer.cpp b/llvm/lib/MC/MCXCOFFStreamer.cpp
index 26f45ce..a0e3dba 100644
--- a/llvm/lib/MC/MCXCOFFStreamer.cpp
+++ b/llvm/lib/MC/MCXCOFFStreamer.cpp
@@ -52,7 +52,7 @@ void MCXCOFFStreamer::changeSection(MCSection *Section, uint32_t Subsection) {
bool MCXCOFFStreamer::emitSymbolAttribute(MCSymbol *Sym,
MCSymbolAttr Attribute) {
- auto *Symbol = cast<MCSymbolXCOFF>(Sym);
+ auto *Symbol = static_cast<MCSymbolXCOFF *>(Sym);
getAssembler().registerSymbol(*Symbol);
switch (Attribute) {
@@ -109,7 +109,7 @@ void MCXCOFFStreamer::emitXCOFFRefDirective(const MCSymbol *Symbol) {
void MCXCOFFStreamer::emitXCOFFRenameDirective(const MCSymbol *Name,
StringRef Rename) {
- const MCSymbolXCOFF *Symbol = cast<const MCSymbolXCOFF>(Name);
+ auto *Symbol = static_cast<const MCSymbolXCOFF *>(Name);
if (!Symbol->hasRename())
report_fatal_error("Only explicit .rename is supported for XCOFF.");
}
@@ -129,15 +129,14 @@ void MCXCOFFStreamer::emitXCOFFCInfoSym(StringRef Name, StringRef Metadata) {
void MCXCOFFStreamer::emitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
Align ByteAlignment) {
+ auto *Sym = static_cast<MCSymbolXCOFF *>(Symbol);
getAssembler().registerSymbol(*Symbol);
- Symbol->setExternal(cast<MCSymbolXCOFF>(Symbol)->getStorageClass() !=
- XCOFF::C_HIDEXT);
+ Symbol->setExternal(Sym->getStorageClass() != XCOFF::C_HIDEXT);
Symbol->setCommon(Size, ByteAlignment);
// Default csect align is 4, but common symbols have explicit alignment values
// and we should honor it.
- cast<MCSymbolXCOFF>(Symbol)->getRepresentedCsect()->setAlignment(
- ByteAlignment);
+ Sym->getRepresentedCsect()->setAlignment(ByteAlignment);
// Emit the alignment and storage for the variable to the section.
emitValueToAlignment(ByteAlignment);