Use 'static const char' instead of 'static const int'.

Due to darwin gcc bug, one version of darwin linker coalesces
static const int, which defauts PassID based pass identification.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36652 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Devang Patel
2007-05-02 21:39:20 +00:00
parent 749a89bd53
commit 3e15bf33e0
150 changed files with 312 additions and 313 deletions

View File

@@ -61,7 +61,7 @@ protected:
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

View File

@@ -73,7 +73,7 @@ protected:
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...
//

View File

@@ -208,7 +208,7 @@ public:
///
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 {
@@ -399,7 +399,7 @@ protected:
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) {}
@@ -477,7 +477,7 @@ public:
///
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) {}

View File

@@ -24,7 +24,7 @@ class Type;
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

View File

@@ -45,7 +45,7 @@ class IntervalPartition : public FunctionPass {
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) {}

View File

@@ -241,7 +241,7 @@ class LoopInfo : public FunctionPass {
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(); }

View File

@@ -68,7 +68,7 @@ class LoopPass : public Pass {
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

View File

@@ -22,7 +22,7 @@ namespace llvm {
/// 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) {}
@@ -54,7 +54,7 @@ private:
/// 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 {
@@ -79,7 +79,7 @@ struct PostETForest : public ETForestBase {
/// 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) {}

View File

@@ -38,7 +38,7 @@ namespace llvm {
// 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
//===------------------------------------------------------------------===//

View File

@@ -197,7 +197,7 @@ namespace llvm {
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

View File

@@ -29,7 +29,7 @@ class Value;
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

View File

@@ -28,7 +28,7 @@ class PrintModulePass : public ModulePass {
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) {}
@@ -52,7 +52,7 @@ class PrintFunctionPass : public FunctionPass {
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,

View File

@@ -26,7 +26,7 @@ class WriteBytecodePass : public ModulePass {
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) {}

View File

@@ -34,7 +34,7 @@ namespace llvm {
/// 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,

View File

@@ -65,7 +65,7 @@ namespace llvm {
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 {

View File

@@ -40,7 +40,7 @@ class MRegisterInfo;
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

View File

@@ -1022,7 +1022,7 @@ private:
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();

View File

@@ -41,7 +41,7 @@ public:
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) {}

View File

@@ -336,7 +336,7 @@ private:
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) { }

View File

@@ -202,7 +202,7 @@ public:
/// 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

View File

@@ -23,7 +23,7 @@ namespace llvm {
/// 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

View File

@@ -25,7 +25,7 @@ namespace llvm {
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) {}