aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-03-17 05:41:18 +0000
committerChris Lattner <sabre@nondot.org>2010-03-17 05:41:18 +0000
commit77e76940269b1bed36bc31ee5139b5c90fd13836 (patch)
tree80c6e778d60ce3dcd0585bcbd3cccc9559b7ed3d
parentc66bfef33da9cd47ec5d00d7000bc433462012e3 (diff)
fix GetOrCreateTemporarySymbol to require a name, clients
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
-rw-r--r--include/llvm/MC/MCContext.h7
-rw-r--r--lib/CodeGen/GCStrategy.cpp2
-rw-r--r--lib/MC/MCContext.cpp11
-rw-r--r--lib/Target/TargetLoweringObjectFile.cpp2
-rw-r--r--lib/Target/X86/AsmPrinter/X86MCInstLower.cpp2
5 files changed, 7 insertions, 17 deletions
diff --git a/include/llvm/MC/MCContext.h b/include/llvm/MC/MCContext.h
index 85114e3099..c5814b377e 100644
--- a/include/llvm/MC/MCContext.h
+++ b/include/llvm/MC/MCContext.h
@@ -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.
diff --git a/lib/CodeGen/GCStrategy.cpp b/lib/CodeGen/GCStrategy.cpp
index 1a23be0c7d..6d7cc51547 100644
--- a/lib/CodeGen/GCStrategy.cpp
+++ b/lib/CodeGen/GCStrategy.cpp
@@ -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;
}
diff --git a/lib/MC/MCContext.cpp b/lib/MC/MCContext.cpp
index 70c89a2333..37e8282526 100644
--- a/lib/MC/MCContext.cpp
+++ b/lib/MC/MCContext.cpp
@@ -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);
diff --git a/lib/Target/TargetLoweringObjectFile.cpp b/lib/Target/TargetLoweringObjectFile.cpp
index a093e2db8b..44722b39e3 100644
--- a/lib/Target/TargetLoweringObjectFile.cpp
+++ b/lib/Target/TargetLoweringObjectFile.cpp
@@ -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());
diff --git a/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp b/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp
index cbfc57a0ab..7d29d97ce0 100644
--- a/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp
+++ b/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp
@@ -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.