git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238707
91177308-0d34-0410-b5e6-
96231b3b80d8
- bool hasSymbolData(const MCSymbol &Symbol) const { return Symbol.hasData(); }
-
void registerSymbol(const MCSymbol &Symbol, bool *Created = nullptr) {
void registerSymbol(const MCSymbol &Symbol, bool *Created = nullptr) {
+ bool New = !Symbol.hasData();
- *Created = !hasSymbolData(Symbol);
- if (!hasSymbolData(Symbol)) {
+ *Created = New;
+ if (New) {
Symbol.initializeData();
Symbols.push_back(&Symbol);
}
Symbol.initializeData();
Symbols.push_back(&Symbol);
}
const MCSymbol *Lo,
unsigned Size) {
// Must have symbol data.
const MCSymbol *Lo,
unsigned Size) {
// Must have symbol data.
- if (!Assembler->hasSymbolData(*Hi) || !Assembler->hasSymbolData(*Lo))
+ if (!Hi->hasData() || !Lo->hasData())
return false;
// Must both be assigned to the same (valid) fragment.
return false;
// Must both be assigned to the same (valid) fragment.
const MCSymbol &Symbol = Target.getSymA()->getSymbol();
const MCSymbol &A = Symbol;
const MCSymbol &Symbol = Target.getSymA()->getSymbol();
const MCSymbol &A = Symbol;
- if (!Asm.hasSymbolData(A))
Asm.getContext().reportFatalError(Fixup.getLoc(),
Twine("symbol '") + A.getName() +
"' can not be undefined");
Asm.getContext().reportFatalError(Fixup.getLoc(),
Twine("symbol '") + A.getName() +
"' can not be undefined");