diff options
author | Chris Lattner <sabre@nondot.org> | 2010-03-14 08:23:30 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-03-14 08:23:30 +0000 |
commit | 1d72a7661611395a1c4fd3a88a2151921180e510 (patch) | |
tree | 7386725c6ef5b850e70e309eedb4e382406783cd /lib/MC/MCContext.cpp | |
parent | 8d9aaba84e80d40093fa8e1fe452a5ddcb4cc7f7 (diff) |
add a new CreateTempSymbol method, the use case for
CreateTempSymbol vs GetOrCreateTemporarySymbol are
completely different.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98486 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC/MCContext.cpp')
-rw-r--r-- | lib/MC/MCContext.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/MC/MCContext.cpp b/lib/MC/MCContext.cpp index 78d6a77dfb..ae9a30a95f 100644 --- a/lib/MC/MCContext.cpp +++ b/lib/MC/MCContext.cpp @@ -37,9 +37,15 @@ MCSymbol *MCContext::GetOrCreateSymbol(const Twine &Name) { return GetOrCreateSymbol(NameSV.str()); } +MCSymbol *MCContext::CreateTempSymbol() { + return GetOrCreateTemporarySymbol(Twine(MAI.getPrivateGlobalPrefix()) + + "tmp" + Twine(NextUniqueID++)); +} + MCSymbol *MCContext::GetOrCreateTemporarySymbol(StringRef Name) { // If there is no name, create a new anonymous symbol. + // FIXME: Remove this. This form of the method should always take a name. if (Name.empty()) return GetOrCreateTemporarySymbol(Twine(MAI.getPrivateGlobalPrefix()) + "tmp" + Twine(NextUniqueID++)); |