diff options
author | Owen Anderson <resistor@mac.com> | 2010-08-05 23:42:04 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2010-08-05 23:42:04 +0000 |
commit | 755aceb5d0df842b5132052d474c361b5605aedb (patch) | |
tree | db1a7ea8a289673ef5a82a05550f8546a6a029cb /llvm/lib/Analysis/ProfileEstimatorPass.cpp | |
parent | ddb2d65c50884883fb329ad293d0ae2d6c1d6d3f (diff) | |
download | bcm5719-llvm-755aceb5d0df842b5132052d474c361b5605aedb.tar.gz bcm5719-llvm-755aceb5d0df842b5132052d474c361b5605aedb.zip |
Don't use PassInfo* as a type identifier for passes. Instead, use the address of the static
ID member as the sole unique type identifier. Clean up APIs related to this change.
llvm-svn: 110396
Diffstat (limited to 'llvm/lib/Analysis/ProfileEstimatorPass.cpp')
-rw-r--r-- | llvm/lib/Analysis/ProfileEstimatorPass.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Analysis/ProfileEstimatorPass.cpp b/llvm/lib/Analysis/ProfileEstimatorPass.cpp index da4ce476926..062461a87cb 100644 --- a/llvm/lib/Analysis/ProfileEstimatorPass.cpp +++ b/llvm/lib/Analysis/ProfileEstimatorPass.cpp @@ -39,7 +39,7 @@ namespace { public: static char ID; // Class identification, replacement for typeinfo explicit ProfileEstimatorPass(const double execcount = 0) - : FunctionPass(&ID), ExecCount(execcount) { + : FunctionPass(ID), ExecCount(execcount) { if (execcount == 0) ExecCount = LoopWeight; } @@ -59,8 +59,8 @@ namespace { /// an analysis interface through multiple inheritance. If needed, it /// should override this to adjust the this pointer as needed for the /// specified pass info. - virtual void *getAdjustedAnalysisPointer(const PassInfo *PI) { - if (PI->isPassID(&ProfileInfo::ID)) + virtual void *getAdjustedAnalysisPointer(AnalysisID PI) { + if (PI == &ProfileInfo::ID) return (ProfileInfo*)this; return this; } @@ -78,7 +78,7 @@ X("profile-estimator", "Estimate profiling information", false, true); static RegisterAnalysisGroup<ProfileInfo> Y(X); namespace llvm { - const PassInfo *ProfileEstimatorPassID = &X; + char &ProfileEstimatorPassID = ProfileEstimatorPass::ID; FunctionPass *createProfileEstimatorPass() { return new ProfileEstimatorPass(); |