mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-21 08:17:40 +00:00
Use createTempSymbol to avoid collisions instead of an ad hoc method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232483 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -321,17 +321,9 @@ bool PPCAsmPrinter::PrintAsmMemoryOperand(const MachineInstr *MI, unsigned OpNo,
|
||||
/// exists for it. If not, create one. Then return a symbol that references
|
||||
/// the TOC entry.
|
||||
MCSymbol *PPCAsmPrinter::lookUpOrCreateTOCEntry(MCSymbol *Sym) {
|
||||
const DataLayout *DL = TM.getDataLayout();
|
||||
MCSymbol *&TOCEntry = TOC[Sym];
|
||||
|
||||
// To avoid name clash check if the name already exists.
|
||||
while (!TOCEntry) {
|
||||
if (OutContext.LookupSymbol(Twine(DL->getPrivateGlobalPrefix()) +
|
||||
"C" + Twine(TOCLabelID++)) == nullptr) {
|
||||
TOCEntry = GetTempSymbol("C", TOCLabelID);
|
||||
}
|
||||
}
|
||||
|
||||
if (!TOCEntry)
|
||||
TOCEntry = createTempSymbol("C", TOCLabelID++);
|
||||
return TOCEntry;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user