mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-09 11:25:55 +00: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 - git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19239 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -20,6 +20,7 @@
|
|||||||
#include "llvm/Bytecode/Writer.h"
|
#include "llvm/Bytecode/Writer.h"
|
||||||
#include "llvm/Analysis/Verifier.h"
|
#include "llvm/Analysis/Verifier.h"
|
||||||
#include "llvm/Support/CommandLine.h"
|
#include "llvm/Support/CommandLine.h"
|
||||||
|
#include "llvm/Support/SystemUtils.h"
|
||||||
#include "llvm/System/Signals.h"
|
#include "llvm/System/Signals.h"
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
@@ -124,7 +125,9 @@ int main(int argc, char **argv) {
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
WriteBytecodeToFile(M.get(), *Out, !NoCompress);
|
if (Force || !CheckBytecodeOutputToConsole(Out,true)) {
|
||||||
|
WriteBytecodeToFile(M.get(), *Out, !NoCompress);
|
||||||
|
}
|
||||||
} catch (const ParseException &E) {
|
} catch (const ParseException &E) {
|
||||||
std::cerr << argv[0] << ": " << E.getMessage() << "\n";
|
std::cerr << argv[0] << ": " << E.getMessage() << "\n";
|
||||||
exitCode = 1;
|
exitCode = 1;
|
||||||
|
Reference in New Issue
Block a user