aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/MC/MCDwarf.cpp
diff options
context:
space:
mode:
authorFangrui Song <i@maskray.me>2024-08-15 13:29:47 -0700
committerFangrui Song <i@maskray.me>2024-08-15 13:29:47 -0700
commitc19326cb84e871e1dd77408c2911c7d1651ba34b (patch)
treeb69737cdc49e1651e658bf6671da598c8c23da30 /llvm/lib/MC/MCDwarf.cpp
parent6ec169d3501124770c3301dab8156c4640346c40 (diff)
downloadllvm-c19326cb84e871e1dd77408c2911c7d1651ba34b.zip
llvm-c19326cb84e871e1dd77408c2911c7d1651ba34b.tar.gz
llvm-c19326cb84e871e1dd77408c2911c7d1651ba34b.tar.bz2
[MC] Replace HasAggressiveSymbolFolding with SetDirectiveSuppressesReloc. NFC
The variable and its comment could lead to confusion (AMDGPU unnecessarily set it).
Diffstat (limited to 'llvm/lib/MC/MCDwarf.cpp')
-rw-r--r--llvm/lib/MC/MCDwarf.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/MC/MCDwarf.cpp b/llvm/lib/MC/MCDwarf.cpp
index 1297dc3..2db59f8 100644
--- a/llvm/lib/MC/MCDwarf.cpp
+++ b/llvm/lib/MC/MCDwarf.cpp
@@ -320,9 +320,10 @@ MCDwarfLineTableHeader::Emit(MCStreamer *MCOS, MCDwarfLineTableParams Params,
static const MCExpr *forceExpAbs(MCStreamer &OS, const MCExpr* Expr) {
MCContext &Context = OS.getContext();
assert(!isa<MCSymbolRefExpr>(Expr));
- if (Context.getAsmInfo()->hasAggressiveSymbolFolding())
+ if (!Context.getAsmInfo()->doesSetDirectiveSuppressReloc())
return Expr;
+ // On Mach-O, try to avoid a relocation by using a set directive.
MCSymbol *ABS = Context.createTempSymbol();
OS.emitAssignment(ABS, Expr);
return MCSymbolRefExpr::create(ABS, Context);