[llvm-commits] CVS: llvm/lib/Analysis/AliasAnalysis.cpp AliasAnalysisCounter.cpp AliasAnalysisEvaluator.cpp AliasDebugger.cpp AliasSetTracker.cpp BasicAliasAnalysis.cpp CFGPrinter.cpp InstCount.cpp IntervalPartition.cpp LoadValueNumbering.cpp LoopInfo.cpp LoopPass.cpp PostDominators.cpp ProfileInfo.cpp ProfileInfoLoaderPass.cpp ScalarEvolution.cpp ValueNumbering.cpp
Devang Patel
dpatel at apple.com
Tue May 1 14:18:01 PDT 2007
Changes in directory llvm/lib/Analysis:
AliasAnalysis.cpp updated: 1.30 -> 1.31
AliasAnalysisCounter.cpp updated: 1.20 -> 1.21
AliasAnalysisEvaluator.cpp updated: 1.33 -> 1.34
AliasDebugger.cpp updated: 1.3 -> 1.4
AliasSetTracker.cpp updated: 1.46 -> 1.47
BasicAliasAnalysis.cpp updated: 1.108 -> 1.109
CFGPrinter.cpp updated: 1.22 -> 1.23
InstCount.cpp updated: 1.20 -> 1.21
IntervalPartition.cpp updated: 1.32 -> 1.33
LoadValueNumbering.cpp updated: 1.39 -> 1.40
LoopInfo.cpp updated: 1.83 -> 1.84
LoopPass.cpp updated: 1.18 -> 1.19
PostDominators.cpp updated: 1.67 -> 1.68
ProfileInfo.cpp updated: 1.11 -> 1.12
ProfileInfoLoaderPass.cpp updated: 1.18 -> 1.19
ScalarEvolution.cpp updated: 1.112 -> 1.113
ValueNumbering.cpp updated: 1.25 -> 1.26
---
Log message:
Do not use typeinfo to identify pass in pass manager.
---
Diffs of the changes: (+61 -5)
AliasAnalysis.cpp | 1 +
AliasAnalysisCounter.cpp | 4 +++-
AliasAnalysisEvaluator.cpp | 4 ++++
AliasDebugger.cpp | 4 ++++
AliasSetTracker.cpp | 4 ++++
BasicAliasAnalysis.cpp | 6 ++++++
CFGPrinter.cpp | 6 ++++++
InstCount.cpp | 4 ++++
IntervalPartition.cpp | 4 +++-
LoadValueNumbering.cpp | 3 +++
LoopInfo.cpp | 1 +
LoopPass.cpp | 5 ++++-
PostDominators.cpp | 3 +++
ProfileInfo.cpp | 7 ++++++-
ProfileInfoLoaderPass.cpp | 4 +++-
ScalarEvolution.cpp | 1 +
ValueNumbering.cpp | 5 +++++
17 files changed, 61 insertions(+), 5 deletions(-)
Index: llvm/lib/Analysis/AliasAnalysis.cpp
diff -u llvm/lib/Analysis/AliasAnalysis.cpp:1.30 llvm/lib/Analysis/AliasAnalysis.cpp:1.31
--- llvm/lib/Analysis/AliasAnalysis.cpp:1.30 Fri Nov 17 01:10:51 2006
+++ llvm/lib/Analysis/AliasAnalysis.cpp Tue May 1 16:15:46 2007
@@ -34,6 +34,7 @@
// Register the AliasAnalysis interface, providing a nice name to refer to.
namespace {
+ const int AliasAnalysis::ID = 0;
RegisterAnalysisGroup<AliasAnalysis> Z("Alias Analysis");
}
Index: llvm/lib/Analysis/AliasAnalysisCounter.cpp
diff -u llvm/lib/Analysis/AliasAnalysisCounter.cpp:1.20 llvm/lib/Analysis/AliasAnalysisCounter.cpp:1.21
--- llvm/lib/Analysis/AliasAnalysisCounter.cpp:1.20 Mon Feb 5 17:42:17 2007
+++ llvm/lib/Analysis/AliasAnalysisCounter.cpp Tue May 1 16:15:46 2007
@@ -34,7 +34,8 @@
const char *Name;
Module *M;
public:
- AliasAnalysisCounter() {
+ static const int ID; // Class identification, replacement for typeinfo
+ AliasAnalysisCounter() : ModulePass((intptr_t) &ID) {
No = May = Must = 0;
NoMR = JustRef = JustMod = MR = 0;
}
@@ -107,6 +108,7 @@
}
};
+ const int AliasAnalysisCounter::ID = 0;
RegisterPass<AliasAnalysisCounter>
X("count-aa", "Count Alias Analysis Query Responses");
RegisterAnalysisGroup<AliasAnalysis> Y(X);
Index: llvm/lib/Analysis/AliasAnalysisEvaluator.cpp
diff -u llvm/lib/Analysis/AliasAnalysisEvaluator.cpp:1.33 llvm/lib/Analysis/AliasAnalysisEvaluator.cpp:1.34
--- llvm/lib/Analysis/AliasAnalysisEvaluator.cpp:1.33 Mon Feb 5 17:42:17 2007
+++ llvm/lib/Analysis/AliasAnalysisEvaluator.cpp Tue May 1 16:15:46 2007
@@ -50,6 +50,9 @@
unsigned NoModRef, Mod, Ref, ModRef;
public:
+ static const int ID; // Pass identifcation, replacement for typeid
+ AAEval() : FunctionPass((intptr_t)&ID) {}
+
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.addRequired<AliasAnalysis>();
AU.setPreservesAll();
@@ -70,6 +73,7 @@
bool doFinalization(Module &M);
};
+ const int AAEval::ID = 0;
RegisterPass<AAEval>
X("aa-eval", "Exhaustive Alias Analysis Precision Evaluator");
}
Index: llvm/lib/Analysis/AliasDebugger.cpp
diff -u llvm/lib/Analysis/AliasDebugger.cpp:1.3 llvm/lib/Analysis/AliasDebugger.cpp:1.4
--- llvm/lib/Analysis/AliasDebugger.cpp:1.3 Mon Feb 5 17:42:17 2007
+++ llvm/lib/Analysis/AliasDebugger.cpp Tue May 1 16:15:46 2007
@@ -40,6 +40,9 @@
std::set<const Value*> Vals;
public:
+ static const int ID; // Class identification, replacement for typeinfo
+ AliasDebugger() : ModulePass((intptr_t)&ID) {}
+
bool runOnModule(Module &M) {
InitializeAliasAnalysis(this); // set up super class
@@ -119,6 +122,7 @@
};
+ const int AliasDebugger::ID = 0;
RegisterPass<AliasDebugger> X("debug-aa", "AA use debugger");
RegisterAnalysisGroup<AliasAnalysis> Y(X);
}
Index: llvm/lib/Analysis/AliasSetTracker.cpp
diff -u llvm/lib/Analysis/AliasSetTracker.cpp:1.46 llvm/lib/Analysis/AliasSetTracker.cpp:1.47
--- llvm/lib/Analysis/AliasSetTracker.cpp:1.46 Mon Feb 5 17:42:17 2007
+++ llvm/lib/Analysis/AliasSetTracker.cpp Tue May 1 16:15:46 2007
@@ -555,6 +555,9 @@
class VISIBILITY_HIDDEN AliasSetPrinter : public FunctionPass {
AliasSetTracker *Tracker;
public:
+ static const int ID; // Pass identifcation, replacement for typeid
+ AliasSetPrinter() : FunctionPass((intptr_t)&ID) {}
+
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.setPreservesAll();
AU.addRequired<AliasAnalysis>();
@@ -570,5 +573,6 @@
return false;
}
};
+ const int AliasSetPrinter::ID = 0;
RegisterPass<AliasSetPrinter> X("print-alias-sets", "Alias Set Printer");
}
Index: llvm/lib/Analysis/BasicAliasAnalysis.cpp
diff -u llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.108 llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.109
--- llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.108 Thu Apr 19 00:39:12 2007
+++ llvm/lib/Analysis/BasicAliasAnalysis.cpp Tue May 1 16:15:46 2007
@@ -36,6 +36,9 @@
/// 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
+ NoAA() : ImmutablePass((intptr_t)&ID) {}
+
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.addRequired<TargetData>();
}
@@ -74,6 +77,7 @@
};
// Register this pass...
+ const int NoAA::ID = 0;
RegisterPass<NoAA>
U("no-aa", "No Alias Analysis (always returns 'may' alias)");
@@ -88,6 +92,7 @@
/// 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
AliasResult alias(const Value *V1, unsigned V1Size,
const Value *V2, unsigned V2Size);
@@ -119,6 +124,7 @@
};
// Register this pass...
+ const int BasicAliasAnalysis::ID = 0;
RegisterPass<BasicAliasAnalysis>
X("basicaa", "Basic Alias Analysis (default AA impl)");
Index: llvm/lib/Analysis/CFGPrinter.cpp
diff -u llvm/lib/Analysis/CFGPrinter.cpp:1.22 llvm/lib/Analysis/CFGPrinter.cpp:1.23
--- llvm/lib/Analysis/CFGPrinter.cpp:1.22 Mon Feb 5 17:42:17 2007
+++ llvm/lib/Analysis/CFGPrinter.cpp Tue May 1 16:15:46 2007
@@ -91,6 +91,9 @@
namespace {
struct VISIBILITY_HIDDEN CFGPrinter : public FunctionPass {
+ static const int ID; // Pass identifcation, replacement for typeid
+ CFGPrinter() : FunctionPass((intptr_t)&ID) {}
+
virtual bool runOnFunction(Function &F) {
std::string Filename = "cfg." + F.getName() + ".dot";
cerr << "Writing '" << Filename << "'...";
@@ -111,10 +114,12 @@
}
};
+ const int 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
virtual bool runOnFunction(Function &F) {
bool OldCFGOnly = CFGOnly;
CFGOnly = true;
@@ -129,6 +134,7 @@
}
};
+ const int CFGOnlyPrinter::ID = 0;
RegisterPass<CFGOnlyPrinter>
P2("print-cfg-only",
"Print CFG of function to 'dot' file (with no function bodies)");
Index: llvm/lib/Analysis/InstCount.cpp
diff -u llvm/lib/Analysis/InstCount.cpp:1.20 llvm/lib/Analysis/InstCount.cpp:1.21
--- llvm/lib/Analysis/InstCount.cpp:1.20 Mon Feb 5 17:42:17 2007
+++ llvm/lib/Analysis/InstCount.cpp Tue May 1 16:15:46 2007
@@ -51,6 +51,9 @@
abort();
}
public:
+ static const int ID; // Pass identifcation, replacement for typeid
+ InstCount() : FunctionPass((intptr_t)&ID) {}
+
virtual bool runOnFunction(Function &F);
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
@@ -60,6 +63,7 @@
};
+ const int InstCount::ID = 0;
RegisterPass<InstCount> X("instcount",
"Counts the various types of Instructions");
}
Index: llvm/lib/Analysis/IntervalPartition.cpp
diff -u llvm/lib/Analysis/IntervalPartition.cpp:1.32 llvm/lib/Analysis/IntervalPartition.cpp:1.33
--- llvm/lib/Analysis/IntervalPartition.cpp:1.32 Sun Aug 27 17:30:17 2006
+++ llvm/lib/Analysis/IntervalPartition.cpp Tue May 1 16:15:46 2007
@@ -15,6 +15,7 @@
#include "llvm/Analysis/IntervalIterator.h"
using namespace llvm;
+const int IntervalPartition::ID = 0;
static RegisterPass<IntervalPartition>
X("intervals", "Interval Partition Construction", true);
@@ -88,7 +89,8 @@
// existing interval graph. This takes an additional boolean parameter to
// distinguish it from a copy constructor. Always pass in false for now.
//
-IntervalPartition::IntervalPartition(IntervalPartition &IP, bool) {
+IntervalPartition::IntervalPartition(IntervalPartition &IP, bool)
+ : FunctionPass((intptr_t) &ID) {
Interval *FunctionStart = IP.getRootInterval();
assert(FunctionStart && "Cannot operate on empty IntervalPartitions!");
Index: llvm/lib/Analysis/LoadValueNumbering.cpp
diff -u llvm/lib/Analysis/LoadValueNumbering.cpp:1.39 llvm/lib/Analysis/LoadValueNumbering.cpp:1.40
--- llvm/lib/Analysis/LoadValueNumbering.cpp:1.39 Tue Apr 17 12:52:45 2007
+++ llvm/lib/Analysis/LoadValueNumbering.cpp Tue May 1 16:15:46 2007
@@ -40,6 +40,8 @@
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
+ LoadVN() : FunctionPass((intptr_t)&ID) {}
/// Pass Implementation stuff. This doesn't do any analysis.
///
@@ -81,6 +83,7 @@
std::vector<Value*> &RetVals) const;
};
+ const int LoadVN::ID = 0;
// Register this pass...
RegisterPass<LoadVN> X("load-vn", "Load Value Numbering");
Index: llvm/lib/Analysis/LoopInfo.cpp
diff -u llvm/lib/Analysis/LoopInfo.cpp:1.83 llvm/lib/Analysis/LoopInfo.cpp:1.84
--- llvm/lib/Analysis/LoopInfo.cpp:1.83 Sat Mar 3 22:06:39 2007
+++ llvm/lib/Analysis/LoopInfo.cpp Tue May 1 16:15:46 2007
@@ -27,6 +27,7 @@
#include <ostream>
using namespace llvm;
+const int LoopInfo::ID = 0;
static RegisterPass<LoopInfo>
X("loops", "Natural Loop Construction", true);
Index: llvm/lib/Analysis/LoopPass.cpp
diff -u llvm/lib/Analysis/LoopPass.cpp:1.18 llvm/lib/Analysis/LoopPass.cpp:1.19
--- llvm/lib/Analysis/LoopPass.cpp:1.18 Wed Mar 7 00:39:01 2007
+++ llvm/lib/Analysis/LoopPass.cpp Tue May 1 16:15:46 2007
@@ -20,9 +20,12 @@
//===----------------------------------------------------------------------===//
// LPPassManager
//
+
+const int LPPassManager::ID = 0;
/// LPPassManager manages FPPassManagers and CalLGraphSCCPasses.
-LPPassManager::LPPassManager(int Depth) : PMDataManager(Depth) {
+LPPassManager::LPPassManager(int Depth)
+ : FunctionPass((intptr_t)&ID), PMDataManager(Depth) {
skipThisLoop = false;
redoThisLoop = false;
LI = NULL;
Index: llvm/lib/Analysis/PostDominators.cpp
diff -u llvm/lib/Analysis/PostDominators.cpp:1.67 llvm/lib/Analysis/PostDominators.cpp:1.68
--- llvm/lib/Analysis/PostDominators.cpp:1.67 Tue Apr 17 20:19:55 2007
+++ llvm/lib/Analysis/PostDominators.cpp Tue May 1 16:15:46 2007
@@ -22,6 +22,9 @@
// PostDominatorTree Implementation
//===----------------------------------------------------------------------===//
+const int PostDominatorTree::ID = 0;
+const int PostDominanceFrontier::ID = 0;
+const int PostETForest::ID = 0;
static RegisterPass<PostDominatorTree>
F("postdomtree", "Post-Dominator Tree Construction", true);
Index: llvm/lib/Analysis/ProfileInfo.cpp
diff -u llvm/lib/Analysis/ProfileInfo.cpp:1.11 llvm/lib/Analysis/ProfileInfo.cpp:1.12
--- llvm/lib/Analysis/ProfileInfo.cpp:1.11 Thu Mar 22 11:38:57 2007
+++ llvm/lib/Analysis/ProfileInfo.cpp Tue May 1 16:15:46 2007
@@ -22,6 +22,7 @@
// Register the ProfileInfo interface, providing a nice name to refer to.
namespace {
+ const int ProfileInfo::ID = 0;
RegisterAnalysisGroup<ProfileInfo> Z("Profile Information");
}
@@ -84,8 +85,12 @@
namespace {
struct VISIBILITY_HIDDEN NoProfileInfo
- : public ImmutablePass, public ProfileInfo {};
+ : public ImmutablePass, public ProfileInfo {
+ static const int ID; // Class identification, replacement for typeinfo
+ NoProfileInfo() : ImmutablePass((intptr_t)&ID) {}
+ };
+ const int NoProfileInfo::ID = 0;
// Register this pass...
RegisterPass<NoProfileInfo>
X("no-profile", "No Profile Information");
Index: llvm/lib/Analysis/ProfileInfoLoaderPass.cpp
diff -u llvm/lib/Analysis/ProfileInfoLoaderPass.cpp:1.18 llvm/lib/Analysis/ProfileInfoLoaderPass.cpp:1.19
--- llvm/lib/Analysis/ProfileInfoLoaderPass.cpp:1.18 Mon Feb 5 17:42:17 2007
+++ llvm/lib/Analysis/ProfileInfoLoaderPass.cpp Tue May 1 16:15:46 2007
@@ -32,8 +32,9 @@
class VISIBILITY_HIDDEN LoaderPass : public ModulePass, public ProfileInfo {
std::string Filename;
public:
+ static const int ID; // Class identification, replacement for typeinfo
LoaderPass(const std::string &filename = "")
- : Filename(filename) {
+ : ModulePass((intptr_t)&ID), Filename(filename) {
if (filename.empty()) Filename = ProfileInfoFilename;
}
@@ -49,6 +50,7 @@
virtual bool runOnModule(Module &M);
};
+ const int LoaderPass::ID = 0;
RegisterPass<LoaderPass>
X("profile-loader", "Load profile information from llvmprof.out");
Index: llvm/lib/Analysis/ScalarEvolution.cpp
diff -u llvm/lib/Analysis/ScalarEvolution.cpp:1.112 llvm/lib/Analysis/ScalarEvolution.cpp:1.113
--- llvm/lib/Analysis/ScalarEvolution.cpp:1.112 Sun Apr 15 21:24:41 2007
+++ llvm/lib/Analysis/ScalarEvolution.cpp Tue May 1 16:15:46 2007
@@ -102,6 +102,7 @@
cl::init(100));
namespace {
+ const int ScalarEvolution::ID = 0;
RegisterPass<ScalarEvolution>
R("scalar-evolution", "Scalar Evolution Analysis");
}
Index: llvm/lib/Analysis/ValueNumbering.cpp
diff -u llvm/lib/Analysis/ValueNumbering.cpp:1.25 llvm/lib/Analysis/ValueNumbering.cpp:1.26
--- llvm/lib/Analysis/ValueNumbering.cpp:1.25 Mon Feb 5 17:42:17 2007
+++ llvm/lib/Analysis/ValueNumbering.cpp Tue May 1 16:15:46 2007
@@ -22,6 +22,7 @@
#include "llvm/Support/Compiler.h"
using namespace llvm;
+const int ValueNumbering::ID = 0;
// Register the ValueNumbering interface, providing a nice name to refer to.
static RegisterAnalysisGroup<ValueNumbering> X("Value Numbering");
@@ -51,6 +52,9 @@
///
struct VISIBILITY_HIDDEN BasicVN
: public ImmutablePass, public ValueNumbering {
+ static const int ID; // Class identification, replacement for typeinfo
+ BasicVN() : ImmutablePass((intptr_t)&ID) {}
+
/// getEqualNumberNodes - Return nodes with the same value number as the
/// specified Value. This fills in the argument vector with any equal
/// values.
@@ -61,6 +65,7 @@
std::vector<Value*> &RetVals) const;
};
+ const int BasicVN::ID = 0;
// Register this pass...
RegisterPass<BasicVN>
X("basicvn", "Basic Value Numbering (default GVN impl)");
More information about the llvm-commits
mailing list