mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-12 05:56:28 +00:00
enhance MCContext::GetOrCreateTemporarySymbol() to create a new symbol
with an arbitrary unique name. llvm-svn: 98294
This commit is contained in:
parent
debc026df2
commit
de47dfab1d
@ -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…
Reference in New Issue
Block a user