[polly] r210755 - Do not use namespace polly inside a header.

Andreas Simbuerger simbuerg at fim.uni-passau.de
Thu Jun 12 00:26:25 PDT 2014


Author: simbuerg
Date: Thu Jun 12 02:26:25 2014
New Revision: 210755

URL: http://llvm.org/viewvc/llvm-project?rev=210755&view=rev
Log:
Do not use namespace polly inside a header.

In general this fixes ambiguity that can arise from using
a different namespace that declares the same symbols as
we do.

One example inside llvm would be:
  createIndVarSimplifyPass(..);

Which can be found in:
  llvm/Transforms/Scalar.h
and
  polly/LinkAllPasses.h

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

Modified: polly/trunk/include/polly/LinkAllPasses.h
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/include/polly/LinkAllPasses.h?rev=210755&r1=210754&r2=210755&view=diff
==============================================================================
--- polly/trunk/include/polly/LinkAllPasses.h (original)
+++ polly/trunk/include/polly/LinkAllPasses.h Thu Jun 12 02:26:25 2014
@@ -63,8 +63,6 @@ extern char &IndependentBlocksID;
 extern char &CodePreparationID;
 }
 
-using namespace polly;
-
 namespace {
 struct PollyForcePassLinking {
   PollyForcePassLinking() {
@@ -76,36 +74,36 @@ struct PollyForcePassLinking {
       return;
 
 #ifdef CLOOG_FOUND
-    createCloogExporterPass();
-    createCloogInfoPass();
-    createCodeGenerationPass();
+    polly::createCloogExporterPass();
+    polly::createCloogInfoPass();
+    polly::createCodeGenerationPass();
 #endif
-    createCodePreparationPass();
-    createDeadCodeElimPass();
-    createDependencesPass();
-    createDOTOnlyPrinterPass();
-    createDOTOnlyViewerPass();
-    createDOTPrinterPass();
-    createDOTViewerPass();
-    createIndependentBlocksPass();
-    createIndVarSimplifyPass();
-    createJSONExporterPass();
-    createJSONImporterPass();
-    createScopDetectionPass();
-    createScopInfoPass();
+    polly::createCodePreparationPass();
+    polly::createDeadCodeElimPass();
+    polly::createDependencesPass();
+    polly::createDOTOnlyPrinterPass();
+    polly::createDOTOnlyViewerPass();
+    polly::createDOTPrinterPass();
+    polly::createDOTViewerPass();
+    polly::createIndependentBlocksPass();
+    polly::createIndVarSimplifyPass();
+    polly::createJSONExporterPass();
+    polly::createJSONImporterPass();
+    polly::createScopDetectionPass();
+    polly::createScopInfoPass();
 #ifdef PLUTO_FOUND
-    createPlutoOptimizerPass();
+    polly::createPlutoOptimizerPass();
 #endif
-    createPollyCanonicalizePass();
-    createIslAstInfoPass();
-    createIslCodeGenerationPass();
-    createIslScheduleOptimizerPass();
-    createTempScopInfoPass();
+    polly::createPollyCanonicalizePass();
+    polly::createIslAstInfoPass();
+    polly::createIslCodeGenerationPass();
+    polly::createIslScheduleOptimizerPass();
+    polly::createTempScopInfoPass();
 
 #ifdef SCOPLIB_FOUND
-    createPoccPass();
-    createScopLibExporterPass();
-    createScopLibImporterPass();
+    polly::createPoccPass();
+    polly::createScopLibExporterPass();
+    polly::createScopLibImporterPass();
 #endif
   }
 } PollyForcePassLinking; // Force link by creating a global definition.

Modified: polly/trunk/lib/Support/RegisterPasses.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Support/RegisterPasses.cpp?rev=210755&r1=210754&r2=210755&view=diff
==============================================================================
--- polly/trunk/lib/Support/RegisterPasses.cpp (original)
+++ polly/trunk/lib/Support/RegisterPasses.cpp Thu Jun 12 02:26:25 2014
@@ -37,6 +37,7 @@
 #include "llvm/Transforms/Vectorize.h"
 
 using namespace llvm;
+using namespace polly;
 
 cl::OptionCategory PollyCategory("Polly Options",
                                  "Configure the polly loop optimizer");





More information about the llvm-commits mailing list