MCSymbol: Remove setUndefined
The name is misleading, as setting Fragment to nullptr does not necessarily make it undefined - common and equated symbols have a nullptr fragment as well.
This commit is contained in:
parent
bce14c69db
commit
34c7b7ccae
@ -2517,7 +2517,7 @@ BinaryContext::calculateEmittedSize(BinaryFunction &BF, bool FixBranches) {
|
||||
// Clean-up the effect of the code emission.
|
||||
for (const MCSymbol &Symbol : Assembler.symbols()) {
|
||||
MCSymbol *MutableSymbol = const_cast<MCSymbol *>(&Symbol);
|
||||
MutableSymbol->setUndefined();
|
||||
MutableSymbol->setFragment(nullptr);
|
||||
MutableSymbol->setIsRegistered(false);
|
||||
}
|
||||
|
||||
|
@ -662,7 +662,7 @@ Error CleanMCState::runOnFunctions(BinaryContext &BC) {
|
||||
if (S->isDefined()) {
|
||||
LLVM_DEBUG(dbgs() << "BOLT-DEBUG: Symbol \"" << S->getName()
|
||||
<< "\" is already defined\n");
|
||||
const_cast<MCSymbol *>(S)->setUndefined();
|
||||
const_cast<MCSymbol *>(S)->setFragment(nullptr);
|
||||
}
|
||||
if (S->isRegistered()) {
|
||||
LLVM_DEBUG(dbgs() << "BOLT-DEBUG: Symbol \"" << S->getName()
|
||||
|
@ -215,7 +215,7 @@ public:
|
||||
Value = nullptr;
|
||||
kind = Kind::Regular;
|
||||
}
|
||||
setUndefined();
|
||||
Fragment = nullptr;
|
||||
IsRedefinable = false;
|
||||
}
|
||||
}
|
||||
@ -259,9 +259,6 @@ public:
|
||||
Fragment = F;
|
||||
}
|
||||
|
||||
/// Mark the symbol as undefined.
|
||||
void setUndefined() { Fragment = nullptr; }
|
||||
|
||||
/// @}
|
||||
/// \name Variable Symbols
|
||||
/// @{
|
||||
|
@ -53,7 +53,7 @@ void MCSymbol::setVariableValue(const MCExpr *Value) {
|
||||
"Cannot equate a common symbol");
|
||||
this->Value = Value;
|
||||
kind = Kind::Equated;
|
||||
setUndefined();
|
||||
Fragment = nullptr;
|
||||
}
|
||||
|
||||
void MCSymbol::print(raw_ostream &OS, const MCAsmInfo *MAI) const {
|
||||
|
@ -220,7 +220,6 @@ static MCSymbolWasm *getOrCreateFunctionTableSymbol(MCContext &Ctx,
|
||||
Sym = static_cast<MCSymbolWasm *>(Ctx.getOrCreateSymbol(Name));
|
||||
Sym->setFunctionTable(Is64);
|
||||
// The default function table is synthesized by the linker.
|
||||
Sym->setUndefined();
|
||||
}
|
||||
return Sym;
|
||||
}
|
||||
|
@ -113,7 +113,6 @@ MCSymbolWasm *WebAssembly::getOrCreateFunctionTableSymbol(
|
||||
Sym = static_cast<MCSymbolWasm *>(Ctx.getOrCreateSymbol(Name));
|
||||
Sym->setFunctionTable(is64);
|
||||
// The default function table is synthesized by the linker.
|
||||
Sym->setUndefined();
|
||||
}
|
||||
// MVP object files can't have symtab entries for tables.
|
||||
if (!(Subtarget && Subtarget->hasCallIndirectOverlong()))
|
||||
|
Loading…
x
Reference in New Issue
Block a user