[llvm-commits] CVS: llvm/tools/llvm-as/llvm-as.cpp
Chris Lattner
sabre at nondot.org
Sat Apr 21 23:29:15 PDT 2007
Changes in directory llvm/tools/llvm-as:
llvm-as.cpp updated: 1.51 -> 1.52
---
Log message:
add a temporary -bitcode option, which instructs llvm-as to produce a bitcode file instead of a bytecode file
---
Diffs of the changes: (+11 -2)
llvm-as.cpp | 13 +++++++++++--
1 files changed, 11 insertions(+), 2 deletions(-)
Index: llvm/tools/llvm-as/llvm-as.cpp
diff -u llvm/tools/llvm-as/llvm-as.cpp:1.51 llvm/tools/llvm-as/llvm-as.cpp:1.52
--- llvm/tools/llvm-as/llvm-as.cpp:1.51 Sun Jan 21 00:29:53 2007
+++ llvm/tools/llvm-as/llvm-as.cpp Sun Apr 22 01:28:58 2007
@@ -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 @@
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 @@
}
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";
More information about the llvm-commits
mailing list