mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-19 11:02:59 +02:00
Hide analysis group registration behind a macro, just like pass registration.
llvm-svn: 115835
This commit is contained in:
parent
eeb0b64560
commit
2a670815f6
@ -210,6 +210,13 @@ struct RegisterAnalysisGroup : public RegisterAGBase {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#define INITIALIZE_ANALYSIS_GROUP(agName, name) \
|
||||||
|
void initialize##agName##AnalysisGroup(PassRegistry &Registry) { \
|
||||||
|
PassInfo *AI = new PassInfo(name, & agName :: ID); \
|
||||||
|
Registry.registerAnalysisGroup(& agName ::ID, 0, *AI, false); \
|
||||||
|
} \
|
||||||
|
static RegisterAnalysisGroup<agName> agName##_info (name)
|
||||||
|
|
||||||
#define INITIALIZE_AG_PASS(passName, agName, arg, name, cfg, analysis, def) \
|
#define INITIALIZE_AG_PASS(passName, agName, arg, name, cfg, analysis, def) \
|
||||||
void initialize##passName##Pass(PassRegistry &Registry) { \
|
void initialize##passName##Pass(PassRegistry &Registry) { \
|
||||||
PassInfo *PI = new PassInfo(name, arg, & passName ::ID, \
|
PassInfo *PI = new PassInfo(name, arg, & passName ::ID, \
|
||||||
|
@ -36,7 +36,7 @@
|
|||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
|
|
||||||
// Register the AliasAnalysis interface, providing a nice name to refer to.
|
// Register the AliasAnalysis interface, providing a nice name to refer to.
|
||||||
static RegisterAnalysisGroup<AliasAnalysis> Z("Alias Analysis");
|
INITIALIZE_ANALYSIS_GROUP(AliasAnalysis, "Alias Analysis");
|
||||||
char AliasAnalysis::ID = 0;
|
char AliasAnalysis::ID = 0;
|
||||||
|
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
@ -171,7 +171,7 @@ private:
|
|||||||
|
|
||||||
} //End anonymous namespace
|
} //End anonymous namespace
|
||||||
|
|
||||||
static RegisterAnalysisGroup<CallGraph> X("Call Graph");
|
INITIALIZE_ANALYSIS_GROUP(CallGraph, "Call Graph");
|
||||||
INITIALIZE_AG_PASS(BasicCallGraph, CallGraph, "basiccg",
|
INITIALIZE_AG_PASS(BasicCallGraph, CallGraph, "basiccg",
|
||||||
"Basic CallGraph Construction", false, true, true);
|
"Basic CallGraph Construction", false, true, true);
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
|
|
||||||
// Register the ProfileInfo interface, providing a nice name to refer to.
|
// Register the ProfileInfo interface, providing a nice name to refer to.
|
||||||
static RegisterAnalysisGroup<ProfileInfo> Z("Profile Information");
|
INITIALIZE_ANALYSIS_GROUP(ProfileInfo, "Profile Information");
|
||||||
|
|
||||||
namespace llvm {
|
namespace llvm {
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
|
|
||||||
// Register the RegisterCoalescer interface, providing a nice name to refer to.
|
// Register the RegisterCoalescer interface, providing a nice name to refer to.
|
||||||
static RegisterAnalysisGroup<RegisterCoalescer> Z("Register Coalescer");
|
INITIALIZE_ANALYSIS_GROUP(RegisterCoalescer, "Register Coalescer");
|
||||||
char RegisterCoalescer::ID = 0;
|
char RegisterCoalescer::ID = 0;
|
||||||
|
|
||||||
// RegisterCoalescer destructor: DO NOT move this to the header file
|
// RegisterCoalescer destructor: DO NOT move this to the header file
|
||||||
|
Loading…
Reference in New Issue
Block a user