Move the code for printing out a warning about bytecode output to a console
authorReid Spencer <rspencer@reidspencer.com>
Sat, 1 Jan 2005 23:57:01 +0000 (23:57 +0000)
committerReid Spencer <rspencer@reidspencer.com>
Sat, 1 Jan 2005 23:57:01 +0000 (23:57 +0000)
into lib/Support so it can be used with other tools.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19238 91177308-0d34-0410-b5e6-96231b3b80d8

tools/opt/opt.cpp

index 3ca5d42272551185349bc6245c298aa61fc9f1b0..949c9b1d5c644a0b39b4d3285742efda659c5df6 100644 (file)
@@ -118,13 +118,7 @@ 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 
-        && !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"
-                << " bytecode first-hand, you can force output with the\n`-f'"
-                << " option.\n\n";
+    if (!Force && !NoOutput && !Quiet && CheckBytecodeOutputToConsole(Out)) {
       NoOutput = true;
     }