aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-03-14 08:36:50 +0000
committerChris Lattner <sabre@nondot.org>2010-03-14 08:36:50 +0000
commit63d7836267298f5b6cde43f0a89acbabfc109f48 (patch)
treecfca325f2bbfbecb0f5bc5fc7f1996e58025416b /lib/CodeGen
parent6b4205aa44094f96115be72dd23aaf47a0257d2f (diff)
downloadexternal_llvm-63d7836267298f5b6cde43f0a89acbabfc109f48.tar.gz
external_llvm-63d7836267298f5b6cde43f0a89acbabfc109f48.tar.bz2
external_llvm-63d7836267298f5b6cde43f0a89acbabfc109f48.zip
get MMI out of the label uniquing business, just go to MCContext
to get unique assembler temporary labels. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98489 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfDebug.cpp4
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfException.cpp1
-rw-r--r--lib/CodeGen/MachineModuleInfo.cpp11
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp4
4 files changed, 6 insertions, 14 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index 37769421b4..41d24bb37d 100644
--- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -1972,7 +1972,7 @@ void DwarfDebug::endScope(const MachineInstr *MI) {
if (I == DbgScopeEndMap.end())
return;
- MCSymbol *Label = MMI->getLabelSym(MMI->NextLabelID());
+ MCSymbol *Label = MMI->getContext().CreateTempSymbol();
Asm->OutStreamer.EmitLabel(Label);
SmallVector<DbgScope*, 2> &SD = I->second;
@@ -2220,7 +2220,7 @@ MCSymbol *DwarfDebug::recordSourceLine(unsigned Line, unsigned Col, MDNode *S) {
assert(0 && "Unexpected scope info");
unsigned Src = GetOrCreateSourceID(Dir, Fn);
- MCSymbol *Label = MMI->getLabelSym(MMI->NextLabelID());
+ MCSymbol *Label = MMI->getContext().CreateTempSymbol();
Lines.push_back(SrcLineInfo(Line, Col, Src, Label));
if (TimePassesIsEnabled)
diff --git a/lib/CodeGen/AsmPrinter/DwarfException.cpp b/lib/CodeGen/AsmPrinter/DwarfException.cpp
index f7b6bc0312..4946b4c3c2 100644
--- a/lib/CodeGen/AsmPrinter/DwarfException.cpp
+++ b/lib/CodeGen/AsmPrinter/DwarfException.cpp
@@ -471,7 +471,6 @@ ComputeCallSiteTable(SmallVectorImpl<CallSiteEntry> &CallSites,
if (!MI->isLabel()) {
if (MI->getDesc().isCall())
SawPotentiallyThrowing |= !CallToNoUnwindFunction(MI);
-
continue;
}
diff --git a/lib/CodeGen/MachineModuleInfo.cpp b/lib/CodeGen/MachineModuleInfo.cpp
index e7373711cb..fdbda8f715 100644
--- a/lib/CodeGen/MachineModuleInfo.cpp
+++ b/lib/CodeGen/MachineModuleInfo.cpp
@@ -22,7 +22,6 @@
#include "llvm/Target/TargetInstrInfo.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Target/TargetOptions.h"
-#include "llvm/MC/MCAsmInfo.h"
#include "llvm/MC/MCSymbol.h"
#include "llvm/Support/Dwarf.h"
#include "llvm/Support/ErrorHandling.h"
@@ -41,7 +40,7 @@ MachineModuleInfoImpl::~MachineModuleInfoImpl() {}
MachineModuleInfo::MachineModuleInfo(const MCAsmInfo &MAI)
: ImmutablePass(&ID), Context(MAI),
- ObjFileMMI(0), NextLabelIDToReturn(1),
+ ObjFileMMI(0),
CurCallSite(0), CallsEHReturn(0), CallsUnwindInit(0), DbgInfoAvailable(false){
// Always emit some info, by default "no personality" info.
Personalities.push_back(NULL);
@@ -70,12 +69,6 @@ bool MachineModuleInfo::doFinalization() {
return false;
}
-/// getLabelSym - Turn a label ID into a symbol.
-MCSymbol *MachineModuleInfo::getLabelSym(unsigned ID) {
- return Context.GetOrCreateTemporarySymbol
- (Twine(Context.getAsmInfo().getPrivateGlobalPrefix()) + "label" +Twine(ID));
-}
-
/// EndFunction - Discard function meta information.
///
void MachineModuleInfo::EndFunction() {
@@ -140,7 +133,7 @@ void MachineModuleInfo::addInvoke(MachineBasicBlock *LandingPad,
/// addLandingPad - Provide the label of a try LandingPad block.
///
MCSymbol *MachineModuleInfo::addLandingPad(MachineBasicBlock *LandingPad) {
- MCSymbol *LandingPadLabel = getLabelSym(NextLabelID());
+ MCSymbol *LandingPadLabel = Context.CreateTempSymbol();
LandingPadInfo &LP = getOrCreateLandingPadInfo(LandingPad);
LP.LandingPadLabel = LandingPadLabel;
return LandingPadLabel;
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
index 00ee13f7b1..fc14e9047e 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
+++ b/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
@@ -4362,7 +4362,7 @@ void SelectionDAGBuilder::LowerCallTo(CallSite CS, SDValue Callee,
if (LandingPad && MMI) {
// Insert a label before the invoke call to mark the try range. This can be
// used to detect deletion of the invoke via the MachineModuleInfo.
- BeginLabel = MMI->getLabelSym(MMI->NextLabelID());
+ BeginLabel = MMI->getContext().CreateTempSymbol();
// For SjLj, keep track of which landing pads go with which invokes
// so as to maintain the ordering of pads in the LSDA.
@@ -4464,7 +4464,7 @@ void SelectionDAGBuilder::LowerCallTo(CallSite CS, SDValue Callee,
if (LandingPad && MMI) {
// Insert a label at the end of the invoke call to mark the try range. This
// can be used to detect deletion of the invoke via the MachineModuleInfo.
- MCSymbol *EndLabel = MMI->getLabelSym(MMI->NextLabelID());
+ MCSymbol *EndLabel = MMI->getContext().CreateTempSymbol();
DAG.setRoot(DAG.getEHLabel(getCurDebugLoc(), getRoot(), EndLabel));
// Inform MachineModuleInfo of range.