[llvm-commits] [polly] r152933 - in /polly/trunk/lib: CodeGeneration.cpp RegisterPasses.cpp

Tobias Grosser grosser at fim.uni-passau.de
Fri Mar 16 10:17:17 PDT 2012


Author: grosser
Date: Fri Mar 16 12:17:16 2012
New Revision: 152933

URL: http://llvm.org/viewvc/llvm-project?rev=152933&view=rev
Log:
Do not fail if a command line argument is given more than once

For boolean flags in Polly there is no problem if they are given more than once.
Hence, we can allow it to not fail for build systems that (acciently) add flags
several times.

This fixes: PR12278

Reported by: Sebastian Pop  <sebpop at gmail.com>

Modified:
    polly/trunk/lib/CodeGeneration.cpp
    polly/trunk/lib/RegisterPasses.cpp

Modified: polly/trunk/lib/CodeGeneration.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/CodeGeneration.cpp?rev=152933&r1=152932&r2=152933&view=diff
==============================================================================
--- polly/trunk/lib/CodeGeneration.cpp (original)
+++ polly/trunk/lib/CodeGeneration.cpp Fri Mar 16 12:17:16 2012
@@ -61,26 +61,26 @@
 static cl::opt<bool, true>
 Vector("enable-polly-vector",
        cl::desc("Enable polly vector code generation"), cl::Hidden,
-       cl::location(EnablePollyVector), cl::init(false));
+       cl::location(EnablePollyVector), cl::init(false), cl::ZeroOrMore);
 
 static cl::opt<bool>
 OpenMP("enable-polly-openmp",
        cl::desc("Generate OpenMP parallel code"), cl::Hidden,
        cl::value_desc("OpenMP code generation enabled if true"),
-       cl::init(false));
+       cl::init(false), cl::ZeroOrMore);
 
 static cl::opt<bool>
 AtLeastOnce("enable-polly-atLeastOnce",
        cl::desc("Give polly the hint, that every loop is executed at least"
                 "once"), cl::Hidden,
        cl::value_desc("OpenMP code generation enabled if true"),
-       cl::init(false));
+       cl::init(false), cl::ZeroOrMore);
 
 static cl::opt<bool>
 Aligned("enable-polly-aligned",
        cl::desc("Assumed aligned memory accesses."), cl::Hidden,
        cl::value_desc("OpenMP code generation enabled if true"),
-       cl::init(false));
+       cl::init(false), cl::ZeroOrMore);
 
 typedef DenseMap<const Value*, Value*> ValueMapT;
 typedef DenseMap<const char*, Value*> CharMapT;

Modified: polly/trunk/lib/RegisterPasses.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/RegisterPasses.cpp?rev=152933&r1=152932&r2=152933&view=diff
==============================================================================
--- polly/trunk/lib/RegisterPasses.cpp (original)
+++ polly/trunk/lib/RegisterPasses.cpp Fri Mar 16 12:17:16 2012
@@ -34,43 +34,43 @@
 
 static cl::opt<bool>
 PollyEnabled("polly", cl::desc("Enable the default passes of Polly in -O3"),
-             cl::init(false));
+             cl::init(false), cl::ZeroOrMore);
 
 static cl::opt<bool>
 DisableScheduler("polly-no-optimizer",
                  cl::desc("Disable Polly Scheduling Optimizer"), cl::Hidden,
-                 cl::init(false));
+                 cl::init(false), cl::ZeroOrMore);
 static cl::opt<bool>
 DisableCodegen("polly-no-codegen",
        cl::desc("Disable Polly Code Generation"), cl::Hidden,
-       cl::init(false));
+       cl::init(false), cl::ZeroOrMore);
 static cl::opt<std::string>
 Optimizer("polly-optimizer",
-          cl::desc("Select the scheduling optimizer. " 
+          cl::desc("Select the scheduling optimizer. "
                    "Either isl (default) or pocc."),
           cl::Hidden, cl::init("isl"));
 static cl::opt<bool>
 ImportJScop("polly-run-import-jscop",
             cl::desc("Export the JScop description of the detected Scops"),
-            cl::Hidden, cl::init(false));
+            cl::Hidden, cl::init(false), cl::ZeroOrMore);
 static cl::opt<bool>
 ExportJScop("polly-run-export-jscop",
             cl::desc("Export the JScop description of the detected Scops"),
-            cl::Hidden, cl::init(false));
+            cl::Hidden, cl::init(false), cl::ZeroOrMore);
 static cl::opt<bool>
 ExportCLooG("polly-run-export-cloog",
             cl::desc("Export the CLooG input files for the detected Scops"),
-            cl::Hidden, cl::init(false));
+            cl::Hidden, cl::init(false), cl::ZeroOrMore);
 static cl::opt<bool>
 PollyViewer("polly-show",
        cl::desc("Enable the Polly DOT viewer in -O3"), cl::Hidden,
        cl::value_desc("Run the Polly DOT viewer at -O3"),
-       cl::init(false));
+       cl::init(false), cl::ZeroOrMore);
 
 static cl::opt<bool>
 DeadCodeElim("polly-run-dce",
              cl::desc("Run the dead code elimination"),
-             cl::Hidden, cl::init(false));
+             cl::Hidden, cl::init(false), cl::ZeroOrMore);
 
 static cl::opt<bool>
 PollyOnlyViewer("polly-show-only",





More information about the llvm-commits mailing list