summaryrefslogtreecommitdiff
path: root/lib/CodeGen
diff options
context:
space:
mode:
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/AsmPrinter.cpp3
-rw-r--r--lib/CodeGen/BranchFolding.cpp4
-rw-r--r--lib/CodeGen/ELFWriter.cpp4
-rw-r--r--lib/CodeGen/ELFWriter.h2
-rw-r--r--lib/CodeGen/LiveIntervalAnalysis.cpp1
-rw-r--r--lib/CodeGen/LiveVariables.cpp1
-rw-r--r--lib/CodeGen/MachOWriter.cpp4
-rw-r--r--lib/CodeGen/MachOWriter.h1
-rw-r--r--lib/CodeGen/MachineFunction.cpp11
-rw-r--r--lib/CodeGen/MachineModuleInfo.cpp9
-rw-r--r--lib/CodeGen/PHIElimination.cpp4
-rw-r--r--lib/CodeGen/PrologEpilogInserter.cpp4
-rw-r--r--lib/CodeGen/RegAllocLinearScan.cpp4
-rw-r--r--lib/CodeGen/RegAllocLocal.cpp5
-rw-r--r--lib/CodeGen/RegAllocSimple.cpp6
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp2
-rw-r--r--lib/CodeGen/TwoAddressInstructionPass.cpp4
-rw-r--r--lib/CodeGen/UnreachableBlockElim.cpp4
18 files changed, 66 insertions, 7 deletions
diff --git a/lib/CodeGen/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter.cpp
index aa71ee0b6d..4ce379c3e4 100644
--- a/lib/CodeGen/AsmPrinter.cpp
+++ b/lib/CodeGen/AsmPrinter.cpp
@@ -32,9 +32,10 @@ using namespace llvm;
static cl::opt<bool>
AsmVerbose("asm-verbose", cl::Hidden, cl::desc("Add comments to directives."));
+const int AsmPrinter::ID = 0;
AsmPrinter::AsmPrinter(std::ostream &o, TargetMachine &tm,
const TargetAsmInfo *T)
-: FunctionNumber(0), O(o), TM(tm), TAI(T)
+ : MachineFunctionPass((intptr_t)&ID), FunctionNumber(0), O(o), TM(tm), TAI(T)
{}
std::string AsmPrinter::getSectionForFunction(const Function &F) const {
diff --git a/lib/CodeGen/BranchFolding.cpp b/lib/CodeGen/BranchFolding.cpp
index 33f96df302..394fe7b81b 100644
--- a/lib/CodeGen/BranchFolding.cpp
+++ b/lib/CodeGen/BranchFolding.cpp
@@ -39,6 +39,9 @@ static cl::opt<bool> EnableTailMerge("enable-tail-merge", cl::Hidden);
namespace {
struct BranchFolder : public MachineFunctionPass {
+ static const int ID;
+ BranchFolder() : MachineFunctionPass((intptr_t)&ID) {}
+
virtual bool runOnMachineFunction(MachineFunction &MF);
virtual const char *getPassName() const { return "Control Flow Optimizer"; }
const TargetInstrInfo *TII;
@@ -64,6 +67,7 @@ namespace {
MachineBasicBlock *TBB, MachineBasicBlock *FBB,
const std::vector<MachineOperand> &Cond);
};
+ const int BranchFolder::ID = 0;
}
FunctionPass *llvm::createBranchFoldingPass() { return new BranchFolder(); }
diff --git a/lib/CodeGen/ELFWriter.cpp b/lib/CodeGen/ELFWriter.cpp
index ffc0a929f3..ce534092ba 100644
--- a/lib/CodeGen/ELFWriter.cpp
+++ b/lib/CodeGen/ELFWriter.cpp
@@ -47,6 +47,7 @@
#include <list>
using namespace llvm;
+const int ELFWriter::ID = 0;
/// AddELFWriter - Concrete function to add the ELF writer to the function pass
/// manager.
MachineCodeEmitter *llvm::AddELFWriter(FunctionPassManager &FPM,
@@ -176,7 +177,8 @@ bool ELFCodeEmitter::finishFunction(MachineFunction &F) {
// ELFWriter Implementation
//===----------------------------------------------------------------------===//
-ELFWriter::ELFWriter(std::ostream &o, TargetMachine &tm) : O(o), TM(tm) {
+ELFWriter::ELFWriter(std::ostream &o, TargetMachine &tm)
+ : MachineFunctionPass((intptr_t)&ID), O(o), TM(tm) {
e_flags = 0; // e_flags defaults to 0, no flags.
is64Bit = TM.getTargetData()->getPointerSizeInBits() == 64;
diff --git a/lib/CodeGen/ELFWriter.h b/lib/CodeGen/ELFWriter.h
index e64a9c946b..8b577a0a78 100644
--- a/lib/CodeGen/ELFWriter.h
+++ b/lib/CodeGen/ELFWriter.h
@@ -30,6 +30,8 @@ namespace llvm {
class ELFWriter : public MachineFunctionPass {
friend class ELFCodeEmitter;
public:
+ static const int ID;
+
MachineCodeEmitter &getMachineCodeEmitter() const {
return *(MachineCodeEmitter*)MCE;
}
diff --git a/lib/CodeGen/LiveIntervalAnalysis.cpp b/lib/CodeGen/LiveIntervalAnalysis.cpp
index c542033548..cc6c23f59f 100644
--- a/lib/CodeGen/LiveIntervalAnalysis.cpp
+++ b/lib/CodeGen/LiveIntervalAnalysis.cpp
@@ -45,6 +45,7 @@ STATISTIC(numFolded , "Number of loads/stores folded into instructions");
STATISTIC(numAborts , "Number of times interval joining aborted");
namespace {
+ const int LiveIntervals::ID = 0;
RegisterPass<LiveIntervals> X("liveintervals", "Live Interval Analysis");
static cl::opt<bool>
diff --git a/lib/CodeGen/LiveVariables.cpp b/lib/CodeGen/LiveVariables.cpp
index 4816cc1257..3ea60bcf15 100644
--- a/lib/CodeGen/LiveVariables.cpp
+++ b/lib/CodeGen/LiveVariables.cpp
@@ -37,6 +37,7 @@
#include <algorithm>
using namespace llvm;
+const int LiveVariables::ID = 0;
static RegisterPass<LiveVariables> X("livevars", "Live Variable Analysis");
void LiveVariables::VarInfo::dump() const {
diff --git a/lib/CodeGen/MachOWriter.cpp b/lib/CodeGen/MachOWriter.cpp
index 5164103d27..f8dccc1895 100644
--- a/lib/CodeGen/MachOWriter.cpp
+++ b/lib/CodeGen/MachOWriter.cpp
@@ -317,7 +317,9 @@ void MachOCodeEmitter::emitJumpTables(MachineJumpTableInfo *MJTI) {
// MachOWriter Implementation
//===----------------------------------------------------------------------===//
-MachOWriter::MachOWriter(std::ostream &o, TargetMachine &tm) : O(o), TM(tm) {
+const int MachOWriter::ID = 0;
+MachOWriter::MachOWriter(std::ostream &o, TargetMachine &tm)
+ : MachineFunctionPass((intptr_t)&ID), O(o), TM(tm) {
is64Bit = TM.getTargetData()->getPointerSizeInBits() == 64;
isLittleEndian = TM.getTargetData()->isLittleEndian();
diff --git a/lib/CodeGen/MachOWriter.h b/lib/CodeGen/MachOWriter.h
index 0792ac8a7d..d4c146d3bf 100644
--- a/lib/CodeGen/MachOWriter.h
+++ b/lib/CodeGen/MachOWriter.h
@@ -84,6 +84,7 @@ namespace llvm {
class MachOWriter : public MachineFunctionPass {
friend class MachOCodeEmitter;
public:
+ static const int ID;
MachineCodeEmitter &getMachineCodeEmitter() const {
return *(MachineCodeEmitter*)MCE;
}
diff --git a/lib/CodeGen/MachineFunction.cpp b/lib/CodeGen/MachineFunction.cpp
index 29eee3612f..9b43e655bc 100644
--- a/lib/CodeGen/MachineFunction.cpp
+++ b/lib/CodeGen/MachineFunction.cpp
@@ -44,11 +44,13 @@ void MachineFunctionPass::virtfn() {}
namespace {
struct VISIBILITY_HIDDEN Printer : public MachineFunctionPass {
+ static const int ID;
+
std::ostream *OS;
const std::string Banner;
- Printer (std::ostream *_OS, const std::string &_Banner) :
- OS (_OS), Banner (_Banner) { }
+ Printer (std::ostream *_OS, const std::string &_Banner)
+ : MachineFunctionPass((intptr_t)&ID), OS (_OS), Banner (_Banner) { }
const char *getPassName() const { return "MachineFunction Printer"; }
@@ -62,6 +64,7 @@ namespace {
return false;
}
};
+ const int Printer::ID = 0;
}
/// Returns a newly-created MachineFunction Printer pass. The default output
@@ -74,6 +77,9 @@ FunctionPass *llvm::createMachineFunctionPrinterPass(std::ostream *OS,
namespace {
struct VISIBILITY_HIDDEN Deleter : public MachineFunctionPass {
+ static const int ID;
+ Deleter() : MachineFunctionPass((intptr_t)&ID) {}
+
const char *getPassName() const { return "Machine Code Deleter"; }
bool runOnMachineFunction(MachineFunction &MF) {
@@ -82,6 +88,7 @@ namespace {
return true;
}
};
+ const int Deleter::ID = 0;
}
/// MachineCodeDeletion Pass - This pass deletes all of the machine code for
diff --git a/lib/CodeGen/MachineModuleInfo.cpp b/lib/CodeGen/MachineModuleInfo.cpp
index d37021e0a3..6421396faa 100644
--- a/lib/CodeGen/MachineModuleInfo.cpp
+++ b/lib/CodeGen/MachineModuleInfo.cpp
@@ -28,6 +28,7 @@ using namespace llvm::dwarf;
// Handle the Pass registration stuff necessary to use TargetData's.
namespace {
+ const int MachineModuleInfo::ID = 0;
RegisterPass<MachineModuleInfo> X("machinemoduleinfo", "Module Information");
}
@@ -1462,7 +1463,8 @@ DebugScope::~DebugScope() {
//===----------------------------------------------------------------------===//
MachineModuleInfo::MachineModuleInfo()
-: DR()
+: ImmutablePass((intptr_t)&ID)
+, DR()
, VR()
, CompileUnits()
, Directories()
@@ -1749,10 +1751,15 @@ Function *MachineModuleInfo::getPersonality() const {
namespace llvm {
struct DebugLabelFolder : public MachineFunctionPass {
+ static const int ID;
+ DebugLabelFolder() : MachineFunctionPass((intptr_t)&ID) {}
+
virtual bool runOnMachineFunction(MachineFunction &MF);
virtual const char *getPassName() const { return "Label Folder"; }
};
+const int DebugLabelFolder::ID = 0;
+
bool DebugLabelFolder::runOnMachineFunction(MachineFunction &MF) {
// Get machine module info.
MachineModuleInfo *MMI = getAnalysisToUpdate<MachineModuleInfo>();
diff --git a/lib/CodeGen/PHIElimination.cpp b/lib/CodeGen/PHIElimination.cpp
index 0b77fe2669..f26819d9e2 100644
--- a/lib/CodeGen/PHIElimination.cpp
+++ b/lib/CodeGen/PHIElimination.cpp
@@ -33,6 +33,9 @@ STATISTIC(NumAtomic, "Number of atomic phis lowered");
namespace {
struct VISIBILITY_HIDDEN PNE : public MachineFunctionPass {
+ static const int ID; // Pass identifcation, replacement for typeid
+ PNE() : MachineFunctionPass((intptr_t)&ID) {}
+
bool runOnMachineFunction(MachineFunction &Fn) {
analyzePHINodes(Fn);
@@ -73,6 +76,7 @@ namespace {
VRegPHIUse VRegPHIUseCount;
};
+ const int PNE::ID = 0;
RegisterPass<PNE> X("phi-node-elimination",
"Eliminate PHI nodes for register allocation");
}
diff --git a/lib/CodeGen/PrologEpilogInserter.cpp b/lib/CodeGen/PrologEpilogInserter.cpp
index 98c2085ccd..927f7d1226 100644
--- a/lib/CodeGen/PrologEpilogInserter.cpp
+++ b/lib/CodeGen/PrologEpilogInserter.cpp
@@ -32,6 +32,9 @@ using namespace llvm;
namespace {
struct VISIBILITY_HIDDEN PEI : public MachineFunctionPass {
+ static const int ID;
+ PEI() : MachineFunctionPass((intptr_t)&ID) {}
+
const char *getPassName() const {
return "Prolog/Epilog Insertion & Frame Finalization";
}
@@ -98,6 +101,7 @@ namespace {
void replaceFrameIndices(MachineFunction &Fn);
void insertPrologEpilogCode(MachineFunction &Fn);
};
+ const int PEI::ID = 0;
}
diff --git a/lib/CodeGen/RegAllocLinearScan.cpp b/lib/CodeGen/RegAllocLinearScan.cpp
index 8ad347bb7d..b45d983eeb 100644
--- a/lib/CodeGen/RegAllocLinearScan.cpp
+++ b/lib/CodeGen/RegAllocLinearScan.cpp
@@ -48,6 +48,9 @@ namespace {
static unsigned numIntervals = 0;
struct VISIBILITY_HIDDEN RA : public MachineFunctionPass {
+ static const int ID;
+ RA() : MachineFunctionPass((intptr_t)&ID) {}
+
typedef std::pair<LiveInterval*, LiveInterval::iterator> IntervalPtr;
typedef std::vector<IntervalPtr> IntervalPtrs;
private:
@@ -146,6 +149,7 @@ namespace {
}
}
};
+ const int RA::ID = 0;
}
void RA::ComputeRelatedRegClasses() {
diff --git a/lib/CodeGen/RegAllocLocal.cpp b/lib/CodeGen/RegAllocLocal.cpp
index d3d5796e85..4494552c9f 100644
--- a/lib/CodeGen/RegAllocLocal.cpp
+++ b/lib/CodeGen/RegAllocLocal.cpp
@@ -43,6 +43,10 @@ namespace {
class VISIBILITY_HIDDEN RA : public MachineFunctionPass {
+ public:
+ static const int ID;
+ RA() : MachineFunctionPass((intptr_t)&ID) {}
+ private:
const TargetMachine *TM;
MachineFunction *MF;
const MRegisterInfo *RegInfo;
@@ -224,6 +228,7 @@ namespace {
void reloadPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator &I,
unsigned PhysReg);
};
+ const int RA::ID = 0;
}
/// getStackSpaceFor - This allocates space for the specified virtual register
diff --git a/lib/CodeGen/RegAllocSimple.cpp b/lib/CodeGen/RegAllocSimple.cpp
index 576d2b421c..771c68b1ac 100644
--- a/lib/CodeGen/RegAllocSimple.cpp
+++ b/lib/CodeGen/RegAllocSimple.cpp
@@ -38,6 +38,10 @@ namespace {
createSimpleRegisterAllocator);
class VISIBILITY_HIDDEN RegAllocSimple : public MachineFunctionPass {
+ public:
+ static const int ID;
+ RegAllocSimple() : MachineFunctionPass((intptr_t)&ID) {}
+ private:
MachineFunction *MF;
const TargetMachine *TM;
const MRegisterInfo *RegInfo;
@@ -90,7 +94,7 @@ namespace {
void spillVirtReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator I,
unsigned VirtReg, unsigned PhysReg);
};
-
+ const int RegAllocSimple::ID = 0;
}
/// getStackSpaceFor - This allocates space for the specified virtual
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
index 7f710040fe..c83eb5bb3d 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
+++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
@@ -5011,3 +5011,5 @@ SelectInlineAsmMemoryOperands(std::vector<SDOperand> &Ops, SelectionDAG &DAG) {
if (e != InOps.size())
Ops.push_back(InOps.back());
}
+
+const int SelectionDAGISel::ID = 0;
diff --git a/lib/CodeGen/TwoAddressInstructionPass.cpp b/lib/CodeGen/TwoAddressInstructionPass.cpp
index b14a95e406..455993c45d 100644
--- a/lib/CodeGen/TwoAddressInstructionPass.cpp
+++ b/lib/CodeGen/TwoAddressInstructionPass.cpp
@@ -50,12 +50,16 @@ STATISTIC(NumConvertedTo3Addr, "Number of instructions promoted to 3-address");
namespace {
struct VISIBILITY_HIDDEN TwoAddressInstructionPass
: public MachineFunctionPass {
+ static const int ID; // Pass identifcation, replacement for typeid
+ TwoAddressInstructionPass() : MachineFunctionPass((intptr_t)&ID) {}
+
virtual void getAnalysisUsage(AnalysisUsage &AU) const;
/// runOnMachineFunction - pass entry point
bool runOnMachineFunction(MachineFunction&);
};
+ const int TwoAddressInstructionPass::ID = 0;
RegisterPass<TwoAddressInstructionPass>
X("twoaddressinstruction", "Two-Address instruction pass");
}
diff --git a/lib/CodeGen/UnreachableBlockElim.cpp b/lib/CodeGen/UnreachableBlockElim.cpp
index 951deb60d9..f66a7713d7 100644
--- a/lib/CodeGen/UnreachableBlockElim.cpp
+++ b/lib/CodeGen/UnreachableBlockElim.cpp
@@ -34,7 +34,11 @@ using namespace llvm;
namespace {
class VISIBILITY_HIDDEN UnreachableBlockElim : public FunctionPass {
virtual bool runOnFunction(Function &F);
+ public:
+ static const int ID; // Pass identifcation, replacement for typeid
+ UnreachableBlockElim() : FunctionPass((intptr_t)&ID) {}
};
+ const int UnreachableBlockElim::ID = 0;
RegisterPass<UnreachableBlockElim>
X("unreachableblockelim", "Remove unreachable blocks from the CFG");
}