add a new CreateTempSymbol method, the use case for
authorChris Lattner <sabre@nondot.org>
Sun, 14 Mar 2010 08:23:30 +0000 (08:23 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 14 Mar 2010 08:23:30 +0000 (08:23 +0000)
CreateTempSymbol vs GetOrCreateTemporarySymbol are
completely different.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98486 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/MC/MCContext.h
lib/MC/MCContext.cpp

index b62fefaace6b3e40c8cc12384e024567ea1714e9..c233fd2246f2279a068dcfa9aa6435eb23fb8bee 100644 (file)
@@ -55,6 +55,10 @@ namespace llvm {
 
     /// @name Symbol Managment
     /// @{
+    
+    /// CreateTempSymbol - Create and return a new assembler temporary symbol
+    /// with a unique but unspecified name.
+    MCSymbol *CreateTempSymbol();
 
     /// GetOrCreateSymbol - Lookup the symbol inside with the specified
     /// @p Name.  If it exists, return it.  If not, create a forward
index 78d6a77dfb8aecbe203c10c28a60f2632420e945..ae9a30a95f4815cc8e09977e865747b28d6b9583 100644 (file)
@@ -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++));