mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-09 05:47:13 +00:00
add a temporary -bitcode option, which instructs llvm-as to produce a bitcode file instead of a bytecode file
llvm-svn: 36333
This commit is contained in:
parent
23910ea720
commit
dd27143526
@ -19,6 +19,7 @@
|
|||||||
#include "llvm/Assembly/Parser.h"
|
#include "llvm/Assembly/Parser.h"
|
||||||
#include "llvm/Bytecode/Writer.h"
|
#include "llvm/Bytecode/Writer.h"
|
||||||
#include "llvm/Analysis/Verifier.h"
|
#include "llvm/Analysis/Verifier.h"
|
||||||
|
#include "llvm/Bitcode/ReaderWriter.h"
|
||||||
#include "llvm/Support/CommandLine.h"
|
#include "llvm/Support/CommandLine.h"
|
||||||
#include "llvm/Support/ManagedStatic.h"
|
#include "llvm/Support/ManagedStatic.h"
|
||||||
#include "llvm/Support/Streams.h"
|
#include "llvm/Support/Streams.h"
|
||||||
@ -50,6 +51,10 @@ static cl::opt<bool>
|
|||||||
DisableVerify("disable-verify", cl::Hidden,
|
DisableVerify("disable-verify", cl::Hidden,
|
||||||
cl::desc("Do not run verifier on input LLVM (dangerous!)"));
|
cl::desc("Do not run verifier on input LLVM (dangerous!)"));
|
||||||
|
|
||||||
|
static cl::opt<bool>
|
||||||
|
EnableBitcode("bitcode", cl::desc("Emit bitcode"));
|
||||||
|
|
||||||
|
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
llvm_shutdown_obj X; // Call llvm_shutdown() on exit.
|
llvm_shutdown_obj X; // Call llvm_shutdown() on exit.
|
||||||
cl::ParseCommandLineOptions(argc, argv, " llvm .ll -> .bc assembler\n");
|
cl::ParseCommandLineOptions(argc, argv, " llvm .ll -> .bc assembler\n");
|
||||||
@ -130,8 +135,12 @@ int main(int argc, char **argv) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (Force || !CheckBytecodeOutputToConsole(Out,true)) {
|
if (Force || !CheckBytecodeOutputToConsole(Out,true)) {
|
||||||
OStream L(*Out);
|
if (EnableBitcode) {
|
||||||
WriteBytecodeToFile(M.get(), L, !NoCompress);
|
WriteBitcodeToFile(M.get(), *Out);
|
||||||
|
} else {
|
||||||
|
OStream L(*Out);
|
||||||
|
WriteBytecodeToFile(M.get(), L, !NoCompress);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (const std::string& msg) {
|
} catch (const std::string& msg) {
|
||||||
cerr << argv[0] << ": " << msg << "\n";
|
cerr << argv[0] << ": " << msg << "\n";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user