In an amazing fit of stupidity, I flipped the conditional and didn't test
[oota-llvm.git] / tools / opt / opt.cpp
index 6cbf25111bf9d1eb71b899ddba509f2bd61d8569..f9f4ba08a1f23560bff0952512cd09c0ace54a6e 100644 (file)
@@ -127,7 +127,7 @@ int main(int argc, char **argv) {
 
   std::ostream *Out = &std::cout;  // Default to printing to stdout...
   if (OutputFilename != "") {
-    if (!Force && !std::ifstream(OutputFilename.c_str())) {
+    if (!Force && std::ifstream(OutputFilename.c_str())) {
       // If force is not specified, make sure not to overwrite a file!
       cerr << "Error opening '" << OutputFilename << "': File exists!\n"
            << "Use -f command line argument to force output\n";