1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 19:23:23 +01:00

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 -

llvm-svn: 19239
This commit is contained in:
Reid Spencer 2005-01-02 00:08:46 +00:00
parent 7d4a2f180f
commit fb233f641d

View File

@ -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 @@ int main(int argc, char **argv) {
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;