MCSymbol: Avoid isExported/setExported
The next change will move it to MCSymbol{COFF,MachO,Wasm} to make it clear that other object file formats (e.g. ELF) do not use this field.
This commit is contained in:
parent
1def457228
commit
04a3dd5a19
@ -1864,11 +1864,13 @@ bool AsmParser::parseStatement(ParseStatementInfo &Info,
|
||||
Lex();
|
||||
}
|
||||
|
||||
if (MAI.hasSubsectionsViaSymbols() && CFIStartProcLoc &&
|
||||
Sym->isExternal() && !static_cast<MCSymbolMachO *>(Sym)->isAltEntry())
|
||||
return Error(StartTokLoc, "non-private labels cannot appear between "
|
||||
".cfi_startproc / .cfi_endproc pairs") &&
|
||||
Error(*CFIStartProcLoc, "previous .cfi_startproc was here");
|
||||
if (MAI.isMachO() && CFIStartProcLoc) {
|
||||
auto *SymM = static_cast<MCSymbolMachO *>(Sym);
|
||||
if (SymM->isExternal() && !SymM->isAltEntry())
|
||||
return Error(StartTokLoc, "non-private labels cannot appear between "
|
||||
".cfi_startproc / .cfi_endproc pairs") &&
|
||||
Error(*CFIStartProcLoc, "previous .cfi_startproc was here");
|
||||
}
|
||||
|
||||
if (discardLTOSymbol(IDVal))
|
||||
return false;
|
||||
|
@ -39,7 +39,7 @@
|
||||
#include "llvm/MC/MCSection.h"
|
||||
#include "llvm/MC/MCStreamer.h"
|
||||
#include "llvm/MC/MCSubtargetInfo.h"
|
||||
#include "llvm/MC/MCSymbol.h"
|
||||
#include "llvm/MC/MCSymbolCOFF.h"
|
||||
#include "llvm/MC/MCTargetOptions.h"
|
||||
#include "llvm/Support/Casting.h"
|
||||
#include "llvm/Support/CommandLine.h"
|
||||
@ -3009,8 +3009,8 @@ bool MasmParser::parseDirectiveEquate(StringRef IDVal, StringRef Name,
|
||||
return false;
|
||||
}
|
||||
|
||||
MCSymbol *Sym = getContext().getOrCreateSymbol(Var.Name);
|
||||
|
||||
auto *Sym =
|
||||
static_cast<MCSymbolCOFF *>(getContext().getOrCreateSymbol(Var.Name));
|
||||
const MCConstantExpr *PrevValue =
|
||||
Sym->isVariable()
|
||||
? dyn_cast_or_null<MCConstantExpr>(Sym->getVariableValue())
|
||||
@ -4521,7 +4521,8 @@ bool MasmParser::parseDirectiveExtern() {
|
||||
KnownType[Name.lower()] = Type;
|
||||
}
|
||||
|
||||
MCSymbol *Sym = getContext().getOrCreateSymbol(Name);
|
||||
auto *Sym =
|
||||
static_cast<MCSymbolCOFF *>(getContext().getOrCreateSymbol(Name));
|
||||
Sym->setExternal(true);
|
||||
getStreamer().emitSymbolAttribute(Sym, MCSA_Extern);
|
||||
|
||||
|
@ -1561,7 +1561,7 @@ uint64_t WasmObjectWriter::writeOneObject(MCAssembler &Asm,
|
||||
<< toString(WS.getType().value_or(wasm::WASM_SYMBOL_TYPE_DATA))
|
||||
<< " '" << S << "'"
|
||||
<< " isDefined=" << S.isDefined() << " isExternal="
|
||||
<< S.isExternal() << " isTemporary=" << S.isTemporary()
|
||||
<< WS.isExternal() << " isTemporary=" << S.isTemporary()
|
||||
<< " isWeak=" << WS.isWeak() << " isHidden=" << WS.isHidden()
|
||||
<< " isVariable=" << WS.isVariable() << "\n");
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user