time.</p>
<div class="doc_code"><pre>
- static const int ID;
+ static const char ID;
Hello() : FunctionPass((intptr_t)&ID) {}
</pre></div><p>
function.</p>
<div class="doc_code"><pre>
- const int Hello::ID = 0;
+ const char Hello::ID = 0;
</pre></div>
<p> We initialize pass ID here. LLVM uses ID's address to identify pass so
<b>namespace</b> {
<b>struct Hello</b> : <b>public</b> <a href="#FunctionPass">FunctionPass</a> {
- static const int ID;
+ static const char ID;
Hello() : FunctionPass((intptr_t)&ID) {}
<b>virtual bool</b> <a href="#runOnFunction">runOnFunction</a>(Function &F) {
virtual void getAnalysisUsage(AnalysisUsage &AU) const;
public:
- static const int ID; // Class identification, replacement for typeinfo
+ static const char ID; // Class identification, replacement for typeinfo
AliasAnalysis() : TD(0), AA(0) {}
virtual ~AliasAnalysis(); // We want to be subclassed
FunctionMapTy FunctionMap; // Map from a function to its node
public:
- static const int ID; // Class identification, replacement for typeinfo
+ static const char ID; // Class identification, replacement for typeinfo
//===---------------------------------------------------------------------
// Accessors...
//
///
class DominatorTree : public DominatorTreeBase {
public:
- static const int ID; // Pass ID, replacement for typeid
+ static const char ID; // Pass ID, replacement for typeid
DominatorTree() : DominatorTreeBase((intptr_t)&ID, false) {}
BasicBlock *getRoot() const {
class ETForest : public ETForestBase {
public:
- static const int ID; // Pass identifcation, replacement for typeid
+ static const char ID; // Pass identifcation, replacement for typeid
ETForest() : ETForestBase((intptr_t)&ID, false) {}
///
class DominanceFrontier : public DominanceFrontierBase {
public:
- static const int ID; // Pass ID, replacement for typeid
+ static const char ID; // Pass ID, replacement for typeid
DominanceFrontier() :
DominanceFrontierBase((intptr_t)& ID, false) {}
class FindUsedTypes : public ModulePass {
std::set<const Type *> UsedTypes;
public:
- static const int ID; // Pass identifcation, replacement for typeid
+ static const char ID; // Pass identifcation, replacement for typeid
FindUsedTypes() : ModulePass((intptr_t)&ID) {}
/// getTypes - After the pass has been run, return the set containing all of
std::vector<Interval*> Intervals;
public:
- static const int ID; // Pass identifcation, replacement for typeid
+ static const char ID; // Pass identifcation, replacement for typeid
IntervalPartition() : FunctionPass((intptr_t)&ID), RootInterval(0) {}
std::vector<Loop*> TopLevelLoops;
friend class Loop;
public:
- static const int ID; // Pass identifcation, replacement for typeid
+ static const char ID; // Pass identifcation, replacement for typeid
LoopInfo() : FunctionPass((intptr_t)&ID) {}
~LoopInfo() { releaseMemory(); }
class LPPassManager : public FunctionPass, public PMDataManager {
public:
- static const int ID;
+ static const char ID;
LPPassManager(int Depth);
/// run - Execute all of the passes scheduled for execution. Keep track of
/// compute the a post-dominator tree.
///
struct PostDominatorTree : public DominatorTreeBase {
- static const int ID; // Pass identifcation, replacement for typeid
+ static const char ID; // Pass identifcation, replacement for typeid
PostDominatorTree() :
DominatorTreeBase((intptr_t)&ID, true) {}
/// PostETForest Class - Concrete subclass of ETForestBase that is used to
/// compute a forwards post-dominator ET-Forest.
struct PostETForest : public ETForestBase {
- static const int ID;
+ static const char ID;
PostETForest() : ETForestBase((intptr_t)&ID, true) {}
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
/// used to compute the a post-dominance frontier.
///
struct PostDominanceFrontier : public DominanceFrontierBase {
- static const int ID;
+ static const char ID;
PostDominanceFrontier()
: DominanceFrontierBase((intptr_t) &ID, true) {}
// entered.
std::map<std::pair<BasicBlock*, BasicBlock*>, unsigned> EdgeCounts;
public:
- static const int ID; // Class identification, replacement for typeinfo
+ static const char ID; // Class identification, replacement for typeinfo
virtual ~ProfileInfo(); // We want to be subclassed
//===------------------------------------------------------------------===//
class ScalarEvolution : public FunctionPass {
void *Impl; // ScalarEvolution uses the pimpl pattern
public:
- static const int ID; // Pass identifcation, replacement for typeid
+ static const char ID; // Pass identifcation, replacement for typeid
ScalarEvolution() : FunctionPass((intptr_t)&ID), Impl(0) {}
/// getSCEV - Return a SCEV expression handle for the full generality of the
class Instruction;
struct ValueNumbering {
- static const int ID; // Class identification, replacement for typeinfo
+ static const char ID; // Class identification, replacement for typeinfo
virtual ~ValueNumbering(); // We want to be subclassed
/// getEqualNumberNodes - Return nodes with the same value number as the
OStream *Out; // ostream to print on
bool DeleteStream; // Delete the ostream in our dtor?
public:
- static const int ID;
+ static const char ID;
PrintModulePass() : ModulePass((intptr_t)&ID), Out(&cerr), DeleteStream(false) {}
PrintModulePass(OStream *o, bool DS = false)
: ModulePass((intptr_t)&ID), Out(o), DeleteStream(DS) {}
OStream *Out; // ostream to print on
bool DeleteStream; // Delete the ostream in our dtor?
public:
- static const int ID;
+ static const char ID;
PrintFunctionPass() : FunctionPass((intptr_t)&ID), Banner(""), Out(&cerr),
DeleteStream(false) {}
PrintFunctionPass(const std::string &B, OStream *o = &cout,
bool DeleteStream;
bool CompressFile;
public:
- static const int ID; // Pass identifcation, replacement for typeid
+ static const char ID; // Pass identifcation, replacement for typeid
WriteBytecodePass()
: ModulePass((intptr_t) &ID), Out(&cout), DeleteStream(false),
CompressFile(false) {}
/// AsmPrinter - This class is intended to be used as a driving class for all
/// asm writers.
class AsmPrinter : public MachineFunctionPass {
- static const int ID;
+ static const char ID;
/// FunctionNumber - This provides a unique ID for each function emitted in
/// this translation unit. It is autoincremented by SetupMachineFunction,
BitVector JoinedLIs;
public:
- static const int ID; // Pass identifcation, replacement for typeid
+ static const char ID; // Pass identifcation, replacement for typeid
LiveIntervals() : MachineFunctionPass((intptr_t)&ID) {}
struct CopyRec {
class LiveVariables : public MachineFunctionPass {
public:
- static const int ID; // Pass identifcation, replacement for typeid
+ static const char ID; // Pass identifcation, replacement for typeid
LiveVariables() : MachineFunctionPass((intptr_t)&ID) {}
/// VarInfo - This represents the regions where a virtual register is live in
std::vector<GlobalVariable *> TypeInfos;
public:
- static const int ID; // Pass identifcation, replacement for typeid
+ static const char ID; // Pass identifcation, replacement for typeid
MachineModuleInfo();
~MachineModuleInfo();
MachineBasicBlock *BB;
std::vector<SDNode*> TopOrder;
unsigned DAGSize;
- static const int ID;
+ static const char ID;
explicit SelectionDAGISel(TargetLowering &tli) :
FunctionPass((intptr_t)&ID), TLI(tli), DAGSize(0) {}
class FPPassManager : public ModulePass, public PMDataManager {
public:
- static const int ID;
+ static const char ID;
explicit FPPassManager(int Depth)
: ModulePass((intptr_t)&ID), PMDataManager(Depth) { }
/// requested alignment (if the global has one).
unsigned getPreferredAlignmentLog(const GlobalVariable *GV) const;
- static const int ID; // Pass identifcation, replacement for typeid
+ static const char ID; // Pass identifcation, replacement for typeid
};
/// StructLayout - used to lazily calculate structure layout information for a
/// this interface are expected to chain to other implementations, such that
/// multiple profilers can be support simultaniously.
struct RSProfilers : public ModulePass {
- static const int ID; // Pass identification, replacement for typeinfo
+ static const char ID; // Pass identification, replacement for typeinfo
RSProfilers() : ModulePass((intptr_t)&ID) {}
/// isProfiling - This method returns true if the value passed it was
struct UnifyFunctionExitNodes : public FunctionPass {
BasicBlock *ReturnBlock, *UnwindBlock, *UnreachableBlock;
public:
- static const int ID; // Pass identifcation, replacement for typeid
+ static const char ID; // Pass identifcation, replacement for typeid
UnifyFunctionExitNodes() : FunctionPass((intptr_t)&ID),
ReturnBlock(0), UnwindBlock(0) {}
namespace {
RegisterAnalysisGroup<AliasAnalysis> Z("Alias Analysis");
}
-const int AliasAnalysis::ID = 0;
+const char AliasAnalysis::ID = 0;
//===----------------------------------------------------------------------===//
// Default chaining methods
const char *Name;
Module *M;
public:
- static const int ID; // Class identification, replacement for typeinfo
+ static const char ID; // Class identification, replacement for typeinfo
AliasAnalysisCounter() : ModulePass((intptr_t) &ID) {
No = May = Must = 0;
NoMR = JustRef = JustMod = MR = 0;
}
};
- const int AliasAnalysisCounter::ID = 0;
+ const char AliasAnalysisCounter::ID = 0;
RegisterPass<AliasAnalysisCounter>
X("count-aa", "Count Alias Analysis Query Responses");
RegisterAnalysisGroup<AliasAnalysis> Y(X);
unsigned NoModRef, Mod, Ref, ModRef;
public:
- static const int ID; // Pass identifcation, replacement for typeid
+ static const char ID; // Pass identifcation, replacement for typeid
AAEval() : FunctionPass((intptr_t)&ID) {}
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
bool doFinalization(Module &M);
};
- const int AAEval::ID = 0;
+ const char AAEval::ID = 0;
RegisterPass<AAEval>
X("aa-eval", "Exhaustive Alias Analysis Precision Evaluator");
}
std::set<const Value*> Vals;
public:
- static const int ID; // Class identification, replacement for typeinfo
+ static const char ID; // Class identification, replacement for typeinfo
AliasDebugger() : ModulePass((intptr_t)&ID) {}
bool runOnModule(Module &M) {
};
- const int AliasDebugger::ID = 0;
+ const char AliasDebugger::ID = 0;
RegisterPass<AliasDebugger> X("debug-aa", "AA use debugger");
RegisterAnalysisGroup<AliasAnalysis> Y(X);
}
class VISIBILITY_HIDDEN AliasSetPrinter : public FunctionPass {
AliasSetTracker *Tracker;
public:
- static const int ID; // Pass identifcation, replacement for typeid
+ static const char ID; // Pass identifcation, replacement for typeid
AliasSetPrinter() : FunctionPass((intptr_t)&ID) {}
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
return false;
}
};
- const int AliasSetPrinter::ID = 0;
+ const char AliasSetPrinter::ID = 0;
RegisterPass<AliasSetPrinter> X("print-alias-sets", "Alias Set Printer");
}
/// such it doesn't follow many of the rules that other alias analyses must.
///
struct VISIBILITY_HIDDEN NoAA : public ImmutablePass, public AliasAnalysis {
- static const int ID; // Class identification, replacement for typeinfo
+ static const char ID; // Class identification, replacement for typeinfo
NoAA() : ImmutablePass((intptr_t)&ID) {}
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
};
// Register this pass...
- const int NoAA::ID = 0;
+ const char NoAA::ID = 0;
RegisterPass<NoAA>
U("no-aa", "No Alias Analysis (always returns 'may' alias)");
/// Because it doesn't chain to a previous alias analysis (like -no-aa), it
/// derives from the NoAA class.
struct VISIBILITY_HIDDEN BasicAliasAnalysis : public NoAA {
- static const int ID; // Class identification, replacement for typeinfo
+ static const char ID; // Class identification, replacement for typeinfo
AliasResult alias(const Value *V1, unsigned V1Size,
const Value *V2, unsigned V2Size);
};
// Register this pass...
- const int BasicAliasAnalysis::ID = 0;
+ const char BasicAliasAnalysis::ID = 0;
RegisterPass<BasicAliasAnalysis>
X("basicaa", "Basic Alias Analysis (default AA impl)");
namespace {
struct VISIBILITY_HIDDEN CFGPrinter : public FunctionPass {
- static const int ID; // Pass identifcation, replacement for typeid
+ static const char ID; // Pass identifcation, replacement for typeid
CFGPrinter() : FunctionPass((intptr_t)&ID) {}
virtual bool runOnFunction(Function &F) {
}
};
- const int CFGPrinter::ID = 0;
+ const char CFGPrinter::ID = 0;
RegisterPass<CFGPrinter> P1("print-cfg",
"Print CFG of function to 'dot' file");
struct VISIBILITY_HIDDEN CFGOnlyPrinter : public CFGPrinter {
- static const int ID; // Pass identifcation, replacement for typeid
+ static const char ID; // Pass identifcation, replacement for typeid
virtual bool runOnFunction(Function &F) {
bool OldCFGOnly = CFGOnly;
CFGOnly = true;
}
};
- const int CFGOnlyPrinter::ID = 0;
+ const char CFGOnlyPrinter::ID = 0;
RegisterPass<CFGOnlyPrinter>
P2("print-cfg-only",
"Print CFG of function to 'dot' file (with no function bodies)");
class VISIBILITY_HIDDEN Andersens : public ModulePass, public AliasAnalysis,
private InstVisitor<Andersens> {
public:
- static const int ID; // Class identification, replacement for typeinfo
+ static const char ID; // Class identification, replacement for typeinfo
Andersens() : ModulePass((intptr_t)&ID) {}
private:
/// Node class - This class is used to represent a memory object in the
void visitInstruction(Instruction &I);
};
- const int Andersens::ID = 0;
+ const char Andersens::ID = 0;
RegisterPass<Andersens> X("anders-aa",
"Andersen's Interprocedural Alias Analysis");
RegisterAnalysisGroup<AliasAnalysis> Y(X);
CallGraphNode *CallsExternalNode;
public:
- static const int ID; // Class identification, replacement for typeinfo
+ static const char ID; // Class identification, replacement for typeinfo
BasicCallGraph() : ModulePass((intptr_t)&ID), Root(0),
ExternalCallingNode(0), CallsExternalNode(0) {}
}
};
-
RegisterAnalysisGroup<CallGraph> X("Call Graph");
RegisterPass<BasicCallGraph> Y("basiccg", "Basic CallGraph Construction");
RegisterAnalysisGroup<CallGraph, true> Z(Y);
} //End anonymous namespace
-const int CallGraph::ID = 0;
-const int BasicCallGraph::ID = 0;
+const char CallGraph::ID = 0;
+const char BasicCallGraph::ID = 0;
void CallGraph::initialize(Module &M) {
Mod = &M;
class CGPassManager : public ModulePass, public PMDataManager {
public:
- static const int ID;
+ static const char ID;
CGPassManager(int Depth)
: ModulePass((intptr_t)&ID), PMDataManager(Depth) { }
}
};
-const int CGPassManager::ID = 0;
+const char CGPassManager::ID = 0;
/// run - Execute all of the passes scheduled for execution. Keep track of
/// whether any of the passes modifies the module, and if so, return true.
bool CGPassManager::runOnModule(Module &M) {
#include "llvm/Support/InstIterator.h"
using namespace llvm;
-const int FindUsedTypes::ID = 0;
+const char FindUsedTypes::ID = 0;
static RegisterPass<FindUsedTypes>
X("printusedtypes", "Find Used Types");
std::map<Function*, FunctionRecord> FunctionInfo;
public:
- static const int ID;
+ static const char ID;
GlobalsModRef() : ModulePass((intptr_t)&ID) {}
bool runOnModule(Module &M) {
bool AnalyzeIndirectGlobalMemory(GlobalValue *GV);
};
- const int GlobalsModRef::ID = 0;
+ const char GlobalsModRef::ID = 0;
RegisterPass<GlobalsModRef> X("globalsmodref-aa",
"Simple mod/ref analysis for globals");
RegisterAnalysisGroup<AliasAnalysis> Y(X);
abort();
}
public:
- static const int ID; // Pass identifcation, replacement for typeid
+ static const char ID; // Pass identifcation, replacement for typeid
InstCount() : FunctionPass((intptr_t)&ID) {}
virtual bool runOnFunction(Function &F);
};
- const int InstCount::ID = 0;
+ const char InstCount::ID = 0;
RegisterPass<InstCount> X("instcount",
"Counts the various types of Instructions");
}
#include "llvm/Analysis/IntervalIterator.h"
using namespace llvm;
-const int IntervalPartition::ID = 0;
+const char IntervalPartition::ID = 0;
static RegisterPass<IntervalPartition>
X("intervals", "Interval Partition Construction", true);
namespace {
// FIXME: This should not be a FunctionPass.
struct VISIBILITY_HIDDEN LoadVN : public FunctionPass, public ValueNumbering {
- static const int ID; // Class identification, replacement for typeinfo
+ static const char ID; // Class identification, replacement for typeinfo
LoadVN() : FunctionPass((intptr_t)&ID) {}
/// Pass Implementation stuff. This doesn't do any analysis.
std::vector<Value*> &RetVals) const;
};
- const int LoadVN::ID = 0;
+ const char LoadVN::ID = 0;
// Register this pass...
RegisterPass<LoadVN> X("load-vn", "Load Value Numbering");
#include <ostream>
using namespace llvm;
-const int LoopInfo::ID = 0;
+const char LoopInfo::ID = 0;
static RegisterPass<LoopInfo>
X("loops", "Natural Loop Construction", true);
// LPPassManager
//
-const int LPPassManager::ID = 0;
+const char LPPassManager::ID = 0;
/// LPPassManager manages FPPassManagers and CalLGraphSCCPasses.
LPPassManager::LPPassManager(int Depth)
// PostDominatorTree Implementation
//===----------------------------------------------------------------------===//
-const int PostDominatorTree::ID = 0;
-const int PostDominanceFrontier::ID = 0;
-const int PostETForest::ID = 0;
+const char PostDominatorTree::ID = 0;
+const char PostDominanceFrontier::ID = 0;
+const char PostETForest::ID = 0;
static RegisterPass<PostDominatorTree>
F("postdomtree", "Post-Dominator Tree Construction", true);
namespace {
RegisterAnalysisGroup<ProfileInfo> Z("Profile Information");
}
-const int ProfileInfo::ID = 0;
+const char ProfileInfo::ID = 0;
ProfileInfo::~ProfileInfo() {}
namespace {
struct VISIBILITY_HIDDEN NoProfileInfo
: public ImmutablePass, public ProfileInfo {
- static const int ID; // Class identification, replacement for typeinfo
+ static const char ID; // Class identification, replacement for typeinfo
NoProfileInfo() : ImmutablePass((intptr_t)&ID) {}
};
- const int NoProfileInfo::ID = 0;
+ const char NoProfileInfo::ID = 0;
// Register this pass...
RegisterPass<NoProfileInfo>
X("no-profile", "No Profile Information");
class VISIBILITY_HIDDEN LoaderPass : public ModulePass, public ProfileInfo {
std::string Filename;
public:
- static const int ID; // Class identification, replacement for typeinfo
+ static const char ID; // Class identification, replacement for typeinfo
LoaderPass(const std::string &filename = "")
: ModulePass((intptr_t)&ID), Filename(filename) {
if (filename.empty()) Filename = ProfileInfoFilename;
virtual bool runOnModule(Module &M);
};
- const int LoaderPass::ID = 0;
+ const char LoaderPass::ID = 0;
RegisterPass<LoaderPass>
X("profile-loader", "Load profile information from llvmprof.out");
RegisterPass<ScalarEvolution>
R("scalar-evolution", "Scalar Evolution Analysis");
}
-const int ScalarEvolution::ID = 0;
+const char ScalarEvolution::ID = 0;
//===----------------------------------------------------------------------===//
// SCEV class definitions
#include "llvm/Support/Compiler.h"
using namespace llvm;
-const int ValueNumbering::ID = 0;
+const char ValueNumbering::ID = 0;
// Register the ValueNumbering interface, providing a nice name to refer to.
static RegisterAnalysisGroup<ValueNumbering> X("Value Numbering");
///
struct VISIBILITY_HIDDEN BasicVN
: public ImmutablePass, public ValueNumbering {
- static const int ID; // Class identification, replacement for typeinfo
+ static const char ID; // Class identification, replacement for typeinfo
BasicVN() : ImmutablePass((intptr_t)&ID) {}
/// getEqualNumberNodes - Return nodes with the same value number as the
std::vector<Value*> &RetVals) const;
};
- const int BasicVN::ID = 0;
+ const char BasicVN::ID = 0;
// Register this pass...
RegisterPass<BasicVN>
X("basicvn", "Basic Value Numbering (default GVN impl)");
/// @brief The bytecode version number
const unsigned BCVersionNum = 7;
-const int WriteBytecodePass::ID = 0;
+const char WriteBytecodePass::ID = 0;
static RegisterPass<WriteBytecodePass> X("emitbytecode", "Bytecode Writer");
STATISTIC(BytesWritten, "Number of bytecode bytes written");
static cl::opt<bool>
AsmVerbose("asm-verbose", cl::Hidden, cl::desc("Add comments to directives."));
-const int AsmPrinter::ID = 0;
+const char AsmPrinter::ID = 0;
AsmPrinter::AsmPrinter(std::ostream &o, TargetMachine &tm,
const TargetAsmInfo *T)
: MachineFunctionPass((intptr_t)&ID), FunctionNumber(0), O(o), TM(tm), TAI(T)
namespace {
struct BranchFolder : public MachineFunctionPass {
- static const int ID;
+ static const char ID;
BranchFolder() : MachineFunctionPass((intptr_t)&ID) {}
virtual bool runOnMachineFunction(MachineFunction &MF);
MachineBasicBlock *TBB, MachineBasicBlock *FBB,
const std::vector<MachineOperand> &Cond);
};
- const int BranchFolder::ID = 0;
+ const char BranchFolder::ID = 0;
}
FunctionPass *llvm::createBranchFoldingPass() { return new BranchFolder(); }
#include <list>
using namespace llvm;
-const int ELFWriter::ID = 0;
+const char ELFWriter::ID = 0;
/// AddELFWriter - Concrete function to add the ELF writer to the function pass
/// manager.
MachineCodeEmitter *llvm::AddELFWriter(FunctionPassManager &FPM,
class ELFWriter : public MachineFunctionPass {
friend class ELFCodeEmitter;
public:
- static const int ID;
+ static const char ID;
MachineCodeEmitter &getMachineCodeEmitter() const {
return *(MachineCodeEmitter*)MCE;
STATISTIC(numFolded , "Number of loads/stores folded into instructions");
STATISTIC(numAborts , "Number of times interval joining aborted");
-const int LiveIntervals::ID = 0;
+const char LiveIntervals::ID = 0;
namespace {
RegisterPass<LiveIntervals> X("liveintervals", "Live Interval Analysis");
#include <algorithm>
using namespace llvm;
-const int LiveVariables::ID = 0;
+const char LiveVariables::ID = 0;
static RegisterPass<LiveVariables> X("livevars", "Live Variable Analysis");
void LiveVariables::VarInfo::dump() const {
// MachOWriter Implementation
//===----------------------------------------------------------------------===//
-const int MachOWriter::ID = 0;
+const char MachOWriter::ID = 0;
MachOWriter::MachOWriter(std::ostream &o, TargetMachine &tm)
: MachineFunctionPass((intptr_t)&ID), O(o), TM(tm) {
is64Bit = TM.getTargetData()->getPointerSizeInBits() == 64;
class MachOWriter : public MachineFunctionPass {
friend class MachOCodeEmitter;
public:
- static const int ID;
+ static const char ID;
MachineCodeEmitter &getMachineCodeEmitter() const {
return *(MachineCodeEmitter*)MCE;
}
namespace {
struct VISIBILITY_HIDDEN Printer : public MachineFunctionPass {
- static const int ID;
+ static const char ID;
std::ostream *OS;
const std::string Banner;
return false;
}
};
- const int Printer::ID = 0;
+ const char Printer::ID = 0;
}
/// Returns a newly-created MachineFunction Printer pass. The default output
namespace {
struct VISIBILITY_HIDDEN Deleter : public MachineFunctionPass {
- static const int ID;
+ static const char ID;
Deleter() : MachineFunctionPass((intptr_t)&ID) {}
const char *getPassName() const { return "Machine Code Deleter"; }
return true;
}
};
- const int Deleter::ID = 0;
+ const char Deleter::ID = 0;
}
/// MachineCodeDeletion Pass - This pass deletes all of the machine code for
namespace {
RegisterPass<MachineModuleInfo> X("machinemoduleinfo", "Module Information");
}
-const int MachineModuleInfo::ID = 0;
+const char MachineModuleInfo::ID = 0;
//===----------------------------------------------------------------------===//
namespace llvm {
struct DebugLabelFolder : public MachineFunctionPass {
- static const int ID;
+ static const char ID;
DebugLabelFolder() : MachineFunctionPass((intptr_t)&ID) {}
virtual bool runOnMachineFunction(MachineFunction &MF);
virtual const char *getPassName() const { return "Label Folder"; }
};
-const int DebugLabelFolder::ID = 0;
+const char DebugLabelFolder::ID = 0;
bool DebugLabelFolder::runOnMachineFunction(MachineFunction &MF) {
// Get machine module info.
namespace {
struct VISIBILITY_HIDDEN PNE : public MachineFunctionPass {
- static const int ID; // Pass identifcation, replacement for typeid
+ static const char ID; // Pass identifcation, replacement for typeid
PNE() : MachineFunctionPass((intptr_t)&ID) {}
bool runOnMachineFunction(MachineFunction &Fn) {
VRegPHIUse VRegPHIUseCount;
};
- const int PNE::ID = 0;
+ const char PNE::ID = 0;
RegisterPass<PNE> X("phi-node-elimination",
"Eliminate PHI nodes for register allocation");
}
namespace {
struct VISIBILITY_HIDDEN PEI : public MachineFunctionPass {
- static const int ID;
+ static const char ID;
PEI() : MachineFunctionPass((intptr_t)&ID) {}
const char *getPassName() const {
void replaceFrameIndices(MachineFunction &Fn);
void insertPrologEpilogCode(MachineFunction &Fn);
};
- const int PEI::ID = 0;
+ const char PEI::ID = 0;
}
static unsigned numIntervals = 0;
struct VISIBILITY_HIDDEN RA : public MachineFunctionPass {
- static const int ID;
+ static const char ID;
RA() : MachineFunctionPass((intptr_t)&ID) {}
typedef std::pair<LiveInterval*, LiveInterval::iterator> IntervalPtr;
}
}
};
- const int RA::ID = 0;
+ const char RA::ID = 0;
}
void RA::ComputeRelatedRegClasses() {
class VISIBILITY_HIDDEN RA : public MachineFunctionPass {
public:
- static const int ID;
+ static const char ID;
RA() : MachineFunctionPass((intptr_t)&ID) {}
private:
const TargetMachine *TM;
void reloadPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator &I,
unsigned PhysReg);
};
- const int RA::ID = 0;
+ const char RA::ID = 0;
}
/// getStackSpaceFor - This allocates space for the specified virtual register
class VISIBILITY_HIDDEN RegAllocSimple : public MachineFunctionPass {
public:
- static const int ID;
+ static const char ID;
RegAllocSimple() : MachineFunctionPass((intptr_t)&ID) {}
private:
MachineFunction *MF;
void spillVirtReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator I,
unsigned VirtReg, unsigned PhysReg);
};
- const int RegAllocSimple::ID = 0;
+ const char RegAllocSimple::ID = 0;
}
/// getStackSpaceFor - This allocates space for the specified virtual
Ops.push_back(InOps.back());
}
-const int SelectionDAGISel::ID = 0;
+const char SelectionDAGISel::ID = 0;
namespace {
struct VISIBILITY_HIDDEN TwoAddressInstructionPass
: public MachineFunctionPass {
- static const int ID; // Pass identifcation, replacement for typeid
+ static const char ID; // Pass identifcation, replacement for typeid
TwoAddressInstructionPass() : MachineFunctionPass((intptr_t)&ID) {}
virtual void getAnalysisUsage(AnalysisUsage &AU) const;
bool runOnMachineFunction(MachineFunction&);
};
- const int TwoAddressInstructionPass::ID = 0;
+ const char TwoAddressInstructionPass::ID = 0;
RegisterPass<TwoAddressInstructionPass>
X("twoaddressinstruction", "Two-Address instruction pass");
}
class VISIBILITY_HIDDEN UnreachableBlockElim : public FunctionPass {
virtual bool runOnFunction(Function &F);
public:
- static const int ID; // Pass identifcation, replacement for typeid
+ static const char ID; // Pass identifcation, replacement for typeid
UnreachableBlockElim() : FunctionPass((intptr_t)&ID) {}
};
- const int UnreachableBlockElim::ID = 0;
+ const char UnreachableBlockElim::ID = 0;
RegisterPass<UnreachableBlockElim>
X("unreachableblockelim", "Remove unreachable blocks from the CFG");
}
ARMFunctionInfo *AFI;
bool isThumb;
public:
- static const int ID;
+ static const char ID;
ARMConstantIslands() : MachineFunctionPass((intptr_t)&ID) {}
virtual bool runOnMachineFunction(MachineFunction &Fn);
void dumpBBs();
void verify(MachineFunction &Fn);
};
- const int ARMConstantIslands::ID = 0;
+ const char ARMConstantIslands::ID = 0;
}
/// verify - check BBOffsets, BBSizes, alignment of islands
namespace {
struct VISIBILITY_HIDDEN ARMLoadStoreOpt : public MachineFunctionPass {
- static const int ID;
+ static const char ID;
ARMLoadStoreOpt() : MachineFunctionPass((intptr_t)&ID) {}
const TargetInstrInfo *TII;
bool LoadStoreMultipleOpti(MachineBasicBlock &MBB);
bool MergeReturnIntoLDM(MachineBasicBlock &MBB);
};
- const int ARMLoadStoreOpt::ID = 0;
+ const char ARMLoadStoreOpt::ID = 0;
}
/// createARMLoadStoreOptimizationPass - returns an instance of the load / store
namespace {
struct VISIBILITY_HIDDEN AlphaBSel : public MachineFunctionPass {
- static const int ID;
+ static const char ID;
AlphaBSel() : MachineFunctionPass((intptr_t)&ID) {}
virtual bool runOnMachineFunction(MachineFunction &Fn);
return "Alpha Branch Selection";
}
};
- const int AlphaBSel::ID = 0;
+ const char AlphaBSel::ID = 0;
}
/// createAlphaBranchSelectionPass - returns an instance of the Branch Selection
int getMachineOpValue(MachineInstr &MI, MachineOperand &MO);
public:
- static const int ID;
+ static const char ID;
explicit AlphaCodeEmitter(TargetMachine &tm, MachineCodeEmitter &mce)
: MachineFunctionPass((intptr_t)&ID), II(0), TM(tm), MCE(mce) {}
AlphaCodeEmitter(TargetMachine &tm, MachineCodeEmitter &mce,
void emitBasicBlock(MachineBasicBlock &MBB);
};
- const int AlphaCodeEmitter::ID = 0;
+ const char AlphaCodeEmitter::ID = 0;
}
/// createAlphaCodeEmitterPass - Return a pass that emits the collected Alpha code
///
AlphaTargetMachine &TM;
- static const int ID;
+ static const char ID;
AlphaLLRPPass(AlphaTargetMachine &tm)
: MachineFunctionPass((intptr_t)&ID), TM(tm) { }
return Changed;
}
};
- const int AlphaLLRPPass::ID = 0;
+ const char AlphaLLRPPass::ID = 0;
} // end of anonymous namespace
FunctionPass *llvm::createAlphaLLRPPass(AlphaTargetMachine &tm) {
///
class CBackendNameAllUsedStructsAndMergeFunctions : public ModulePass {
public:
- static const int ID;
+ static const char ID;
CBackendNameAllUsedStructsAndMergeFunctions()
: ModulePass((intptr_t)&ID) {}
void getAnalysisUsage(AnalysisUsage &AU) const {
virtual bool runOnModule(Module &M);
};
- const int CBackendNameAllUsedStructsAndMergeFunctions::ID = 0;
+ const char CBackendNameAllUsedStructsAndMergeFunctions::ID = 0;
/// CWriter - This class is the main chunk of code that converts an LLVM
/// module to a C translation unit.
std::set<Function*> intrinsicPrototypesAlreadyGenerated;
public:
- static const int ID;
+ static const char ID;
CWriter(std::ostream &o)
: FunctionPass((intptr_t)&ID), Out(o), IL(0), Mang(0), LI(0),
TheModule(0), TAsm(0), TD(0) {}
};
}
-const int CWriter::ID = 0;
+const char CWriter::ID = 0;
/// This method inserts names for any unnamed structure types that are used by
/// the program, and removes names from structure types that are not used by the
namespace {
struct IA64BundlingPass : public MachineFunctionPass {
- static const int ID;
+ static const char ID;
/// Target machine description which we query for reg. names, data
/// layout, etc.
///
// 'fallthrough' code
std::set<unsigned> PendingRegWrites;
};
- const int IA64BundlingPass::ID = 0;
+ const char IA64BundlingPass::ID = 0;
} // end of anonymous namespace
/// createIA64BundlingPass - Returns a pass that adds STOP (;;) instructions
return Changed;
}
-const int MSILModule::ID = 0;
-const int MSILWriter::ID = 0;
+const char MSILModule::ID = 0;
+const char MSILWriter::ID = 0;
bool MSILWriter::runOnFunction(Function &F) {
if (F.isDeclaration()) return false;
const TargetData*& TD;
public:
- static const int ID;
+ static const char ID;
MSILModule(const std::set<const Type *>*& _UsedTypes,
const TargetData*& _TD)
: ModulePass((intptr_t)&ID), UsedTypes(_UsedTypes), TD(_TD) {}
std::map<const GlobalVariable*,std::vector<StaticInitializer> >
StaticInitList;
const std::set<const Type *>* UsedTypes;
- static const int ID;
+ static const char ID;
MSILWriter(std::ostream &o) : FunctionPass((intptr_t)&ID), Out(o) {
UniqID = 0;
}
namespace {
struct VISIBILITY_HIDDEN PPCBSel : public MachineFunctionPass {
- static const int ID;
+ static const char ID;
PPCBSel() : MachineFunctionPass((intptr_t)&ID) {}
/// BlockSizes - The sizes of the basic blocks in the function.
return "PowerPC Branch Selector";
}
};
- const int PPCBSel::ID = 0;
+ const char PPCBSel::ID = 0;
}
/// createPPCBranchSelectionPass - returns an instance of the Branch Selection
int getMachineOpValue(MachineInstr &MI, MachineOperand &MO);
public:
- static const int ID;
+ static const char ID;
PPCCodeEmitter(TargetMachine &T, MachineCodeEmitter &M)
: MachineFunctionPass((intptr_t)&ID), TM(T), MCE(M) {}
///
unsigned getBinaryCodeForInstr(MachineInstr &MI);
};
- const int PPCCodeEmitter::ID = 0;
+ const char PPCCodeEmitter::ID = 0;
}
/// createPPCCodeEmitterPass - Return a pass that emits the collected PPC code
TargetMachine &TM;
const TargetInstrInfo *TII;
- static const int ID;
+ static const char ID;
Filler(TargetMachine &tm)
: MachineFunctionPass((intptr_t)&ID), TM(tm), TII(tm.getInstrInfo()) { }
}
};
- const int Filler::ID = 0;
+ const char Filler::ID = 0;
} // end of anonymous namespace
/// createSparcDelaySlotFillerPass - Returns a pass that fills in delay
///
TargetMachine &TM;
- static const int ID;
+ static const char ID;
FPMover(TargetMachine &tm)
: MachineFunctionPass((intptr_t)&ID), TM(tm) { }
bool runOnMachineBasicBlock(MachineBasicBlock &MBB);
bool runOnMachineFunction(MachineFunction &F);
};
- const int FPMover::ID = 0;
+ const char FPMover::ID = 0;
} // end of anonymous namespace
/// createSparcFPMoverPass - Returns a pass that turns FpMOVD
// Register the default SparcV9 implementation...
RegisterPass<TargetData> X("targetdata", "Target Data Layout");
}
-const int TargetData::ID = 0;
+const char TargetData::ID = 0;
//===----------------------------------------------------------------------===//
// Support for StructLayout
MachineCodeEmitter &MCE;
bool Is64BitMode;
public:
- static const int ID;
+ static const char ID;
explicit Emitter(TargetMachine &tm, MachineCodeEmitter &mce)
: MachineFunctionPass((intptr_t)&ID), II(0), TD(0), TM(tm),
MCE(mce), Is64BitMode(false) {}
bool isX86_64ExtendedReg(const MachineOperand &MO);
unsigned determineREX(const MachineInstr &MI);
};
- const int Emitter::ID = 0;
+ const char Emitter::ID = 0;
}
/// createX86CodeEmitterPass - Return a pass that emits the collected X86 code
namespace {
struct VISIBILITY_HIDDEN FPS : public MachineFunctionPass {
- static const int ID;
+ static const char ID;
FPS() : MachineFunctionPass((intptr_t)&ID) {}
virtual bool runOnMachineFunction(MachineFunction &MF);
void handleCondMovFP(MachineBasicBlock::iterator &I);
void handleSpecialFP(MachineBasicBlock::iterator &I);
};
- const int FPS::ID = 0;
+ const char FPS::ID = 0;
}
FunctionPass *llvm::createX86FloatingPointStackifierPass() { return new FPS(); }
namespace {
// Hello - The first implementation, without getAnalysisUsage.
struct Hello : public FunctionPass {
- static const int ID; // Pass identifcation, replacement for typeid
+ static const char ID; // Pass identifcation, replacement for typeid
Hello() : FunctionPass((intptr_t)&ID) {}
virtual bool runOnFunction(Function &F) {
}
};
- const int Hello::ID = 0;
+ const char Hello::ID = 0;
RegisterPass<Hello> X("hello", "Hello World Pass");
// Hello2 - The second implementation with getAnalysisUsage implemented.
struct Hello2 : public FunctionPass {
- static const int ID; // Pass identifcation, replacement for typeid
+ static const char ID; // Pass identifcation, replacement for typeid
Hello2() : FunctionPass((intptr_t)&ID) {}
virtual bool runOnFunction(Function &F) {
AU.setPreservesAll();
};
};
- const int Hello2::ID = 0;
+ const char Hello2::ID = 0;
RegisterPass<Hello2> Y("hello2",
"Hello World Pass (with getAnalysisUsage implemented)");
}
}
virtual bool runOnSCC(const std::vector<CallGraphNode *> &SCC);
- static const int ID; // Pass identifcation, replacement for typeid
+ static const char ID; // Pass identifcation, replacement for typeid
ArgPromotion() : CallGraphSCCPass((intptr_t)&ID) {}
private:
Function *DoPromotion(Function *F, std::vector<Argument*> &ArgsToPromote);
};
- const int ArgPromotion::ID = 0;
+ const char ArgPromotion::ID = 0;
RegisterPass<ArgPromotion> X("argpromotion",
"Promote 'by reference' arguments to scalars");
}
namespace {
struct VISIBILITY_HIDDEN ConstantMerge : public ModulePass {
- static const int ID; // Pass identifcation, replacement for typeid
+ static const char ID; // Pass identifcation, replacement for typeid
ConstantMerge() : ModulePass((intptr_t)&ID) {}
// run - For this pass, process all of the globals in the module,
bool runOnModule(Module &M);
};
- const int ConstantMerge::ID = 0;
+ const char ConstantMerge::ID = 0;
RegisterPass<ConstantMerge>X("constmerge","Merge Duplicate Global Constants");
}
std::multimap<Function*, CallSite> CallSites;
public:
- static const int ID; // Pass identifcation, replacement for typeid
+ static const char ID; // Pass identifcation, replacement for typeid
DAE() : ModulePass((intptr_t)&ID) {}
bool runOnModule(Module &M);
void RemoveDeadArgumentsFromFunction(Function *F);
};
- const int DAE::ID = 0;
+ const char DAE::ID = 0;
RegisterPass<DAE> X("deadargelim", "Dead Argument Elimination");
/// DAH - DeadArgumentHacking pass - Same as dead argument elimination, but
/// deletes arguments to functions which are external. This is only for use
/// by bugpoint.
struct DAH : public DAE {
- static const int ID;
+ static const char ID;
virtual bool ShouldHackArguments() const { return true; }
};
- const int DAH::ID = 0;
+ const char DAH::ID = 0;
RegisterPass<DAH> Y("deadarghaX0r",
"Dead Argument Hacking (BUGPOINT USE ONLY; DO NOT USE)");
}
namespace {
struct VISIBILITY_HIDDEN DTE : public ModulePass {
- static const int ID; // Pass identifcation, replacement for typeid
+ static const char ID; // Pass identifcation, replacement for typeid
DTE() : ModulePass((intptr_t)&ID) {}
// doPassInitialization - For this pass, it removes global symbol table
AU.addRequired<FindUsedTypes>();
}
};
- const int DTE::ID = 0;
+ const char DTE::ID = 0;
RegisterPass<DTE> X("deadtypeelim", "Dead Type Elimination");
}
bool deleteFunc;
bool reLink;
public:
- static const int ID; // Pass identifcation, replacement for typeid
+ static const char ID; // Pass identifcation, replacement for typeid
/// FunctionExtractorPass - If deleteFn is true, this pass deletes as the
/// specified function. Otherwise, it deletes as much of the module as
}
};
- const int FunctionExtractorPass::ID = 0;
+ const char FunctionExtractorPass::ID = 0;
RegisterPass<FunctionExtractorPass> X("extract", "Function Extractor");
}
namespace {
struct VISIBILITY_HIDDEN GlobalDCE : public ModulePass {
- static const int ID; // Pass identifcation, replacement for typeid
+ static const char ID; // Pass identifcation, replacement for typeid
GlobalDCE() : ModulePass((intptr_t)&ID) {}
// run - Do the GlobalDCE pass on the specified module, optionally updating
bool SafeToDestroyConstant(Constant* C);
bool RemoveUnusedGlobalValue(GlobalValue &GV);
};
- const int GlobalDCE::ID = 0;
+ const char GlobalDCE::ID = 0;
RegisterPass<GlobalDCE> X("globaldce", "Dead Global Elimination");
}
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.addRequired<TargetData>();
}
- static const int ID; // Pass identifcation, replacement for typeid
+ static const char ID; // Pass identifcation, replacement for typeid
GlobalOpt() : ModulePass((intptr_t)&ID) {}
bool runOnModule(Module &M);
bool ProcessInternalGlobal(GlobalVariable *GV,Module::global_iterator &GVI);
};
- const int GlobalOpt::ID = 0;
+ const char GlobalOpt::ID = 0;
RegisterPass<GlobalOpt> X("globalopt", "Global Variable Optimizer");
}
/// IPCP - The interprocedural constant propagation pass
///
struct VISIBILITY_HIDDEN IPCP : public ModulePass {
- static const int ID; // Pass identifcation, replacement for typeid
+ static const char ID; // Pass identifcation, replacement for typeid
IPCP() : ModulePass((intptr_t)&ID) {}
bool runOnModule(Module &M);
bool PropagateConstantsIntoArguments(Function &F);
bool PropagateConstantReturn(Function &F);
};
- const int IPCP::ID = 0;
+ const char IPCP::ID = 0;
RegisterPass<IPCP> X("ipconstprop", "Interprocedural constant propagation");
}
namespace {
class VISIBILITY_HIDDEN IndMemRemPass : public ModulePass {
public:
- static const int ID; // Pass identifcation, replacement for typeid
+ static const char ID; // Pass identifcation, replacement for typeid
IndMemRemPass() : ModulePass((intptr_t)&ID) {}
virtual bool runOnModule(Module &M);
};
- const int IndMemRemPass::ID = 0;
+ const char IndMemRemPass::ID = 0;
RegisterPass<IndMemRemPass> X("indmemrem","Indirect Malloc and Free Removal");
} // end anonymous namespace
class VISIBILITY_HIDDEN SimpleInliner : public Inliner {
std::map<const Function*, FunctionInfo> CachedFunctionInfo;
public:
- static const int ID; // Pass identifcation, replacement for typeid
+ static const char ID; // Pass identifcation, replacement for typeid
int getInlineCost(CallSite CS);
};
- const int SimpleInliner::ID = 0;
+ const char SimpleInliner::ID = 0;
RegisterPass<SimpleInliner> X("inline", "Function Integration/Inlining");
}
cl::desc("Control the amount of inlining to perform (default = 200)"));
}
-const int Inliner::ID = 0;
+const char Inliner::ID = 0;
Inliner::Inliner()
: CallGraphSCCPass((intptr_t)&ID), InlineThreshold(InlineLimit) {}
/// perform the inlining operations that does not depend on the policy.
///
struct Inliner : public CallGraphSCCPass {
- static const int ID;
+ static const char ID;
Inliner();
/// getAnalysisUsage - For this class, we declare that we require and preserve
std::set<std::string> ExternalNames;
bool DontInternalize;
public:
- static const int ID; // Pass identifcation, replacement for typeid
+ static const char ID; // Pass identifcation, replacement for typeid
InternalizePass(bool InternalizeEverything = true);
InternalizePass(const std::vector <const char *>& exportList);
void LoadFile(const char *Filename);
virtual bool runOnModule(Module &M);
};
- const int InternalizePass::ID = 0;
+ const char InternalizePass::ID = 0;
RegisterPass<InternalizePass> X("internalize", "Internalize Global Symbols");
} // end anonymous namespace
// Module passes to require FunctionPasses, so we can't get loop info if we're
// not a function pass.
struct VISIBILITY_HIDDEN LoopExtractor : public FunctionPass {
- static const int ID; // Pass identifcation, replacement for typeid
+ static const char ID; // Pass identifcation, replacement for typeid
unsigned NumLoops;
LoopExtractor(unsigned numLoops = ~0)
}
};
- const int LoopExtractor::ID = 0;
+ const char LoopExtractor::ID = 0;
RegisterPass<LoopExtractor>
X("loop-extract", "Extract loops into new functions");
/// SingleLoopExtractor - For bugpoint.
struct SingleLoopExtractor : public LoopExtractor {
- static const int ID; // Pass identifcation, replacement for typeid
+ static const char ID; // Pass identifcation, replacement for typeid
SingleLoopExtractor() : LoopExtractor(1) {}
};
- const int SingleLoopExtractor::ID = 0;
+ const char SingleLoopExtractor::ID = 0;
RegisterPass<SingleLoopExtractor>
Y("loop-extract-single", "Extract at most one loop into a new function");
} // End anonymous namespace
class BlockExtractorPass : public ModulePass {
std::vector<BasicBlock*> BlocksToNotExtract;
public:
- static const int ID; // Pass identifcation, replacement for typeid
+ static const char ID; // Pass identifcation, replacement for typeid
BlockExtractorPass(std::vector<BasicBlock*> &B)
: ModulePass((intptr_t)&ID), BlocksToNotExtract(B) {}
BlockExtractorPass() : ModulePass((intptr_t)&ID) {}
bool runOnModule(Module &M);
};
- const int BlockExtractorPass::ID = 0;
+ const char BlockExtractorPass::ID = 0;
RegisterPass<BlockExtractorPass>
XX("extract-blocks", "Extract Basic Blocks From Module (for bugpoint use)");
}
bool IsTransformableFunction(const std::string& Name);
public:
- static const int ID; // Pass identifcation, replacement for typeid
+ static const char ID; // Pass identifcation, replacement for typeid
LowerSetJmp() : ModulePass((intptr_t)&ID) {}
void visitCallInst(CallInst& CI);
bool doInitialization(Module& M);
};
- const int LowerSetJmp::ID = 0;
+ const char LowerSetJmp::ID = 0;
RegisterPass<LowerSetJmp> X("lowersetjmp", "Lower Set Jump");
} // end anonymous namespace
namespace {
struct VISIBILITY_HIDDEN PruneEH : public CallGraphSCCPass {
- static const int ID; // Pass identifcation, replacement for typeid
+ static const char ID; // Pass identifcation, replacement for typeid
PruneEH() : CallGraphSCCPass((intptr_t)&ID) {}
/// DoesNotUnwind - This set contains all of the functions which we have
void DeleteBasicBlock(BasicBlock *BB);
};
- const int PruneEH::ID = 0;
+ const char PruneEH::ID = 0;
RegisterPass<PruneEH> X("prune-eh", "Remove unused exception handling info");
}
Function *MallocFunc; // Functions in the module we are processing
Function *FreeFunc; // Initialized by doPassInitializationVirt
public:
- static const int ID; // Pass identifcation, replacement for typeid
+ static const char ID; // Pass identifcation, replacement for typeid
RaiseAllocations()
: ModulePass((intptr_t)&ID), MallocFunc(0), FreeFunc(0) {}
bool runOnModule(Module &M);
};
- const int RaiseAllocations::ID = 0;
+ const char RaiseAllocations::ID = 0;
RegisterPass<RaiseAllocations>
X("raiseallocs", "Raise allocations from calls to instructions");
} // end anonymous namespace
/// @brief A ModulePass for optimizing well-known function calls.
class VISIBILITY_HIDDEN SimplifyLibCalls : public ModulePass {
public:
- static const int ID; // Pass identifcation, replacement for typeid
+ static const char ID; // Pass identifcation, replacement for typeid
SimplifyLibCalls() : ModulePass((intptr_t)&ID) {}
/// We need some target data for accurate signature details that are
TargetData *TD; ///< Cached TargetData
};
-const int SimplifyLibCalls::ID = 0;
+const char SimplifyLibCalls::ID = 0;
// Register the pass
RegisterPass<SimplifyLibCalls>
X("simplify-libcalls", "Simplify well-known library calls");
/// @brief Pass to remove unused function declarations.
class VISIBILITY_HIDDEN StripDeadPrototypesPass : public ModulePass {
public:
- static const int ID; // Pass identifcation, replacement for typeid
+ static const char ID; // Pass identifcation, replacement for typeid
StripDeadPrototypesPass() : ModulePass((intptr_t)&ID) { }
virtual bool runOnModule(Module &M);
};
-const int StripDeadPrototypesPass::ID = 0;
+const char StripDeadPrototypesPass::ID = 0;
RegisterPass<StripDeadPrototypesPass> X("strip-dead-prototypes",
"Strip Unused Function Prototypes");
class VISIBILITY_HIDDEN StripSymbols : public ModulePass {
bool OnlyDebugInfo;
public:
- static const int ID; // Pass identifcation, replacement for typeid
+ static const char ID; // Pass identifcation, replacement for typeid
StripSymbols(bool ODI = false)
: ModulePass((intptr_t)&ID), OnlyDebugInfo(ODI) {}
}
};
- const int StripSymbols::ID = 0;
+ const char StripSymbols::ID = 0;
RegisterPass<StripSymbols> X("strip", "Strip all symbols from a module");
}
namespace {
class VISIBILITY_HIDDEN FunctionProfiler : public RSProfilers_std {
public:
- static const int ID;
+ static const char ID;
bool runOnModule(Module &M);
};
- const int FunctionProfiler::ID = 0;
+ const char FunctionProfiler::ID = 0;
RegisterPass<FunctionProfiler> X("insert-function-profiling",
"Insert instrumentation for function profiling");
class BlockProfiler : public RSProfilers_std {
bool runOnModule(Module &M);
public:
- static const int ID;
+ static const char ID;
};
- const int BlockProfiler::ID = 0;
+ const char BlockProfiler::ID = 0;
RegisterPass<BlockProfiler> Y("insert-block-profiling",
"Insert instrumentation for block profiling");
RegisterAnalysisGroup<RSProfilers> YG(Y);
class VISIBILITY_HIDDEN EdgeProfiler : public ModulePass {
bool runOnModule(Module &M);
public:
- static const int ID; // Pass identifcation, replacement for typeid
+ static const char ID; // Pass identifcation, replacement for typeid
EdgeProfiler() : ModulePass((intptr_t)&ID) {}
};
- const int EdgeProfiler::ID = 0;
+ const char EdgeProfiler::ID = 0;
RegisterPass<EdgeProfiler> X("insert-edge-profiling",
"Insert instrumentation for edge profiling");
}
/// measuring framework overhead
class VISIBILITY_HIDDEN NullProfilerRS : public RSProfilers {
public:
- static const int ID; // Pass identifcation, replacement for typeid
+ static const char ID; // Pass identifcation, replacement for typeid
bool isProfiling(Value* v) {
return false;
}
/// ProfilerRS - Insert the random sampling framework
struct VISIBILITY_HIDDEN ProfilerRS : public FunctionPass {
- static const int ID; // Pass identifcation, replacement for typeid
+ static const char ID; // Pass identifcation, replacement for typeid
ProfilerRS() : FunctionPass((intptr_t)&ID) {}
std::map<Value*, Value*> TransCache;
"Insert random sampling instrumentation framework");
}
-const int RSProfilers::ID = 0;
-const int NullProfilerRS::ID = 0;
-const int ProfilerRS::ID = 0;
+const char RSProfilers::ID = 0;
+const char NullProfilerRS::ID = 0;
+const char ProfilerRS::ID = 0;
//Local utilities
static void ReplacePhiPred(BasicBlock* btarget,
/// RSProfilers_std - a simple support class for profilers that handles most
/// of the work of chaining and tracking inserted code.
struct RSProfilers_std : public RSProfilers {
- static const int ID;
+ static const char ID;
std::set<Value*> profcode;
// Lookup up values in profcode
virtual bool isProfiling(Value* v);
// The public interface for this class
//
public:
- static const int ID; // Pass identifcation, replacement for typeid
+ static const char ID; // Pass identifcation, replacement for typeid
ADCE() : FunctionPass((intptr_t)&ID) {}
// Execute the Aggressive Dead Code Elimination Algorithm
}
};
- const int ADCE::ID = 0;
+ const char ADCE::ID = 0;
RegisterPass<ADCE> X("adce", "Aggressive Dead Code Elimination");
} // End of anonymous namespace
namespace {
struct VISIBILITY_HIDDEN BlockPlacement : public FunctionPass {
- static const int ID; // Pass identifcation, replacement for typeid
+ static const char ID; // Pass identifcation, replacement for typeid
BlockPlacement() : FunctionPass((intptr_t)&ID) {}
virtual bool runOnFunction(Function &F);
void PlaceBlocks(BasicBlock *BB);
};
- const int BlockPlacement::ID = 0;
+ const char BlockPlacement::ID = 0;
RegisterPass<BlockPlacement> X("block-placement",
"Profile Guided Basic Block Placement");
}
/// transformation profitability.
const TargetLowering *TLI;
public:
- static const int ID; // Pass identifcation, replacement for typeid
+ static const char ID; // Pass identifcation, replacement for typeid
CodeGenPrepare(const TargetLowering *tli = 0) : FunctionPass((intptr_t)&ID),
TLI(tli) {}
bool runOnFunction(Function &F);
};
}
-const int CodeGenPrepare::ID = 0;
+const char CodeGenPrepare::ID = 0;
static RegisterPass<CodeGenPrepare> X("codegenprepare",
"Optimize for code generation");
namespace {
struct VISIBILITY_HIDDEN CondProp : public FunctionPass {
- static const int ID; // Pass identifcation, replacement for typeid
+ static const char ID; // Pass identifcation, replacement for typeid
CondProp() : FunctionPass((intptr_t)&ID) {}
virtual bool runOnFunction(Function &F);
void RevectorBlockTo(BasicBlock *FromBB, BasicBlock *ToBB);
};
- const int CondProp::ID = 0;
+ const char CondProp::ID = 0;
RegisterPass<CondProp> X("condprop", "Conditional Propagation");
}
namespace {
struct VISIBILITY_HIDDEN ConstantPropagation : public FunctionPass {
- static const int ID; // Pass identifcation, replacement for typeid
+ static const char ID; // Pass identifcation, replacement for typeid
ConstantPropagation() : FunctionPass((intptr_t)&ID) {}
bool runOnFunction(Function &F);
}
};
- const int ConstantPropagation::ID = 0;
+ const char ConstantPropagation::ID = 0;
RegisterPass<ConstantPropagation> X("constprop",
"Simple constant propagation");
}
std::map<BasicBlock*, RegionInfo> RegionInfoMap;
ETForest *EF;
public:
- static const int ID; // Pass identifcation, replacement for typeid
+ static const char ID; // Pass identifcation, replacement for typeid
CEE() : FunctionPass((intptr_t)&ID) {}
virtual bool runOnFunction(Function &F);
bool SimplifyInstruction(Instruction *Inst, const RegionInfo &RI);
};
- const int CEE::ID = 0;
+ const char CEE::ID = 0;
RegisterPass<CEE> X("cee", "Correlated Expression Elimination");
}
// DeadInstElimination pass implementation
//
struct VISIBILITY_HIDDEN DeadInstElimination : public BasicBlockPass {
- static const int ID; // Pass identifcation, replacement for typeid
+ static const char ID; // Pass identifcation, replacement for typeid
DeadInstElimination() : BasicBlockPass(intptr_t(&ID)) {}
virtual bool runOnBasicBlock(BasicBlock &BB) {
bool Changed = false;
}
};
- const int DeadInstElimination::ID = 0;
+ const char DeadInstElimination::ID = 0;
RegisterPass<DeadInstElimination> X("die", "Dead Instruction Elimination");
}
// DeadCodeElimination pass implementation
//
struct DCE : public FunctionPass {
- static const int ID; // Pass identifcation, replacement for typeid
+ static const char ID; // Pass identifcation, replacement for typeid
DCE() : FunctionPass((intptr_t)&ID) {}
virtual bool runOnFunction(Function &F);
}
};
- const int DCE::ID = 0;
+ const char DCE::ID = 0;
RegisterPass<DCE> Y("dce", "Dead Code Elimination");
}
namespace {
struct VISIBILITY_HIDDEN DSE : public FunctionPass {
- static const int ID; // Pass identifcation, replacement for typeid
+ static const char ID; // Pass identifcation, replacement for typeid
DSE() : FunctionPass((intptr_t)&ID) {}
virtual bool runOnFunction(Function &F) {
AU.addPreserved<AliasAnalysis>();
}
};
- const int DSE::ID = 0;
+ const char DSE::ID = 0;
RegisterPass<DSE> X("dse", "Dead Store Elimination");
}
"with constant values");
namespace {
struct VISIBILITY_HIDDEN GCSE : public FunctionPass {
- static const int ID; // Pass identifcation, replacement for typeid
+ static const char ID; // Pass identifcation, replacement for typeid
GCSE() : FunctionPass((intptr_t)&ID) {}
virtual bool runOnFunction(Function &F);
}
};
- const int GCSE::ID = 0;
+ const char GCSE::ID = 0;
RegisterPass<GCSE> X("gcse", "Global Common Subexpression Elimination");
}
bool Changed;
public:
- static const int ID; // Pass identifcation, replacement for typeid
+ static const char ID; // Pass identifcation, replacement for typeid
IndVarSimplify() : LoopPass((intptr_t)&ID) {}
bool runOnLoop(Loop *L, LPPassManager &LPM);
void DeleteTriviallyDeadInstructions(std::set<Instruction*> &Insts);
};
- const int IndVarSimplify::ID = 0;
+ const char IndVarSimplify::ID = 0;
RegisterPass<IndVarSimplify> X("indvars", "Canonicalize Induction Variables");
}
TargetData *TD;
bool MustPreserveLCSSA;
public:
- static const int ID; // Pass identifcation, replacement for typeid
+ static const char ID; // Pass identifcation, replacement for typeid
InstCombiner() : FunctionPass((intptr_t)&ID) {}
/// AddToWorkList - Add the specified instruction to the worklist if it
Value *EvaluateInDifferentType(Value *V, const Type *Ty, bool isSigned);
};
- const int InstCombiner::ID = 0;
+ const char InstCombiner::ID = 0;
RegisterPass<InstCombiner> X("instcombine", "Combine redundant instructions");
}
cl::desc("Disable memory promotion in LICM pass"));
struct VISIBILITY_HIDDEN LICM : public LoopPass {
- static const int ID; // Pass identifcation, replacement for typeid
+ static const char ID; // Pass identifcation, replacement for typeid
LICM() : LoopPass((intptr_t)&ID) {}
virtual bool runOnLoop(Loop *L, LPPassManager &LPM);
std::map<Value*, AllocaInst*> &Val2AlMap);
};
- const int LICM::ID = 0;
+ const char LICM::ID = 0;
RegisterPass<LICM> X("licm", "Loop Invariant Code Motion");
}
class VISIBILITY_HIDDEN LoopRotate : public LoopPass {
public:
- static const int ID; // Pass ID, replacement for typeid
+ static const char ID; // Pass ID, replacement for typeid
LoopRotate() : LoopPass((intptr_t)&ID) {}
// Rotate Loop L as many times as possible. Return true if
SmallVector<RenameData, MAX_HEADER_SIZE> LoopHeaderInfo;
};
- const int LoopRotate::ID = 0;
+ const char LoopRotate::ID = 0;
RegisterPass<LoopRotate> X ("loop-rotate", "Rotate Loops");
}
const TargetLowering *TLI;
public:
- static const int ID; // Pass ID, replacement for typeid
+ static const char ID; // Pass ID, replacement for typeid
LoopStrengthReduce(const TargetLowering *tli = NULL) :
LoopPass((intptr_t)&ID), TLI(tli) {
}
Loop *L, bool isOnlyStride);
void DeleteTriviallyDeadInstructions(std::set<Instruction*> &Insts);
};
- const int LoopStrengthReduce::ID = 0;
+ const char LoopStrengthReduce::ID = 0;
RegisterPass<LoopStrengthReduce> X("loop-reduce", "Loop Strength Reduction");
}
class VISIBILITY_HIDDEN LoopUnroll : public LoopPass {
LoopInfo *LI; // The current loop information
public:
- static const int ID; // Pass ID, replacement for typeid
+ static const char ID; // Pass ID, replacement for typeid
LoopUnroll() : LoopPass((intptr_t)&ID) {}
bool runOnLoop(Loop *L, LPPassManager &LPM);
AU.addPreserved<LoopInfo>();
}
};
- const int LoopUnroll::ID = 0;
+ const char LoopUnroll::ID = 0;
RegisterPass<LoopUnroll> X("loop-unroll", "Unroll loops");
}
SmallPtrSet<Value *,8> UnswitchedVals;
public:
- static const int ID; // Pass ID, replacement for typeid
+ static const char ID; // Pass ID, replacement for typeid
LoopUnswitch() : LoopPass((intptr_t)&ID) {}
bool runOnLoop(Loop *L, LPPassManager &LPM);
std::vector<Instruction*> &Worklist);
void RemoveLoopFromHierarchy(Loop *L);
};
- const int LoopUnswitch::ID = 0;
+ const char LoopUnswitch::ID = 0;
RegisterPass<LoopUnswitch> X("loop-unswitch", "Unswitch loops");
}
/// had zero roots.
const Type *MainRootRecordType;
public:
- static const int ID; // Pass identifcation, replacement for typeid
+ static const char ID; // Pass identifcation, replacement for typeid
LowerGC() : FunctionPass((intptr_t)&ID),
GCRootInt(0), GCReadInt(0), GCWriteInt(0),
GCRead(0), GCWrite(0), RootChain(0), MainRootRecordType(0) {}
const StructType *getRootRecordType(unsigned NumRoots);
};
- const int LowerGC::ID = 0;
+ const char LowerGC::ID = 0;
RegisterPass<LowerGC>
X("lowergc", "Lower GC intrinsics, for GCless code generators");
}
class VISIBILITY_HIDDEN LowerPacked
: public FunctionPass, public InstVisitor<LowerPacked> {
public:
- static const int ID; // Pass identifcation, replacement for typeid
+ static const char ID; // Pass identifcation, replacement for typeid
LowerPacked() : FunctionPass((intptr_t)&ID) {}
/// @brief Lowers packed operations to scalar operations.
std::vector<Instruction*> instrsToRemove;
};
-const int LowerPacked::ID = 0;
+const char LowerPacked::ID = 0;
RegisterPass<LowerPacked>
X("lower-packed",
"lowers packed operations to operations on smaller packed datatypes");
std::vector<DominatorTree::Node *> WorkList;
public:
- static const int ID; // Pass identifcation, replacement for typeid
+ static const char ID; // Pass identifcation, replacement for typeid
PredicateSimplifier() : FunctionPass((intptr_t)&ID) {}
bool runOnFunction(Function &F);
}
}
- const int PredicateSimplifier::ID = 0;
+ const char PredicateSimplifier::ID = 0;
RegisterPass<PredicateSimplifier> X("predsimplify",
"Predicate Simplifier");
}
std::map<Value*, unsigned> ValueRankMap;
bool MadeChange;
public:
- static const int ID; // Pass identifcation, replacement for typeid
+ static const char ID; // Pass identifcation, replacement for typeid
Reassociate() : FunctionPass((intptr_t)&ID) {}
bool runOnFunction(Function &F);
void RemoveDeadBinaryOp(Value *V);
};
- const int Reassociate::ID = 0;
+ const char Reassociate::ID = 0;
RegisterPass<Reassociate> X("reassociate", "Reassociate expressions");
}
namespace {
struct VISIBILITY_HIDDEN RegToMem : public FunctionPass {
- static const int ID; // Pass identifcation, replacement for typeid
+ static const char ID; // Pass identifcation, replacement for typeid
RegToMem() : FunctionPass((intptr_t)&ID) {}
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
}
};
- const int RegToMem::ID = 0;
+ const char RegToMem::ID = 0;
RegisterPass<RegToMem> X("reg2mem", "Demote all values to stack slots");
}
/// Sparse Conditional Constant Propagator.
///
struct VISIBILITY_HIDDEN SCCP : public FunctionPass {
- static const int ID; // Pass identifcation, replacement for typeid
+ static const char ID; // Pass identifcation, replacement for typeid
SCCP() : FunctionPass((intptr_t)&ID) {}
// runOnFunction - Run the Sparse Conditional Constant Propagation
}
};
- const int SCCP::ID = 0;
+ const char SCCP::ID = 0;
RegisterPass<SCCP> X("sccp", "Sparse Conditional Constant Propagation");
} // end anonymous namespace
/// Constant Propagation.
///
struct VISIBILITY_HIDDEN IPSCCP : public ModulePass {
- static const int ID;
+ static const char ID;
IPSCCP() : ModulePass((intptr_t)&ID) {}
bool runOnModule(Module &M);
};
- const int IPSCCP::ID = 0;
+ const char IPSCCP::ID = 0;
RegisterPass<IPSCCP>
Y("ipsccp", "Interprocedural Sparse Conditional Constant Propagation");
} // end anonymous namespace
namespace {
struct VISIBILITY_HIDDEN SROA : public FunctionPass {
- static const int ID; // Pass identifcation, replacement for typeid
+ static const char ID; // Pass identifcation, replacement for typeid
SROA() : FunctionPass((intptr_t)&ID) {}
bool runOnFunction(Function &F);
static Instruction *isOnlyCopiedFromConstantGlobal(AllocationInst *AI);
};
- const int SROA::ID = 0;
+ const char SROA::ID = 0;
RegisterPass<SROA> X("scalarrepl", "Scalar Replacement of Aggregates");
}
namespace {
struct VISIBILITY_HIDDEN CFGSimplifyPass : public FunctionPass {
- static const int ID; // Pass identifcation, replacement for typeid
+ static const char ID; // Pass identifcation, replacement for typeid
CFGSimplifyPass() : FunctionPass((intptr_t)&ID) {}
virtual bool runOnFunction(Function &F);
};
- const int CFGSimplifyPass::ID = 0;
+ const char CFGSimplifyPass::ID = 0;
RegisterPass<CFGSimplifyPass> X("simplifycfg", "Simplify the CFG");
}
class VISIBILITY_HIDDEN TailDup : public FunctionPass {
bool runOnFunction(Function &F);
public:
- static const int ID; // Pass identifcation, replacement for typeid
+ static const char ID; // Pass identifcation, replacement for typeid
TailDup() : FunctionPass((intptr_t)&ID) {}
private:
inline bool shouldEliminateUnconditionalBranch(TerminatorInst *TI);
inline void eliminateUnconditionalBranch(BranchInst *BI);
};
- const int TailDup::ID = 0;
+ const char TailDup::ID = 0;
RegisterPass<TailDup> X("tailduplicate", "Tail Duplication");
}
namespace {
struct VISIBILITY_HIDDEN TailCallElim : public FunctionPass {
- static const int ID; // Pass identifcation, replacement for typeid
+ static const char ID; // Pass identifcation, replacement for typeid
TailCallElim() : FunctionPass((intptr_t)&ID) {}
virtual bool runOnFunction(Function &F);
bool CanMoveAboveCall(Instruction *I, CallInst *CI);
Value *CanTransformAccumulatorRecursion(Instruction *I, CallInst *CI);
};
- const int TailCallElim::ID = 0;
+ const char TailCallElim::ID = 0;
RegisterPass<TailCallElim> X("tailcallelim", "Tail Call Elimination");
}
namespace {
struct VISIBILITY_HIDDEN BreakCriticalEdges : public FunctionPass {
- static const int ID; // Pass identifcation, replacement for typeid
+ static const char ID; // Pass identifcation, replacement for typeid
BreakCriticalEdges() : FunctionPass((intptr_t)&ID) {}
virtual bool runOnFunction(Function &F);
}
};
- const int BreakCriticalEdges::ID = 0;
+ const char BreakCriticalEdges::ID = 0;
RegisterPass<BreakCriticalEdges> X("break-crit-edges",
"Break critical edges in CFG");
}
namespace {
struct VISIBILITY_HIDDEN LCSSA : public FunctionPass {
- static const int ID; // Pass identifcation, replacement for typeid
+ static const char ID; // Pass identifcation, replacement for typeid
LCSSA() : FunctionPass((intptr_t)&ID) {}
// Cached analysis information for the current function.
}
};
- const int LCSSA::ID = 0;
+ const char LCSSA::ID = 0;
RegisterPass<LCSSA> X("lcssa", "Loop-Closed SSA Form Pass");
}
namespace {
struct VISIBILITY_HIDDEN LoopSimplify : public FunctionPass {
- static const int ID; // Pass identifcation, replacement for typeid
+ static const char ID; // Pass identifcation, replacement for typeid
LoopSimplify() : FunctionPass((intptr_t)&ID) {}
// AA - If we have an alias analysis object to update, this is it, otherwise
std::vector<BasicBlock*> &PredBlocks);
};
- const int LoopSimplify::ID = 0;
+ const char LoopSimplify::ID = 0;
RegisterPass<LoopSimplify>
X("loopsimplify", "Canonicalize natural loops", true);
}
Constant *FreeFunc; // Initialized by doInitialization
bool LowerMallocArgToInteger;
public:
- static const int ID; // Pass ID, replacement for typeid
+ static const char ID; // Pass ID, replacement for typeid
LowerAllocations(bool LowerToInt = false)
: BasicBlockPass((intptr_t)&ID), MallocFunc(0), FreeFunc(0),
LowerMallocArgToInteger(LowerToInt) {}
bool runOnBasicBlock(BasicBlock &BB);
};
- const int LowerAllocations::ID = 0;
+ const char LowerAllocations::ID = 0;
RegisterPass<LowerAllocations>
X("lowerallocs", "Lower allocations from instructions to calls");
}
const TargetLowering *TLI;
public:
- static const int ID; // Pass identifcation, replacement for typeid
+ static const char ID; // Pass identifcation, replacement for typeid
LowerInvoke(const TargetLowering *tli = NULL) : FunctionPass((intptr_t)&ID),
TLI(tli) { }
bool doInitialization(Module &M);
bool insertExpensiveEHSupport(Function &F);
};
- const int LowerInvoke::ID = 0;
+ const char LowerInvoke::ID = 0;
RegisterPass<LowerInvoke>
X("lowerinvoke", "Lower invoke and unwind, for unwindless code generators");
}
class VISIBILITY_HIDDEN LowerSelect : public FunctionPass {
bool OnlyFP; // Only lower FP select instructions?
public:
- static const int ID; // Pass identifcation, replacement for typeid
+ static const char ID; // Pass identifcation, replacement for typeid
LowerSelect(bool onlyfp = false) : FunctionPass((intptr_t)&ID),
OnlyFP(onlyfp) {}
bool runOnFunction(Function &F);
};
- const int LowerSelect::ID = 0;
+ const char LowerSelect::ID = 0;
RegisterPass<LowerSelect>
X("lowerselect", "Lower select instructions to branches");
}
/// modifies the CFG!
class VISIBILITY_HIDDEN LowerSwitch : public FunctionPass {
public:
- static const int ID; // Pass identifcation, replacement for typeid
+ static const char ID; // Pass identifcation, replacement for typeid
LowerSwitch() : FunctionPass((intptr_t) &ID) {}
virtual bool runOnFunction(Function &F);
}
};
- const int LowerSwitch::ID = 0;
+ const char LowerSwitch::ID = 0;
RegisterPass<LowerSwitch>
X("lowerswitch", "Lower SwitchInst's to branches");
}
namespace {
struct VISIBILITY_HIDDEN PromotePass : public FunctionPass {
- static const int ID; // Pass identifcation, replacement for typeid
+ static const char ID; // Pass identifcation, replacement for typeid
PromotePass() : FunctionPass((intptr_t)&ID) {}
// runOnFunction - To run this pass, first we calculate the alloca
}
};
- const int PromotePass::ID = 0;
+ const char PromotePass::ID = 0;
RegisterPass<PromotePass> X("mem2reg", "Promote Memory to Register");
} // end of anonymous namespace
#include "llvm/Type.h"
using namespace llvm;
-const int UnifyFunctionExitNodes::ID = 0;
+const char UnifyFunctionExitNodes::ID = 0;
static RegisterPass<UnifyFunctionExitNodes>
X("mergereturn", "Unify function exit nodes");
} // end namespace llvm
-const int PrintModulePass::ID = 0;
+const char PrintModulePass::ID = 0;
static RegisterPass<PrintModulePass>
X("printm", "Print module to stderr");
-const int PrintFunctionPass::ID = 0;
+const char PrintFunctionPass::ID = 0;
static RegisterPass<PrintFunctionPass>
Y("print","Print function to stderr");
//
//===----------------------------------------------------------------------===//
-const int DominatorTree::ID = 0;
+const char DominatorTree::ID = 0;
static RegisterPass<DominatorTree>
E("domtree", "Dominator Tree Construction", true);
// DominanceFrontier Implementation
//===----------------------------------------------------------------------===//
-const int DominanceFrontier::ID = 0;
+const char DominanceFrontier::ID = 0;
static RegisterPass<DominanceFrontier>
G("domfrontier", "Dominance Frontier Construction", true);
// ETForest implementation
//===----------------------------------------------------------------------===//
-const int ETForest::ID = 0;
+const char ETForest::ID = 0;
static RegisterPass<ETForest>
D("etforest", "ET Forest Construction", true);
public FunctionPass {
public:
- static const int ID;
+ static const char ID;
BBPassManager(int Depth)
: PMDataManager(Depth), FunctionPass((intptr_t)&ID) {}
}
};
-const int BBPassManager::ID = 0;
+const char BBPassManager::ID = 0;
}
namespace llvm {
public PMDataManager,
public PMTopLevelManager {
public:
- static const int ID;
+ static const char ID;
FunctionPassManagerImpl(int Depth) :
Pass((intptr_t)&ID), PMDataManager(Depth),
PMTopLevelManager(TLM_Function) { }
}
};
-const int FunctionPassManagerImpl::ID = 0;
+const char FunctionPassManagerImpl::ID = 0;
//===----------------------------------------------------------------------===//
// MPPassManager
//
class MPPassManager : public Pass, public PMDataManager {
public:
- static const int ID;
+ static const char ID;
MPPassManager(int Depth) : Pass((intptr_t)&ID), PMDataManager(Depth) { }
// Delete on the fly managers.
std::map<Pass *, FunctionPassManagerImpl *> OnTheFlyManagers;
};
-const int MPPassManager::ID = 0;
+const char MPPassManager::ID = 0;
//===----------------------------------------------------------------------===//
// PassManagerImpl
//
public PMTopLevelManager {
public:
- static const int ID;
+ static const char ID;
PassManagerImpl(int Depth) : Pass((intptr_t)&ID), PMDataManager(Depth),
PMTopLevelManager(TLM_Pass) { }
};
-const int PassManagerImpl::ID = 0;
+const char PassManagerImpl::ID = 0;
} // End of llvm namespace
namespace {
//===----------------------------------------------------------------------===//
// FPPassManager implementation
-const int FPPassManager::ID = 0;
+const char FPPassManager::ID = 0;
/// Print passes managed by this manager
void FPPassManager::dumpPassStructure(unsigned Offset) {
llvm::cerr << std::string(Offset*2, ' ') << "FunctionPass Manager\n";
struct VISIBILITY_HIDDEN
Verifier : public FunctionPass, InstVisitor<Verifier> {
- static const int ID; // Pass ID, replacement for typeid
+ static const char ID; // Pass ID, replacement for typeid
bool Broken; // Is this module found to be broken?
bool RealPass; // Are we not being run by a PassManager?
VerifierFailureAction action;
}
};
- const int Verifier::ID = 0;
+ const char Verifier::ID = 0;
RegisterPass<Verifier> X("verify", "Module Verifier");
} // End anonymous namespace
class BlockExtractorPass : public ModulePass {
bool runOnModule(Module &M);
public:
- static const int ID; // Pass ID, replacement for typeid
+ static const char ID; // Pass ID, replacement for typeid
BlockExtractorPass() : ModulePass((intptr_t)&ID) {}
};
- const int BlockExtractorPass::ID = 0;
+ const char BlockExtractorPass::ID = 0;
RegisterPass<BlockExtractorPass>
XX("extract-bbs", "Extract Basic Blocks From Module (for bugpoint use)");
}
/// crashes on any call instructions.
class CrashOnCalls : public BasicBlockPass {
public:
- static const int ID; // Pass ID, replacement for typeid
+ static const char ID; // Pass ID, replacement for typeid
CrashOnCalls() : BasicBlockPass((intptr_t)&ID) {}
private:
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
}
};
- const int CrashOnCalls::ID = 0;
+ const char CrashOnCalls::ID = 0;
RegisterPass<CrashOnCalls>
X("bugpoint-crashcalls",
"BugPoint Test Pass - Intentionally crash on CallInsts");
/// deletes some call instructions, "misoptimizing" the program.
class DeleteCalls : public BasicBlockPass {
public:
- static const int ID; // Pass ID, replacement for typeid
+ static const char ID; // Pass ID, replacement for typeid
DeleteCalls() : BasicBlockPass((intptr_t)&ID) {}
private:
bool runOnBasicBlock(BasicBlock &BB) {
}
};
- const int DeleteCalls::ID = 0;
+ const char DeleteCalls::ID = 0;
RegisterPass<DeleteCalls>
Y("bugpoint-deletecalls",
"BugPoint Test Pass - Intentionally 'misoptimize' CallInsts");
/// useful when looking for standard library functions we should constant fold
/// or handle in alias analyses.
struct ExternalFunctionsPassedConstants : public ModulePass {
- static const int ID; // Pass ID, replacement for typeid
+ static const char ID; // Pass ID, replacement for typeid
ExternalFunctionsPassedConstants() : ModulePass((intptr_t)&ID) {}
virtual bool runOnModule(Module &M) {
for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
}
};
- const int ExternalFunctionsPassedConstants::ID = 0;
+ const char ExternalFunctionsPassedConstants::ID = 0;
RegisterPass<ExternalFunctionsPassedConstants>
P1("externalfnconstants", "Print external fn callsites passed constants");
struct CallGraphPrinter : public ModulePass {
- static const int ID; // Pass ID, replacement for typeid
+ static const char ID; // Pass ID, replacement for typeid
CallGraphPrinter() : ModulePass((intptr_t)&ID) {}
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
}
};
- const int CallGraphPrinter::ID = 0;
+ const char CallGraphPrinter::ID = 0;
RegisterPass<CallGraphPrinter>
P2("callgraph", "Print a call graph");
}
namespace {
struct CallGraphPrinter : public ModulePass {
- static const int ID; // Pass ID, replacement for typeid
+ static const char ID; // Pass ID, replacement for typeid
CallGraphPrinter() : ModulePass((intptr_t)&ID) {}
virtual bool runOnModule(Module &M) {
}
};
- const int CallGraphPrinter::ID = 0;
+ const char CallGraphPrinter::ID = 0;
RegisterPass<CallGraphPrinter> P2("print-callgraph",
"Print Call Graph to 'dot' file");
}
namespace {
struct CFGSCC : public FunctionPass {
- static const int ID; // Pass identification, replacement for typeid
+ static const char ID; // Pass identification, replacement for typeid
CFGSCC() : FunctionPass((intptr_t)&ID) {}
bool runOnFunction(Function& func);
};
struct CallGraphSCC : public ModulePass {
- static const int ID; // Pass identification, replacement for typeid
+ static const char ID; // Pass identification, replacement for typeid
CallGraphSCC() : ModulePass((intptr_t)&ID) {}
// run - Print out SCCs in the call graph for the specified module.
}
};
- const int CFGSCC::ID = 0;
+ const char CFGSCC::ID = 0;
RegisterPass<CFGSCC>
Y("cfgscc", "Print SCCs of each function CFG");
- const int CallGraphSCC::ID = 0;
+ const char CallGraphSCC::ID = 0;
RegisterPass<CallGraphSCC>
Z("callscc", "Print SCCs of the Call Graph");
}
namespace {
struct ModulePassPrinter : public ModulePass {
- static const int ID;
+ static const char ID;
const PassInfo *PassToPrint;
ModulePassPrinter(const PassInfo *PI) : ModulePass((intptr_t)&ID),
PassToPrint(PI) {}
}
};
-const int ModulePassPrinter::ID = 0;
+const char ModulePassPrinter::ID = 0;
struct FunctionPassPrinter : public FunctionPass {
const PassInfo *PassToPrint;
- static const int ID;
+ static const char ID;
FunctionPassPrinter(const PassInfo *PI) : FunctionPass((intptr_t)&ID),
PassToPrint(PI) {}
}
};
-const int FunctionPassPrinter::ID = 0;
+const char FunctionPassPrinter::ID = 0;
struct BasicBlockPassPrinter : public BasicBlockPass {
const PassInfo *PassToPrint;
- static const int ID;
+ static const char ID;
BasicBlockPassPrinter(const PassInfo *PI)
: BasicBlockPass((intptr_t)&ID), PassToPrint(PI) {}
}
};
-const int BasicBlockPassPrinter::ID = 0;
+const char BasicBlockPassPrinter::ID = 0;
inline void addPass(PassManager &PM, Pass *P) {
// Add the pass to the pass manager...
PM.add(P);