summaryrefslogtreecommitdiffstats
path: root/contrib/llvm/lib/MC/WinCOFFStreamer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm/lib/MC/WinCOFFStreamer.cpp')
-rw-r--r--contrib/llvm/lib/MC/WinCOFFStreamer.cpp34
1 files changed, 14 insertions, 20 deletions
diff --git a/contrib/llvm/lib/MC/WinCOFFStreamer.cpp b/contrib/llvm/lib/MC/WinCOFFStreamer.cpp
index a38b1a4..5c6407e 100644
--- a/contrib/llvm/lib/MC/WinCOFFStreamer.cpp
+++ b/contrib/llvm/lib/MC/WinCOFFStreamer.cpp
@@ -75,7 +75,8 @@ void MCWinCOFFStreamer::InitSections(bool NoExecStack) {
SwitchSection(getContext().getObjectFileInfo()->getTextSection());
}
-void MCWinCOFFStreamer::EmitLabel(MCSymbol *Symbol) {
+void MCWinCOFFStreamer::EmitLabel(MCSymbol *S) {
+ auto *Symbol = cast<MCSymbolCOFF>(S);
assert(Symbol->isUndefined() && "Cannot define a symbol twice!");
MCObjectStreamer::EmitLabel(Symbol);
}
@@ -88,25 +89,23 @@ void MCWinCOFFStreamer::EmitThumbFunc(MCSymbol *Func) {
llvm_unreachable("not implemented");
}
-bool MCWinCOFFStreamer::EmitSymbolAttribute(MCSymbol *Symbol,
+bool MCWinCOFFStreamer::EmitSymbolAttribute(MCSymbol *S,
MCSymbolAttr Attribute) {
- assert(Symbol && "Symbol must be non-null!");
- assert((!Symbol->isInSection() ||
- Symbol->getSection().getVariant() == MCSection::SV_COFF) &&
- "Got non-COFF section in the COFF backend!");
-
+ auto *Symbol = cast<MCSymbolCOFF>(S);
getAssembler().registerSymbol(*Symbol);
switch (Attribute) {
default: return false;
case MCSA_WeakReference:
case MCSA_Weak:
- cast<MCSymbolCOFF>(Symbol)->setIsWeakExternal();
+ Symbol->setIsWeakExternal();
Symbol->setExternal(true);
break;
case MCSA_Global:
Symbol->setExternal(true);
break;
+ case MCSA_AltEntry:
+ llvm_unreachable("COFF doesn't support the .alt_entry attribute");
}
return true;
@@ -116,11 +115,8 @@ void MCWinCOFFStreamer::EmitSymbolDesc(MCSymbol *Symbol, unsigned DescValue) {
llvm_unreachable("not implemented");
}
-void MCWinCOFFStreamer::BeginCOFFSymbolDef(MCSymbol const *Symbol) {
- assert((!Symbol->isInSection() ||
- Symbol->getSection().getVariant() == MCSection::SV_COFF) &&
- "Got non-COFF section in the COFF backend!");
-
+void MCWinCOFFStreamer::BeginCOFFSymbolDef(MCSymbol const *S) {
+ auto *Symbol = cast<MCSymbolCOFF>(S);
if (CurSymbol)
Error("starting a new symbol definition without completing the "
"previous one");
@@ -207,11 +203,9 @@ void MCWinCOFFStreamer::EmitCOFFSecRel32(MCSymbol const *Symbol) {
DF->getContents().resize(DF->getContents().size() + 4, 0);
}
-void MCWinCOFFStreamer::EmitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
+void MCWinCOFFStreamer::EmitCommonSymbol(MCSymbol *S, uint64_t Size,
unsigned ByteAlignment) {
- assert((!Symbol->isInSection() ||
- Symbol->getSection().getVariant() == MCSection::SV_COFF) &&
- "Got non-COFF section in the COFF backend!");
+ auto *Symbol = cast<MCSymbolCOFF>(S);
const Triple &T = getContext().getObjectFileInfo()->getTargetTriple();
if (T.isKnownWindowsMSVCEnvironment()) {
@@ -241,9 +235,9 @@ void MCWinCOFFStreamer::EmitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
}
}
-void MCWinCOFFStreamer::EmitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size,
+void MCWinCOFFStreamer::EmitLocalCommonSymbol(MCSymbol *S, uint64_t Size,
unsigned ByteAlignment) {
- assert(!Symbol->isInSection() && "Symbol must not already have a section!");
+ auto *Symbol = cast<MCSymbolCOFF>(S);
MCSection *Section = getContext().getObjectFileInfo()->getBSSSection();
getAssembler().registerSection(*Section);
@@ -258,7 +252,7 @@ void MCWinCOFFStreamer::EmitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size,
ByteAlignment, Section);
MCFillFragment *Fragment = new MCFillFragment(
- /*Value=*/0, /*ValueSize=*/0, Size, Section);
+ /*Value=*/0, Size, Section);
Symbol->setFragment(Fragment);
}
OpenPOWER on IntegriCloud