/// @{
bool registerSection(MCSection &Section);
-
- void registerSymbol(const MCSymbol &Symbol, bool *Created = nullptr);
+ bool registerSymbol(const MCSymbol &Symbol);
MutableArrayRef<std::pair<std::string, size_t>> getFileNames() {
return FileNames;
}
}
-void MCAssembler::registerSymbol(const MCSymbol &Symbol, bool *Created) {
- bool New = !Symbol.isRegistered();
- if (Created)
- *Created = New;
- if (New) {
+bool MCAssembler::registerSymbol(const MCSymbol &Symbol) {
+ bool Changed = !Symbol.isRegistered();
+ if (Changed) {
Symbol.setIsRegistered(true);
Symbols.push_back(&Symbol);
}
+ return Changed;
}
void MCAssembler::writeFragmentPadding(raw_ostream &OS,
void MCMachOStreamer::finalizeCGProfileEntry(const MCSymbolRefExpr *&SRE) {
const MCSymbol *S = &SRE->getSymbol();
- bool Created;
- getAssembler().registerSymbol(*S, &Created);
- if (Created)
+ if (getAssembler().registerSymbol(*S))
S->setExternal(true);
}
void MCWinCOFFStreamer::finalizeCGProfileEntry(const MCSymbolRefExpr *&SRE) {
const MCSymbol *S = &SRE->getSymbol();
- bool Created;
- getAssembler().registerSymbol(*S, &Created);
- if (Created)
+ if (getAssembler().registerSymbol(*S))
cast<MCSymbolCOFF>(S)->setExternal(true);
}
// Set the symbol type to undefined lazy, but only on construction.
//
// FIXME: Do not hardcode.
- bool Created;
- Asm.registerSymbol(*it->Symbol, &Created);
- if (Created)
+ if (Asm.registerSymbol(*it->Symbol))
cast<MCSymbolMachO>(it->Symbol)->setReferenceTypeUndefinedLazy(true);
}
}