summaryrefslogtreecommitdiffstats
path: root/llvm/tools/opt/opt.cpp
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2004-05-27 16:28:54 +0000
committerReid Spencer <rspencer@reidspencer.com>2004-05-27 16:28:54 +0000
commitc8878edc5a630255d0631b77024085a4e84db89b (patch)
tree284dc59fb0d9a3249cba039b75b2c4e280b2c9d9 /llvm/tools/opt/opt.cpp
parent09fabea814c248469c6e083f8db4d63d5ae94ab6 (diff)
downloadbcm5719-llvm-c8878edc5a630255d0631b77024085a4e84db89b.tar.gz
bcm5719-llvm-c8878edc5a630255d0631b77024085a4e84db89b.zip
Re-introduce the -q option and make opt always return 0, even if the
optimization pasess fail. This is necessary to avoid breaking feature tests in the tests suite that depend on this behavior. *sigh* llvm-svn: 13832
Diffstat (limited to 'llvm/tools/opt/opt.cpp')
-rw-r--r--llvm/tools/opt/opt.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/llvm/tools/opt/opt.cpp b/llvm/tools/opt/opt.cpp
index e70b7b00622..ace55d00a66 100644
--- a/llvm/tools/opt/opt.cpp
+++ b/llvm/tools/opt/opt.cpp
@@ -62,6 +62,9 @@ NoVerify("disable-verify", cl::desc("Do not verify result module"), cl::Hidden);
static cl::opt<bool>
Quiet("q", cl::desc("Don't print 'program modified' message"));
+static cl::alias
+QuietA("quiet", cl::desc("Alias for -q"), cl::aliasopt(Quiet));
+
//===----------------------------------------------------------------------===//
// main for opt
@@ -114,7 +117,8 @@ int main(int argc, char **argv) {
// If the output is set to be emitted to standard out, and standard out is a
// console, print out a warning message and refuse to do it. We don't impress
// anyone by spewing tons of binary goo to a terminal.
- if (Out == &std::cout && isStandardOutAConsole() && !Force && !NoOutput) {
+ if (Out == &std::cout && isStandardOutAConsole() && !Force && !NoOutput
+ && !Quiet) {
std::cerr << "WARNING: It looks like you're attempting to print out a "
<< "bytecode file. I'm\ngoing to pretend you didn't ask me to do"
<< " this (for your own good). If you\nREALLY want to taste LLVM"
@@ -161,8 +165,8 @@ int main(int argc, char **argv) {
Passes.add(new WriteBytecodePass(Out, Out != &std::cout));
// Now that we have all of the passes ready, run them.
- if (Passes.run(*M.get()))
+ if (Passes.run(*M.get()) )
return 0;
- return 1;
+ return 0;
}
OpenPOWER on IntegriCloud