llvm.org GIT mirror llvm / fffd837
[Analysis] Allow -scalar-evolution-max-iterations more than once At present, `-scalar-evolution-max-iterations` is a `cl::Optional` option, which means it demands to be passed exactly zero or one times. Our build system makes it pretty tricky to guarantee this. We often accidentally pass the flag more than once (but always with the same value) which results in an error, after which compilation fails: ``` clang (LLVM option parsing): for the -scalar-evolution-max-iterations option: may only occur zero or one times! ``` It seems reasonable to allow -scalar-evolution-max-iterations to be passed more than once. Quoting the [[ http://llvm.org/docs/CommandLine.html#controlling-the-number-of-occurrences-required-and-allowed | documentation ]]: > The cl::ZeroOrMore modifier ... indicates that your program will allow the option to be specified zero or more times. > ... > If an option is specified multiple times for an option of the cl::opt class, only the last value will be retained. Original patch by: Enrico Bern Hardy Tanuwidjaja <etanuwid@fb.com> Differential Revision: https://reviews.llvm.org/D67512 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372346 91177308-0d34-0410-b5e6-96231b3b80d8 Shoaib Meenai 1 year, 1 month ago
2 changed file(s) with 3 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
147147
148148 static cl::opt
149149 MaxBruteForceIterations("scalar-evolution-max-iterations", cl::ReallyHidden,
150 cl::ZeroOrMore,
150151 cl::desc("Maximum number of iterations SCEV will "
151152 "symbolically execute a constant "
152153 "derived loop"),
0 ; Ensure we can pass -scalar-evolution-max-iterations multiple times
1 ; RUN: opt -S -scalar-evolution -scalar-evolution-max-iterations=42 -scalar-evolution-max-iterations=42 < %s