~RegisterAGBase();
};
-
-template<typename Interface, typename DefaultImplementationPass = void,
- bool Default = false>
+template<typename Interface, bool Default = false>
struct RegisterAnalysisGroup : public RegisterAGBase {
- RegisterAnalysisGroup() : RegisterAGBase(typeid(Interface),
- &typeid(DefaultImplementationPass),
- Default) {
+ RegisterAnalysisGroup(RegisterPassBase &RPB)
+ : RegisterAGBase(typeid(Interface), &RPB.getPassInfo()->getTypeInfo(),
+ Default) {
}
-};
-/// Define a specialization of RegisterAnalysisGroup that is used to set the
-/// name for the analysis group.
-///
-template<typename Interface>
-struct RegisterAnalysisGroup<Interface, void, false> : public RegisterAGBase {
RegisterAnalysisGroup(const char *Name)
- : RegisterAGBase(typeid(Interface)) {
+ : RegisterAGBase(typeid(Interface)) {
setGroupName(Name);
}
};
RegisterPass<AliasAnalysisCounter>
X("count-aa", "Count Alias Analysis Query Responses");
- RegisterAnalysisGroup<AliasAnalysis, AliasAnalysisCounter> Y;
+ RegisterAnalysisGroup<AliasAnalysis> Y(X);
}
ModulePass *llvm::createAliasAnalysisCounterPass() {
U("no-aa", "No Alias Analysis (always returns 'may' alias)");
// Declare that we implement the AliasAnalysis interface
- RegisterAnalysisGroup<AliasAnalysis, NoAA> V;
+ RegisterAnalysisGroup<AliasAnalysis> V(U);
} // End of anonymous namespace
ImmutablePass *llvm::createNoAAPass() { return new NoAA(); }
X("basicaa", "Basic Alias Analysis (default AA impl)");
// Declare that we implement the AliasAnalysis interface
- RegisterAnalysisGroup<AliasAnalysis, BasicAliasAnalysis, true> Y;
+ RegisterAnalysisGroup<AliasAnalysis, true> Y(X);
} // End of anonymous namespace
ImmutablePass *llvm::createBasicAliasAnalysisPass() {
RegisterPass<DSAA> X("ds-aa", "Data Structure Graph Based Alias Analysis");
// Register as an implementation of AliasAnalysis
- RegisterAnalysisGroup<AliasAnalysis, DSAA> Y;
+ RegisterAnalysisGroup<AliasAnalysis> Y(X);
}
ModulePass *llvm::createDSAAPass() { return new DSAA(); }
"Steensgaard's alias analysis (DSGraph based)");
// Register as an implementation of AliasAnalysis
- RegisterAnalysisGroup<AliasAnalysis, Steens> Y;
+ RegisterAnalysisGroup<AliasAnalysis> Y(X);
}
ModulePass *llvm::createSteensgaardPass() { return new Steens(); }
RegisterPass<Andersens> X("anders-aa",
"Andersen's Interprocedural Alias Analysis");
- RegisterAnalysisGroup<AliasAnalysis, Andersens> Y;
+ RegisterAnalysisGroup<AliasAnalysis> Y(X);
}
ModulePass *llvm::createAndersensPass() { return new Andersens(); }
RegisterAnalysisGroup<CallGraph> X("Call Graph");
RegisterPass<BasicCallGraph> Y("basiccg", "Basic CallGraph Construction");
-RegisterAnalysisGroup<CallGraph, BasicCallGraph, true> Z;
+RegisterAnalysisGroup<CallGraph, true> Z(Y);
} //End anonymous namespace
RegisterPass<GlobalsModRef> X("globalsmodref-aa",
"Simple mod/ref analysis for globals");
- RegisterAnalysisGroup<AliasAnalysis, GlobalsModRef> Y;
+ RegisterAnalysisGroup<AliasAnalysis> Y(X);
}
Pass *llvm::createGlobalsModRefPass() { return new GlobalsModRef(); }
RegisterPass<LoadVN> X("load-vn", "Load Value Numbering");
// Declare that we implement the ValueNumbering interface
- RegisterAnalysisGroup<ValueNumbering, LoadVN> Y;
+ RegisterAnalysisGroup<ValueNumbering> Y(X);
}
FunctionPass *llvm::createLoadValueNumberingPass() { return new LoadVN(); }
X("no-profile", "No Profile Information");
// Declare that we implement the ProfileInfo interface
- RegisterAnalysisGroup<ProfileInfo, NoProfileInfo, true> Y;
+ RegisterAnalysisGroup<ProfileInfo, true> Y(X);
} // End of anonymous namespace
ImmutablePass *llvm::createNoProfileInfoPass() { return new NoProfileInfo(); }
RegisterPass<LoaderPass>
X("profile-loader", "Load profile information from llvmprof.out");
- RegisterAnalysisGroup<ProfileInfo, LoaderPass> Y;
+ RegisterAnalysisGroup<ProfileInfo> Y(X);
} // End of anonymous namespace
ModulePass *llvm::createProfileLoaderPass() { return new LoaderPass(); }
X("basicvn", "Basic Value Numbering (default GVN impl)");
// Declare that we implement the ValueNumbering interface
- RegisterAnalysisGroup<ValueNumbering, BasicVN, true> Y;
+ RegisterAnalysisGroup<ValueNumbering, true> Y(X);
/// BVNImpl - Implement BasicVN in terms of a visitor class that
/// handles the different types of instructions as appropriate.
// is configured into the LIBS variable.
// Note: this line of code generates a warning if pthread_mutex_init is not
// declared with weak linkage. It's safe to ignore the warning.
-static const bool pthread_enabled = static_cast<bool>(pthread_mutex_init);
+static const bool pthread_enabled = true;
// Construct a Mutex using pthread calls
Mutex::Mutex( bool recursive)
RegisterPass<FunctionProfiler> X("insert-function-profiling",
"Insert instrumentation for function profiling");
- RegisterAnalysisGroup<RSProfilers, FunctionProfiler> XG;
+ RegisterAnalysisGroup<RSProfilers> XG(X);
}
RegisterPass<BlockProfiler> Y("insert-block-profiling",
"Insert instrumentation for block profiling");
- RegisterAnalysisGroup<RSProfilers, BlockProfiler> YG;
+ RegisterAnalysisGroup<RSProfilers> YG(Y);
}
ModulePass *llvm::createBlockProfilerPass() { return new BlockProfiler(); }
static RegisterAnalysisGroup<RSProfilers> A("Profiling passes");
static RegisterPass<NullProfilerRS> NP("insert-null-profiling-rs",
"Measure profiling framework overhead");
- static RegisterAnalysisGroup<RSProfilers, NullProfilerRS, true> NPT;
+ static RegisterAnalysisGroup<RSProfilers, true> NPT(NP);
/// Chooser - Something that chooses when to make a sample of the profiled code
class Chooser {