diff --git a/llvm/include/llvm/PassSupport.h b/llvm/include/llvm/PassSupport.h index 5f8a1458c2b31cf02c5fee925af7c5a47926f08b..4921848aba3244377b5085778d0b0105fbe8e2d9 100644 --- a/llvm/include/llvm/PassSupport.h +++ b/llvm/include/llvm/PassSupport.h @@ -241,23 +241,15 @@ public: ~RegisterAGBase(); }; - -template +template 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 -struct RegisterAnalysisGroup : public RegisterAGBase { RegisterAnalysisGroup(const char *Name) - : RegisterAGBase(typeid(Interface)) { + : RegisterAGBase(typeid(Interface)) { setGroupName(Name); } }; diff --git a/llvm/lib/Analysis/AliasAnalysisCounter.cpp b/llvm/lib/Analysis/AliasAnalysisCounter.cpp index 562b4f50b88987fafc3888cdab508c653663ffa9..25ace732e2dd4d7c7583cc256af97057a6d168cf 100644 --- a/llvm/lib/Analysis/AliasAnalysisCounter.cpp +++ b/llvm/lib/Analysis/AliasAnalysisCounter.cpp @@ -111,7 +111,7 @@ namespace { RegisterPass X("count-aa", "Count Alias Analysis Query Responses"); - RegisterAnalysisGroup Y; + RegisterAnalysisGroup Y(X); } ModulePass *llvm::createAliasAnalysisCounterPass() { diff --git a/llvm/lib/Analysis/BasicAliasAnalysis.cpp b/llvm/lib/Analysis/BasicAliasAnalysis.cpp index 2c5fc81b150d4c4b2a7453baa10688b5cd0837a8..167d3b0c02ca71fbcbf9a07e9eff9b6914205124 100644 --- a/llvm/lib/Analysis/BasicAliasAnalysis.cpp +++ b/llvm/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 V; + RegisterAnalysisGroup 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 Y; + RegisterAnalysisGroup Y(X); } // End of anonymous namespace ImmutablePass *llvm::createBasicAliasAnalysisPass() { diff --git a/llvm/lib/Analysis/DataStructure/DataStructureAA.cpp b/llvm/lib/Analysis/DataStructure/DataStructureAA.cpp index bbb2ba21f344192a9a04d1104105f1b7c3786706..6e9f07bdd20dbc5acb6202f9e8b9b1042df04ec6 100644 --- a/llvm/lib/Analysis/DataStructure/DataStructureAA.cpp +++ b/llvm/lib/Analysis/DataStructure/DataStructureAA.cpp @@ -99,7 +99,7 @@ namespace { RegisterPass X("ds-aa", "Data Structure Graph Based Alias Analysis"); // Register as an implementation of AliasAnalysis - RegisterAnalysisGroup Y; + RegisterAnalysisGroup Y(X); } ModulePass *llvm::createDSAAPass() { return new DSAA(); } diff --git a/llvm/lib/Analysis/DataStructure/Steensgaard.cpp b/llvm/lib/Analysis/DataStructure/Steensgaard.cpp index 8a98022869db110e5ee6ef7831956f53c63c90a3..c7e32202cf709a1345a9b7cd34c1f5eda11543c7 100644 --- a/llvm/lib/Analysis/DataStructure/Steensgaard.cpp +++ b/llvm/lib/Analysis/DataStructure/Steensgaard.cpp @@ -77,7 +77,7 @@ namespace { "Steensgaard's alias analysis (DSGraph based)"); // Register as an implementation of AliasAnalysis - RegisterAnalysisGroup Y; + RegisterAnalysisGroup Y(X); } ModulePass *llvm::createSteensgaardPass() { return new Steens(); } diff --git a/llvm/lib/Analysis/IPA/Andersens.cpp b/llvm/lib/Analysis/IPA/Andersens.cpp index bc80f5b9568ad6121d68977fa9d3e40e3daf00b7..c9f5871b7251cf8f3a32b9ac4c6674d0532f1a7a 100644 --- a/llvm/lib/Analysis/IPA/Andersens.cpp +++ b/llvm/lib/Analysis/IPA/Andersens.cpp @@ -338,7 +338,7 @@ namespace { RegisterPass X("anders-aa", "Andersen's Interprocedural Alias Analysis"); - RegisterAnalysisGroup Y; + RegisterAnalysisGroup Y(X); } ModulePass *llvm::createAndersensPass() { return new Andersens(); } diff --git a/llvm/lib/Analysis/IPA/CallGraph.cpp b/llvm/lib/Analysis/IPA/CallGraph.cpp index 8836807bfc61251d14c87df97430a4bc8a81fe77..dab6867d323006d2259c83e610ea69b90b294ee5 100644 --- a/llvm/lib/Analysis/IPA/CallGraph.cpp +++ b/llvm/lib/Analysis/IPA/CallGraph.cpp @@ -183,7 +183,7 @@ private: RegisterAnalysisGroup X("Call Graph"); RegisterPass Y("basiccg", "Basic CallGraph Construction"); -RegisterAnalysisGroup Z; +RegisterAnalysisGroup Z(Y); } //End anonymous namespace diff --git a/llvm/lib/Analysis/IPA/GlobalsModRef.cpp b/llvm/lib/Analysis/IPA/GlobalsModRef.cpp index 6739dfbf0ee4bec60ebd637792a37beba76a76a6..2db4ed89c996b5c5ffe73c29bb89be6c481df714 100644 --- a/llvm/lib/Analysis/IPA/GlobalsModRef.cpp +++ b/llvm/lib/Analysis/IPA/GlobalsModRef.cpp @@ -137,7 +137,7 @@ namespace { RegisterPass X("globalsmodref-aa", "Simple mod/ref analysis for globals"); - RegisterAnalysisGroup Y; + RegisterAnalysisGroup Y(X); } Pass *llvm::createGlobalsModRefPass() { return new GlobalsModRef(); } diff --git a/llvm/lib/Analysis/LoadValueNumbering.cpp b/llvm/lib/Analysis/LoadValueNumbering.cpp index bac80c8d986f5e23e7d763b659113c90ad3659da..3fbf23806ce60fcb17796f87e06d5de1534ec089 100644 --- a/llvm/lib/Analysis/LoadValueNumbering.cpp +++ b/llvm/lib/Analysis/LoadValueNumbering.cpp @@ -84,7 +84,7 @@ namespace { RegisterPass X("load-vn", "Load Value Numbering"); // Declare that we implement the ValueNumbering interface - RegisterAnalysisGroup Y; + RegisterAnalysisGroup Y(X); } FunctionPass *llvm::createLoadValueNumberingPass() { return new LoadVN(); } diff --git a/llvm/lib/Analysis/ProfileInfo.cpp b/llvm/lib/Analysis/ProfileInfo.cpp index b8ab88b8f2e0a0a3a40275a50e34e22100660fd4..c35d00ca05995443064eb2b11bf0d92ae3e4cedb 100644 --- a/llvm/lib/Analysis/ProfileInfo.cpp +++ b/llvm/lib/Analysis/ProfileInfo.cpp @@ -89,7 +89,7 @@ namespace { X("no-profile", "No Profile Information"); // Declare that we implement the ProfileInfo interface - RegisterAnalysisGroup Y; + RegisterAnalysisGroup Y(X); } // End of anonymous namespace ImmutablePass *llvm::createNoProfileInfoPass() { return new NoProfileInfo(); } diff --git a/llvm/lib/Analysis/ProfileInfoLoaderPass.cpp b/llvm/lib/Analysis/ProfileInfoLoaderPass.cpp index 57e3627c53c024ade504bbb57b8247d88943a71f..b5cb95433fcdc432530cbb9d4f6a1b0dba19a602 100644 --- a/llvm/lib/Analysis/ProfileInfoLoaderPass.cpp +++ b/llvm/lib/Analysis/ProfileInfoLoaderPass.cpp @@ -52,7 +52,7 @@ namespace { RegisterPass X("profile-loader", "Load profile information from llvmprof.out"); - RegisterAnalysisGroup Y; + RegisterAnalysisGroup Y(X); } // End of anonymous namespace ModulePass *llvm::createProfileLoaderPass() { return new LoaderPass(); } diff --git a/llvm/lib/Analysis/ValueNumbering.cpp b/llvm/lib/Analysis/ValueNumbering.cpp index fb3bed05531ac37b2155f1037229c6e6d9f9c2a6..0224a0132fd86c6e98dd871d4bf66bdfab6f4765 100644 --- a/llvm/lib/Analysis/ValueNumbering.cpp +++ b/llvm/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 Y; + RegisterAnalysisGroup Y(X); /// BVNImpl - Implement BasicVN in terms of a visitor class that /// handles the different types of instructions as appropriate. diff --git a/llvm/lib/System/Mutex.cpp b/llvm/lib/System/Mutex.cpp index 44e3332d1791477464cd8f28071b87c01ed2ab3b..467bc8522bb3f67ba7fccb6fb705e45f0901b89d 100644 --- a/llvm/lib/System/Mutex.cpp +++ b/llvm/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(pthread_mutex_init); +static const bool pthread_enabled = true; // Construct a Mutex using pthread calls Mutex::Mutex( bool recursive) diff --git a/llvm/lib/Transforms/Instrumentation/BlockProfiling.cpp b/llvm/lib/Transforms/Instrumentation/BlockProfiling.cpp index 859f596fa6230430cfde727280ec888a5a9bc7e9..7e1f5cc76ca8f8fba705377ac8a0c2daf771b06a 100644 --- a/llvm/lib/Transforms/Instrumentation/BlockProfiling.cpp +++ b/llvm/lib/Transforms/Instrumentation/BlockProfiling.cpp @@ -37,7 +37,7 @@ namespace { RegisterPass X("insert-function-profiling", "Insert instrumentation for function profiling"); - RegisterAnalysisGroup XG; + RegisterAnalysisGroup XG(X); } @@ -83,7 +83,7 @@ namespace { RegisterPass Y("insert-block-profiling", "Insert instrumentation for block profiling"); - RegisterAnalysisGroup YG; + RegisterAnalysisGroup YG(Y); } ModulePass *llvm::createBlockProfilerPass() { return new BlockProfiler(); } diff --git a/llvm/lib/Transforms/Instrumentation/RSProfiling.cpp b/llvm/lib/Transforms/Instrumentation/RSProfiling.cpp index 984190a611b9575659b8c7f0602687ac27d71daf..54a9ef7003b4dbbfd15568b2bb2e12c5a9ac7abe 100644 --- a/llvm/lib/Transforms/Instrumentation/RSProfiling.cpp +++ b/llvm/lib/Transforms/Instrumentation/RSProfiling.cpp @@ -89,7 +89,7 @@ namespace { static RegisterAnalysisGroup A("Profiling passes"); static RegisterPass NP("insert-null-profiling-rs", "Measure profiling framework overhead"); - static RegisterAnalysisGroup NPT; + static RegisterAnalysisGroup NPT(NP); /// Chooser - Something that chooses when to make a sample of the profiled code class Chooser {