mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-21 18:29:46 +00:00
Optimize the creation of mapping symbols.
No need to create two symbols just to assign one to the other. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240773 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
d4b0d61105
commit
8b8feaae29
@ -156,22 +156,12 @@ private:
|
||||
}
|
||||
|
||||
void EmitMappingSymbol(StringRef Name) {
|
||||
MCSymbol *Start = getContext().createTempSymbol();
|
||||
EmitLabel(Start);
|
||||
|
||||
auto *Symbol = cast<MCSymbolELF>(getContext().getOrCreateSymbol(
|
||||
Name + "." + Twine(MappingSymbolCounter++)));
|
||||
|
||||
getAssembler().registerSymbol(*Symbol);
|
||||
EmitLabel(Symbol);
|
||||
Symbol->setType(ELF::STT_NOTYPE);
|
||||
Symbol->setBinding(ELF::STB_LOCAL);
|
||||
Symbol->setExternal(false);
|
||||
auto Sec = getCurrentSection().first;
|
||||
assert(Sec && "need a section");
|
||||
Symbol->setSection(*Sec);
|
||||
|
||||
const MCExpr *Value = MCSymbolRefExpr::create(Start, getContext());
|
||||
Symbol->setVariableValue(Value);
|
||||
}
|
||||
|
||||
int64_t MappingSymbolCounter;
|
||||
|
@ -563,20 +563,13 @@ private:
|
||||
}
|
||||
|
||||
void EmitMappingSymbol(StringRef Name) {
|
||||
MCSymbol *Start = getContext().createTempSymbol();
|
||||
EmitLabel(Start);
|
||||
|
||||
auto *Symbol = cast<MCSymbolELF>(getContext().getOrCreateSymbol(
|
||||
Name + "." + Twine(MappingSymbolCounter++)));
|
||||
EmitLabel(Symbol);
|
||||
|
||||
getAssembler().registerSymbol(*Symbol);
|
||||
Symbol->setType(ELF::STT_NOTYPE);
|
||||
Symbol->setBinding(ELF::STB_LOCAL);
|
||||
Symbol->setExternal(false);
|
||||
AssignSection(Symbol, getCurrentSection().first);
|
||||
|
||||
const MCExpr *Value = MCSymbolRefExpr::create(Start, getContext());
|
||||
Symbol->setVariableValue(Value);
|
||||
}
|
||||
|
||||
void EmitThumbFunc(MCSymbol *Func) override {
|
||||
|
Loading…
Reference in New Issue
Block a user