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
This commit is contained in:
Chris Lattner
2010-03-14 08:36:50 +00:00
parent 6b4205aa44
commit 63d7836267
13 changed files with 25 additions and 46 deletions

View File

@ -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;