fix GetOrCreateTemporarySymbol to require a name, clients
authorChris Lattner <sabre@nondot.org>
Wed, 17 Mar 2010 05:41:18 +0000 (05:41 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 17 Mar 2010 05:41:18 +0000 (05:41 +0000)
should use CreateTempSymbol() if they don't care about the
name.

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

include/llvm/MC/MCContext.h
lib/CodeGen/GCStrategy.cpp
lib/MC/MCContext.cpp
lib/Target/TargetLoweringObjectFile.cpp
lib/Target/X86/AsmPrinter/X86MCInstLower.cpp

index 85114e30995e933308bd2fcf74d02e80f1a5853d..c5814b377eb8a0f4f725372f364c530ff6dd24fc 100644 (file)
@@ -73,9 +73,10 @@ namespace llvm {
     /// one if it does.
     ///
     /// @param Name - The symbol name, for debugging purposes only, temporary
-    /// symbols do not surive assembly. If non-empty the name must be unique
-    /// across all symbols.
-    MCSymbol *GetOrCreateTemporarySymbol(StringRef Name = "");
+    /// symbols do not surive assembly.
+    MCSymbol *GetOrCreateTemporarySymbol(StringRef Name) {
+      return GetOrCreateSymbol(Name, true);
+    }
     MCSymbol *GetOrCreateTemporarySymbol(const Twine &Name);
 
     /// LookupSymbol - Get the symbol for \p Name, or null.
index 1a23be0c7d112da301a98056d1552f62d7deca3a..6d7cc51547d2f8cfdb70a860fd73a4515b85a14c 100644 (file)
@@ -332,7 +332,7 @@ void MachineCodeAnalysis::getAnalysisUsage(AnalysisUsage &AU) const {
 MCSymbol *MachineCodeAnalysis::InsertLabel(MachineBasicBlock &MBB, 
                                            MachineBasicBlock::iterator MI,
                                            DebugLoc DL) const {
-  MCSymbol *Label = MBB.getParent()->getContext().GetOrCreateTemporarySymbol();
+  MCSymbol *Label = MBB.getParent()->getContext().CreateTempSymbol();
   BuildMI(MBB, MI, DL, TII->get(TargetOpcode::GC_LABEL)).addSym(Label);
   return Label;
 }
index 70c89a2333af1ed4e9af47bc967e78f4861d7c10..37e828252602d4d8f73fbf8fab3e6583aef7b7bc 100644 (file)
@@ -49,17 +49,6 @@ MCSymbol *MCContext::CreateTempSymbol() {
                                     "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++));
-  
-  return GetOrCreateSymbol(Name, true);
-}
-
 MCSymbol *MCContext::GetOrCreateTemporarySymbol(const Twine &Name) {
   SmallString<128> NameSV;
   Name.toVector(NameSV);
index a093e2db8b2e7b1f589d7ea2c504b334964e0815..44722b39e311497bc5bc6c8ddf65e9d07399dd0c 100644 (file)
@@ -317,7 +317,7 @@ getExprForDwarfReference(const MCSymbol *Sym, Mangler *Mang,
   case dwarf::DW_EH_PE_pcrel: {
     // Emit a label to the streamer for the current position.  This gives us
     // .-foo addressing.
-    MCSymbol *PCSym = getContext().GetOrCreateTemporarySymbol();
+    MCSymbol *PCSym = getContext().CreateTempSymbol();
     Streamer.EmitLabel(PCSym);
     const MCExpr *PC = MCSymbolRefExpr::Create(PCSym, getContext());
     return MCBinaryExpr::CreateSub(Res, PC, getContext());
index cbfc57a0ab743171c33e325ca14d1a6a5b608280..7d29d97ce0ee1edb4c366c252caa76e2a7c2ef84 100644 (file)
@@ -427,7 +427,7 @@ void X86AsmPrinter::EmitInstruction(const MachineInstr *MI) {
     //   MYGLOBAL + (. - PICBASE)
     // However, we can't generate a ".", so just emit a new label here and refer
     // to it.
-    MCSymbol *DotSym = OutContext.GetOrCreateTemporarySymbol();
+    MCSymbol *DotSym = OutContext.CreateTempSymbol();
     OutStreamer.EmitLabel(DotSym);
     
     // Now that we have emitted the label, lower the complex operand expression.