aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/llvm/PassSupport.h18
-rw-r--r--lib/Analysis/AliasAnalysisCounter.cpp2
-rw-r--r--lib/Analysis/BasicAliasAnalysis.cpp4
-rw-r--r--lib/Analysis/DataStructure/DataStructureAA.cpp2
-rw-r--r--lib/Analysis/DataStructure/Steensgaard.cpp2
-rw-r--r--lib/Analysis/IPA/Andersens.cpp2
-rw-r--r--lib/Analysis/IPA/CallGraph.cpp2
-rw-r--r--lib/Analysis/IPA/GlobalsModRef.cpp2
-rw-r--r--lib/Analysis/LoadValueNumbering.cpp2
-rw-r--r--lib/Analysis/ProfileInfo.cpp2
-rw-r--r--lib/Analysis/ProfileInfoLoaderPass.cpp2
-rw-r--r--lib/Analysis/ValueNumbering.cpp2
-rw-r--r--lib/System/Mutex.cpp2
-rw-r--r--lib/Transforms/Instrumentation/BlockProfiling.cpp4
-rw-r--r--lib/Transforms/Instrumentation/RSProfiling.cpp2
15 files changed, 21 insertions, 29 deletions
diff --git a/include/llvm/PassSupport.h b/include/llvm/PassSupport.h
index 5f8a145..4921848 100644
--- a/include/llvm/PassSupport.h
+++ b/include/llvm/PassSupport.h
@@ -241,23 +241,15 @@ public:
~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);
}
};
diff --git a/lib/Analysis/AliasAnalysisCounter.cpp b/lib/Analysis/AliasAnalysisCounter.cpp
index 562b4f5..25ace73 100644
--- a/lib/Analysis/AliasAnalysisCounter.cpp
+++ b/lib/Analysis/AliasAnalysisCounter.cpp
@@ -111,7 +111,7 @@ namespace {
RegisterPass<AliasAnalysisCounter>
X("count-aa", "Count Alias Analysis Query Responses");
- RegisterAnalysisGroup<AliasAnalysis, AliasAnalysisCounter> Y;
+ RegisterAnalysisGroup<AliasAnalysis> Y(X);
}
ModulePass *llvm::createAliasAnalysisCounterPass() {
diff --git a/lib/Analysis/BasicAliasAnalysis.cpp b/lib/Analysis/BasicAliasAnalysis.cpp
index 2c5fc81..167d3b0 100644
--- a/lib/Analysis/BasicAliasAnalysis.cpp
+++ b/lib/Analysis/BasicAliasAnalysis.cpp
@@ -76,7 +76,7 @@ namespace {
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(); }
@@ -121,7 +121,7 @@ namespace {
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() {
diff --git a/lib/Analysis/DataStructure/DataStructureAA.cpp b/lib/Analysis/DataStructure/DataStructureAA.cpp
index bbb2ba2..6e9f07b 100644
--- a/lib/Analysis/DataStructure/DataStructureAA.cpp
+++ b/lib/Analysis/DataStructure/DataStructureAA.cpp
@@ -99,7 +99,7 @@ namespace {
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(); }
diff --git a/lib/Analysis/DataStructure/Steensgaard.cpp b/lib/Analysis/DataStructure/Steensgaard.cpp
index 8a98022..c7e3220 100644
--- a/lib/Analysis/DataStructure/Steensgaard.cpp
+++ b/lib/Analysis/DataStructure/Steensgaard.cpp
@@ -77,7 +77,7 @@ namespace {
"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(); }
diff --git a/lib/Analysis/IPA/Andersens.cpp b/lib/Analysis/IPA/Andersens.cpp
index bc80f5b..c9f5871 100644
--- a/lib/Analysis/IPA/Andersens.cpp
+++ b/lib/Analysis/IPA/Andersens.cpp
@@ -338,7 +338,7 @@ namespace {
RegisterPass<Andersens> X("anders-aa",
"Andersen's Interprocedural Alias Analysis");
- RegisterAnalysisGroup<AliasAnalysis, Andersens> Y;
+ RegisterAnalysisGroup<AliasAnalysis> Y(X);
}
ModulePass *llvm::createAndersensPass() { return new Andersens(); }
diff --git a/lib/Analysis/IPA/CallGraph.cpp b/lib/Analysis/IPA/CallGraph.cpp
index 8836807..dab6867 100644
--- a/lib/Analysis/IPA/CallGraph.cpp
+++ b/lib/Analysis/IPA/CallGraph.cpp
@@ -183,7 +183,7 @@ private:
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
diff --git a/lib/Analysis/IPA/GlobalsModRef.cpp b/lib/Analysis/IPA/GlobalsModRef.cpp
index 6739dfb..2db4ed8 100644
--- a/lib/Analysis/IPA/GlobalsModRef.cpp
+++ b/lib/Analysis/IPA/GlobalsModRef.cpp
@@ -137,7 +137,7 @@ 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(); }
diff --git a/lib/Analysis/LoadValueNumbering.cpp b/lib/Analysis/LoadValueNumbering.cpp
index bac80c8..3fbf238 100644
--- a/lib/Analysis/LoadValueNumbering.cpp
+++ b/lib/Analysis/LoadValueNumbering.cpp
@@ -84,7 +84,7 @@ namespace {
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(); }
diff --git a/lib/Analysis/ProfileInfo.cpp b/lib/Analysis/ProfileInfo.cpp
index b8ab88b..c35d00c 100644
--- a/lib/Analysis/ProfileInfo.cpp
+++ b/lib/Analysis/ProfileInfo.cpp
@@ -89,7 +89,7 @@ namespace {
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(); }
diff --git a/lib/Analysis/ProfileInfoLoaderPass.cpp b/lib/Analysis/ProfileInfoLoaderPass.cpp
index 57e3627..b5cb954 100644
--- a/lib/Analysis/ProfileInfoLoaderPass.cpp
+++ b/lib/Analysis/ProfileInfoLoaderPass.cpp
@@ -52,7 +52,7 @@ namespace {
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(); }
diff --git a/lib/Analysis/ValueNumbering.cpp b/lib/Analysis/ValueNumbering.cpp
index fb3bed0..0224a01 100644
--- a/lib/Analysis/ValueNumbering.cpp
+++ b/lib/Analysis/ValueNumbering.cpp
@@ -64,7 +64,7 @@ namespace {
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.
diff --git a/lib/System/Mutex.cpp b/lib/System/Mutex.cpp
index 44e3332..467bc85 100644
--- a/lib/System/Mutex.cpp
+++ b/lib/System/Mutex.cpp
@@ -53,7 +53,7 @@ using namespace sys;
// 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)
diff --git a/lib/Transforms/Instrumentation/BlockProfiling.cpp b/lib/Transforms/Instrumentation/BlockProfiling.cpp
index 859f596..7e1f5cc 100644
--- a/lib/Transforms/Instrumentation/BlockProfiling.cpp
+++ b/lib/Transforms/Instrumentation/BlockProfiling.cpp
@@ -37,7 +37,7 @@ namespace {
RegisterPass<FunctionProfiler> X("insert-function-profiling",
"Insert instrumentation for function profiling");
- RegisterAnalysisGroup<RSProfilers, FunctionProfiler> XG;
+ RegisterAnalysisGroup<RSProfilers> XG(X);
}
@@ -83,7 +83,7 @@ namespace {
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(); }
diff --git a/lib/Transforms/Instrumentation/RSProfiling.cpp b/lib/Transforms/Instrumentation/RSProfiling.cpp
index 984190a..54a9ef7 100644
--- a/lib/Transforms/Instrumentation/RSProfiling.cpp
+++ b/lib/Transforms/Instrumentation/RSProfiling.cpp
@@ -89,7 +89,7 @@ namespace {
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 {