[llvm-commits] [polly] r155636 - in /polly/trunk: include/polly/RegisterPasses.h lib/RegisterPasses.cpp

Hongbin Zheng etherzhhb at gmail.com
Thu Apr 26 06:55:33 PDT 2012


Author: ether
Date: Thu Apr 26 08:55:33 2012
New Revision: 155636

URL: http://llvm.org/viewvc/llvm-project?rev=155636&view=rev
Log:
1. Add a header guard for RegisterPasses.h to prevent multiple inclusion.
 2. Include the helper function and the helper class in the RegisterPasses.h into the polly namespace.

Modified:
    polly/trunk/include/polly/RegisterPasses.h
    polly/trunk/lib/RegisterPasses.cpp

Modified: polly/trunk/include/polly/RegisterPasses.h
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/include/polly/RegisterPasses.h?rev=155636&r1=155635&r2=155636&view=diff
==============================================================================
--- polly/trunk/include/polly/RegisterPasses.h (original)
+++ polly/trunk/include/polly/RegisterPasses.h Thu Apr 26 08:55:33 2012
@@ -11,10 +11,13 @@
 //
 //===----------------------------------------------------------------------===//
 
+#ifndef POLLY_REGISTER_PASSES_H
+#define POLLY_REGISTER_PASSES_H
 namespace llvm {
   class PassManagerBase;
 }
 
+namespace polly {
 // Register the Polly preoptimization passes. Preoptimizations are used to
 // prepare the LLVM-IR for Polly. They increase the amount of code that can be
 // optimized.
@@ -24,3 +27,5 @@
 // Register the Polly optimizer (including its preoptimizations).
 void registerPollyPasses(llvm::PassManagerBase &PM,
                          bool DisableCodegen = false);
+}
+#endif

Modified: polly/trunk/lib/RegisterPasses.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/RegisterPasses.cpp?rev=155636&r1=155635&r2=155636&view=diff
==============================================================================
--- polly/trunk/lib/RegisterPasses.cpp (original)
+++ polly/trunk/lib/RegisterPasses.cpp Thu Apr 26 08:55:33 2012
@@ -105,7 +105,7 @@
        cl::Hidden,
        cl::init(false));
 
-void initializePollyPasses(PassRegistry &Registry) {
+static void initializePollyPasses(PassRegistry &Registry) {
   initializeCloogInfoPass(Registry);
   initializeCodeGenerationPass(Registry);
   initializeCodePreparationPass(Registry);
@@ -125,6 +125,7 @@
   initializeTempScopInfoPass(Registry);
 }
 
+namespace {
 // Statically register all Polly passes such that they are available after
 // loading Polly.
 class StaticInitializer {
@@ -135,10 +136,11 @@
       initializePollyPasses(Registry);
     }
 };
+} // end of anonymous namespace.
 
 static StaticInitializer InitializeEverything;
 
-void registerPollyPreoptPasses(llvm::PassManagerBase &PM) {
+void polly::registerPollyPreoptPasses(llvm::PassManagerBase &PM) {
   // A standard set of optimization passes partially taken/copied from the
   // set of default optimization passes. It is used to bring the code into
   // a canonical form that can than be analyzed by Polly. This set of passes is
@@ -170,7 +172,7 @@
   PM.add(polly::createRegionSimplifyPass());
 }
 
-void registerPollyPasses(llvm::PassManagerBase &PM, bool DisableCodegen) {
+void polly::registerPollyPasses(llvm::PassManagerBase &PM, bool DisableCodegen) {
   bool RunCodegen = !DisableCodegen;
 
   registerPollyPreoptPasses(PM);





More information about the llvm-commits mailing list