aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/MC/MCXCOFFStreamer.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2023-02-11 12:38:04 +0000
committerDimitry Andric <dim@FreeBSD.org>2023-02-11 12:38:11 +0000
commite3b557809604d036af6e00c60f012c2025b59a5e (patch)
tree8a11ba2269a3b669601e2fd41145b174008f4da8 /llvm/lib/MC/MCXCOFFStreamer.cpp
parent08e8dd7b9db7bb4a9de26d44c1cbfd24e869c014 (diff)
downloadsrc-e3b557809604d036af6e00c60f012c2025b59a5e.tar.gz
src-e3b557809604d036af6e00c60f012c2025b59a5e.zip
Vendor import of llvm-project main llvmorg-16-init-18548-gb0daacf58f41,vendor/llvm-project/llvmorg-16-init-18548-gb0daacf58f41
the last commit before the upstream release/17.x branch was created.
Diffstat (limited to 'llvm/lib/MC/MCXCOFFStreamer.cpp')
-rw-r--r--llvm/lib/MC/MCXCOFFStreamer.cpp23
1 files changed, 18 insertions, 5 deletions
diff --git a/llvm/lib/MC/MCXCOFFStreamer.cpp b/llvm/lib/MC/MCXCOFFStreamer.cpp
index a4a42279d6e2..25a678c68416 100644
--- a/llvm/lib/MC/MCXCOFFStreamer.cpp
+++ b/llvm/lib/MC/MCXCOFFStreamer.cpp
@@ -37,6 +37,10 @@ bool MCXCOFFStreamer::emitSymbolAttribute(MCSymbol *Sym,
getAssembler().registerSymbol(*Symbol);
switch (Attribute) {
+ // XCOFF doesn't support the cold feature.
+ case MCSA_Cold:
+ return false;
+
case MCSA_Global:
case MCSA_Extern:
Symbol->setStorageClass(XCOFF::C_EXT);
@@ -77,8 +81,17 @@ void MCXCOFFStreamer::emitXCOFFSymbolLinkageWithVisibility(
emitSymbolAttribute(Symbol, Visibility);
}
+void MCXCOFFStreamer::emitXCOFFExceptDirective(const MCSymbol *Symbol,
+ const MCSymbol *Trap,
+ unsigned Lang, unsigned Reason,
+ unsigned FunctionSize,
+ bool hasDebug) {
+ getAssembler().getWriter().addExceptionEntry(Symbol, Trap, Lang, Reason,
+ FunctionSize, hasDebug);
+}
+
void MCXCOFFStreamer::emitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
- unsigned ByteAlignment) {
+ Align ByteAlignment) {
getAssembler().registerSymbol(*Symbol);
Symbol->setExternal(cast<MCSymbolXCOFF>(Symbol)->getStorageClass() !=
XCOFF::C_HIDEXT);
@@ -87,7 +100,7 @@ void MCXCOFFStreamer::emitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
// 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(ByteAlignment);
@@ -95,7 +108,7 @@ void MCXCOFFStreamer::emitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
}
void MCXCOFFStreamer::emitZerofill(MCSection *Section, MCSymbol *Symbol,
- uint64_t Size, unsigned ByteAlignment,
+ uint64_t Size, Align ByteAlignment,
SMLoc Loc) {
report_fatal_error("Zero fill not implemented for XCOFF.");
}
@@ -136,6 +149,6 @@ MCStreamer *llvm::createXCOFFStreamer(MCContext &Context,
void MCXCOFFStreamer::emitXCOFFLocalCommonSymbol(MCSymbol *LabelSym,
uint64_t Size,
MCSymbol *CsectSym,
- unsigned ByteAlignment) {
- emitCommonSymbol(CsectSym, Size, ByteAlignment);
+ Align Alignment) {
+ emitCommonSymbol(CsectSym, Size, Alignment);
}