mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-14 02:33:53 +00:00
enhance MCContext::GetOrCreateTemporarySymbol() to create a new symbol
with an arbitrary unique name. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98294 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
c18409aed8
commit
1a5c28f471
@ -8,6 +8,7 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "llvm/MC/MCContext.h"
|
||||
#include "llvm/MC/MCAsmInfo.h"
|
||||
#include "llvm/MC/MCSection.h"
|
||||
#include "llvm/MC/MCSymbol.h"
|
||||
#include "llvm/ADT/SmallString.h"
|
||||
@ -38,6 +39,11 @@ MCSymbol *MCContext::GetOrCreateSymbol(const Twine &Name) {
|
||||
|
||||
|
||||
MCSymbol *MCContext::GetOrCreateTemporarySymbol(StringRef Name) {
|
||||
// If there is no name, create a new anonymous symbol.
|
||||
if (Name.empty())
|
||||
return GetOrCreateTemporarySymbol(Twine(MAI.getPrivateGlobalPrefix()) +
|
||||
"tmp" + Twine(NextUniqueID++));
|
||||
|
||||
// Otherwise create as usual.
|
||||
MCSymbol *&Entry = Symbols[Name];
|
||||
if (Entry) return Entry;
|
||||
|
Loading…
x
Reference in New Issue
Block a user