[llvm-commits] CVS: llvm/tools/llvm-as/llvm-as.cpp

Reid Spencer reid at x10sys.com
Sat Jan 1 16:08:57 PST 2005



Changes in directory llvm/tools/llvm-as:

llvm-as.cpp updated: 1.40 -> 1.41
---
Log message:

Prevent output of bytecode to std::cout unless the --force flag is given.
This prevents bytecode splats with usage like: cat file.ll | llvm-as -


---
Diffs of the changes:  (+4 -1)

Index: llvm/tools/llvm-as/llvm-as.cpp
diff -u llvm/tools/llvm-as/llvm-as.cpp:1.40 llvm/tools/llvm-as/llvm-as.cpp:1.41
--- llvm/tools/llvm-as/llvm-as.cpp:1.40	Sat Jan  1 16:10:32 2005
+++ llvm/tools/llvm-as/llvm-as.cpp	Sat Jan  1 18:08:46 2005
@@ -20,6 +20,7 @@
 #include "llvm/Bytecode/Writer.h"
 #include "llvm/Analysis/Verifier.h"
 #include "llvm/Support/CommandLine.h"
+#include "llvm/Support/SystemUtils.h"
 #include "llvm/System/Signals.h"
 #include <fstream>
 #include <iostream>
@@ -124,7 +125,9 @@
       return 1;
     }
    
-    WriteBytecodeToFile(M.get(), *Out, !NoCompress);
+    if (Force || !CheckBytecodeOutputToConsole(Out,true)) {
+      WriteBytecodeToFile(M.get(), *Out, !NoCompress);
+    }
   } catch (const ParseException &E) {
     std::cerr << argv[0] << ": " << E.getMessage() << "\n";
     exitCode = 1;






More information about the llvm-commits mailing list