aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/MC/MCMachOStreamer.cpp
diff options
context:
space:
mode:
authorFangrui Song <i@maskray.me>2024-07-03 17:25:10 -0700
committerFangrui Song <i@maskray.me>2024-07-03 17:25:10 -0700
commit94471e73fe3a6e5ddf700ed79941b1f1c8d2127b (patch)
tree80f3bf2c5e52e25d0e6ed747b29f43a64cdc497b /llvm/lib/MC/MCMachOStreamer.cpp
parent665efe896746b1dd138773e6e4d300ec97de27c2 (diff)
downloadllvm-94471e73fe3a6e5ddf700ed79941b1f1c8d2127b.zip
llvm-94471e73fe3a6e5ddf700ed79941b1f1c8d2127b.tar.gz
llvm-94471e73fe3a6e5ddf700ed79941b1f1c8d2127b.tar.bz2
[MC] Move MCAssembler::isSymbolLinkerVisible to MCSymbolMachO
Diffstat (limited to 'llvm/lib/MC/MCMachOStreamer.cpp')
-rw-r--r--llvm/lib/MC/MCMachOStreamer.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/MC/MCMachOStreamer.cpp b/llvm/lib/MC/MCMachOStreamer.cpp
index 0b34d87..6eb9f44 100644
--- a/llvm/lib/MC/MCMachOStreamer.cpp
+++ b/llvm/lib/MC/MCMachOStreamer.cpp
@@ -198,7 +198,7 @@ void MCMachOStreamer::emitEHSymAttributes(const MCSymbol *Symbol,
void MCMachOStreamer::emitLabel(MCSymbol *Symbol, SMLoc Loc) {
// We have to create a new fragment if this is an atom defining symbol,
// fragments cannot span atoms.
- if (getAssembler().isSymbolLinkerVisible(*Symbol))
+ if (cast<MCSymbolMachO>(Symbol)->isSymbolLinkerVisible())
insert(getContext().allocFragment<MCDataFragment>());
MCObjectStreamer::emitLabel(Symbol, Loc);
@@ -507,8 +507,9 @@ void MCMachOStreamer::finishImpl() {
// defining symbols.
DenseMap<const MCFragment *, const MCSymbol *> DefiningSymbolMap;
for (const MCSymbol &Symbol : getAssembler().symbols()) {
- if (getAssembler().isSymbolLinkerVisible(Symbol) && Symbol.isInSection() &&
- !Symbol.isVariable() && !cast<MCSymbolMachO>(Symbol).isAltEntry()) {
+ auto &Sym = cast<MCSymbolMachO>(Symbol);
+ if (Sym.isSymbolLinkerVisible() && Sym.isInSection() && !Sym.isVariable() &&
+ !Sym.isAltEntry()) {
// An atom defining symbol should never be internal to a fragment.
assert(Symbol.getOffset() == 0 &&
"Invalid offset in atom defining symbol!");