diff options
author | Chris Lattner <sabre@nondot.org> | 2007-04-22 06:28:58 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-04-22 06:28:58 +0000 |
commit | 27bb3af61c44f92bb3939e7020ee61fb0779e46a (patch) | |
tree | 37dd07237a3f672b9a027d28bac836b36915de18 /tools/llvm-as | |
parent | 6742b4df5c884bd6aafb36cdb8b1b5cf7b075618 (diff) | |
download | external_llvm-27bb3af61c44f92bb3939e7020ee61fb0779e46a.zip external_llvm-27bb3af61c44f92bb3939e7020ee61fb0779e46a.tar.gz external_llvm-27bb3af61c44f92bb3939e7020ee61fb0779e46a.tar.bz2 |
add a temporary -bitcode option, which instructs llvm-as to produce a bitcode file instead of a bytecode file
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36333 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-as')
-rw-r--r-- | tools/llvm-as/llvm-as.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/tools/llvm-as/llvm-as.cpp b/tools/llvm-as/llvm-as.cpp index e3dbfb4..a7463b5 100644 --- a/tools/llvm-as/llvm-as.cpp +++ b/tools/llvm-as/llvm-as.cpp @@ -19,6 +19,7 @@ #include "llvm/Assembly/Parser.h" #include "llvm/Bytecode/Writer.h" #include "llvm/Analysis/Verifier.h" +#include "llvm/Bitcode/ReaderWriter.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/ManagedStatic.h" #include "llvm/Support/Streams.h" @@ -50,6 +51,10 @@ static cl::opt<bool> DisableVerify("disable-verify", cl::Hidden, 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) { llvm_shutdown_obj X; // Call llvm_shutdown() on exit. cl::ParseCommandLineOptions(argc, argv, " llvm .ll -> .bc assembler\n"); @@ -130,8 +135,12 @@ int main(int argc, char **argv) { } if (Force || !CheckBytecodeOutputToConsole(Out,true)) { - OStream L(*Out); - WriteBytecodeToFile(M.get(), L, !NoCompress); + if (EnableBitcode) { + WriteBitcodeToFile(M.get(), *Out); + } else { + OStream L(*Out); + WriteBytecodeToFile(M.get(), L, !NoCompress); + } } } catch (const std::string& msg) { cerr << argv[0] << ": " << msg << "\n"; |