[llvm-commits] CVS: llvm/tools/llvm-as/llvm-as.cpp
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::optbool +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; ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/tools/llvm-as/llvm-as.cpp
Changes in directory llvm/tools/llvm-as: llvm-as.cpp updated: 1.50 - 1.51 --- Log message: default to emiting an uncompressed .bc file --- Diffs of the changes: (+1 -1) llvm-as.cpp |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/tools/llvm-as/llvm-as.cpp diff -u llvm/tools/llvm-as/llvm-as.cpp:1.50 llvm/tools/llvm-as/llvm-as.cpp:1.51 --- llvm/tools/llvm-as/llvm-as.cpp:1.50 Wed Dec 6 19:30:31 2006 +++ llvm/tools/llvm-as/llvm-as.cpp Sun Jan 21 00:29:53 2007 @@ -43,7 +43,7 @@ DumpAsm(d, cl::desc(Print assembly as parsed), cl::Hidden); static cl::optbool -NoCompress(disable-compression, cl::init(false), +NoCompress(disable-compression, cl::init(true), cl::desc(Don't compress the generated bytecode)); static cl::optbool ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/tools/llvm-as/llvm-as.cpp
Changes in directory llvm/tools/llvm-as: llvm-as.cpp updated: 1.49 - 1.50 --- Log message: Changed llvm_ostream et all to OStream. llvm_cerr, llvm_cout, llvm_null, are now cerr, cout, and NullStream resp. --- Diffs of the changes: (+15 -15) llvm-as.cpp | 30 +++--- 1 files changed, 15 insertions(+), 15 deletions(-) Index: llvm/tools/llvm-as/llvm-as.cpp diff -u llvm/tools/llvm-as/llvm-as.cpp:1.49 llvm/tools/llvm-as/llvm-as.cpp:1.50 --- llvm/tools/llvm-as/llvm-as.cpp:1.49 Tue Dec 5 19:18:00 2006 +++ llvm/tools/llvm-as/llvm-as.cpp Wed Dec 6 19:30:31 2006 @@ -62,29 +62,29 @@ ParseError Err; std::auto_ptrModule M(ParseAssemblyFile(InputFilename,Err)); if (M.get() == 0) { - llvm_cerr argv[0] : Err.getMessage() \n; + cerr argv[0] : Err.getMessage() \n; return 1; } if (!DisableVerify) { std::string Err; if (verifyModule(*M.get(), ReturnStatusAction, Err)) { -llvm_cerr argv[0] - : assembly parsed, but does not verify as correct!\n; -llvm_cerr Err; +cerr argv[0] + : assembly parsed, but does not verify as correct!\n; +cerr Err; return 1; } } -if (DumpAsm) llvm_cerr Here's the assembly:\n *M.get(); +if (DumpAsm) cerr Here's the assembly:\n *M.get(); if (OutputFilename != ) { // Specified an output filename? if (OutputFilename != -) { // Not stdout? if (!Force std::ifstream(OutputFilename.c_str())) { // If force is not specified, make sure not to overwrite a file! - llvm_cerr argv[0] : error opening ' OutputFilename - ': file exists!\n - Use -f command line argument to force output\n; + cerr argv[0] : error opening ' OutputFilename +': file exists!\n +Use -f command line argument to force output\n; return 1; } Out = new std::ofstream(OutputFilename.c_str(), std::ios::out | @@ -110,9 +110,9 @@ if (!Force std::ifstream(OutputFilename.c_str())) { // If force is not specified, make sure not to overwrite a file! - llvm_cerr argv[0] : error opening ' OutputFilename - ': file exists!\n - Use -f command line argument to force output\n; + cerr argv[0] : error opening ' OutputFilename +': file exists!\n +Use -f command line argument to force output\n; return 1; } @@ -125,19 +125,19 @@ } if (!Out-good()) { - llvm_cerr argv[0] : error opening OutputFilename !\n; + cerr argv[0] : error opening OutputFilename !\n; return 1; } if (Force || !CheckBytecodeOutputToConsole(Out,true)) { - llvm_ostream L(*Out); + OStream L(*Out); WriteBytecodeToFile(M.get(), L, !NoCompress); } } catch (const std::string msg) { -llvm_cerr argv[0] : msg \n; +cerr argv[0] : msg \n; exitCode = 1; } catch (...) { -llvm_cerr argv[0] : Unexpected unknown exception occurred.\n; +cerr argv[0] : Unexpected unknown exception occurred.\n; exitCode = 1; } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/tools/llvm-as/llvm-as.cpp
Changes in directory llvm/tools/llvm-as: llvm-as.cpp updated: 1.48 - 1.49 --- Log message: make all llvm tools call llvm_shutdown when they exit, static'ify some stuff. With this change, I can now move -stats to print when llvm_shutdown is called. --- Diffs of the changes: (+2 -0) llvm-as.cpp |2 ++ 1 files changed, 2 insertions(+) Index: llvm/tools/llvm-as/llvm-as.cpp diff -u llvm/tools/llvm-as/llvm-as.cpp:1.48 llvm/tools/llvm-as/llvm-as.cpp:1.49 --- llvm/tools/llvm-as/llvm-as.cpp:1.48 Tue Nov 28 18:19:40 2006 +++ llvm/tools/llvm-as/llvm-as.cpp Tue Dec 5 19:18:00 2006 @@ -20,6 +20,7 @@ #include llvm/Bytecode/Writer.h #include llvm/Analysis/Verifier.h #include llvm/Support/CommandLine.h +#include llvm/Support/ManagedStatic.h #include llvm/Support/Streams.h #include llvm/Support/SystemUtils.h #include llvm/System/Signals.h @@ -50,6 +51,7 @@ cl::desc(Do not run verifier on input LLVM (dangerous!))); int main(int argc, char **argv) { + llvm_shutdown_obj X; // Call llvm_shutdown() on exit. cl::ParseCommandLineOptions(argc, argv, llvm .ll - .bc assembler\n); sys::PrintStackTraceOnErrorSignal(); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/tools/llvm-as/llvm-as.cpp
Changes in directory llvm/tools/llvm-as: llvm-as.cpp updated: 1.47 - 1.48 --- Log message: Replacing std::iostreams with llvm iostreams. Some of these changes involve adding a temporary wrapper around the ostream to make it friendly to functions expecting an LLVM stream. This should be fixed in the future. --- Diffs of the changes: (+12 -11) llvm-as.cpp | 23 --- 1 files changed, 12 insertions(+), 11 deletions(-) Index: llvm/tools/llvm-as/llvm-as.cpp diff -u llvm/tools/llvm-as/llvm-as.cpp:1.47 llvm/tools/llvm-as/llvm-as.cpp:1.48 --- llvm/tools/llvm-as/llvm-as.cpp:1.47 Fri Aug 18 03:43:06 2006 +++ llvm/tools/llvm-as/llvm-as.cpp Tue Nov 28 18:19:40 2006 @@ -20,12 +20,12 @@ #include llvm/Bytecode/Writer.h #include llvm/Analysis/Verifier.h #include llvm/Support/CommandLine.h +#include llvm/Support/Streams.h #include llvm/Support/SystemUtils.h #include llvm/System/Signals.h #include fstream #include iostream #include memory - using namespace llvm; static cl::optstd::string @@ -60,27 +60,27 @@ ParseError Err; std::auto_ptrModule M(ParseAssemblyFile(InputFilename,Err)); if (M.get() == 0) { - std::cerr argv[0] : Err.getMessage() \n; + llvm_cerr argv[0] : Err.getMessage() \n; return 1; } if (!DisableVerify) { std::string Err; if (verifyModule(*M.get(), ReturnStatusAction, Err)) { -std::cerr argv[0] +llvm_cerr argv[0] : assembly parsed, but does not verify as correct!\n; -std::cerr Err; +llvm_cerr Err; return 1; } } -if (DumpAsm) std::cerr Here's the assembly:\n *M.get(); +if (DumpAsm) llvm_cerr Here's the assembly:\n *M.get(); if (OutputFilename != ) { // Specified an output filename? if (OutputFilename != -) { // Not stdout? if (!Force std::ifstream(OutputFilename.c_str())) { // If force is not specified, make sure not to overwrite a file! - std::cerr argv[0] : error opening ' OutputFilename + llvm_cerr argv[0] : error opening ' OutputFilename ': file exists!\n Use -f command line argument to force output\n; return 1; @@ -108,7 +108,7 @@ if (!Force std::ifstream(OutputFilename.c_str())) { // If force is not specified, make sure not to overwrite a file! - std::cerr argv[0] : error opening ' OutputFilename + llvm_cerr argv[0] : error opening ' OutputFilename ': file exists!\n Use -f command line argument to force output\n; return 1; @@ -123,18 +123,19 @@ } if (!Out-good()) { - std::cerr argv[0] : error opening OutputFilename !\n; + llvm_cerr argv[0] : error opening OutputFilename !\n; return 1; } if (Force || !CheckBytecodeOutputToConsole(Out,true)) { - WriteBytecodeToFile(M.get(), *Out, !NoCompress); + llvm_ostream L(*Out); + WriteBytecodeToFile(M.get(), L, !NoCompress); } } catch (const std::string msg) { -std::cerr argv[0] : msg \n; +llvm_cerr argv[0] : msg \n; exitCode = 1; } catch (...) { -std::cerr argv[0] : Unexpected unknown exception occurred.\n; +llvm_cerr argv[0] : Unexpected unknown exception occurred.\n; exitCode = 1; } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/tools/llvm-as/llvm-as.cpp
Changes in directory llvm/tools/llvm-as: llvm-as.cpp updated: 1.45 - 1.46 --- Log message: Change the verifier to never throw an exception. Instead verifyModule canoptionally return the string error, which is an easier api for clients touse anyway. --- Diffs of the changes: (+8 -8) llvm-as.cpp | 16 1 files changed, 8 insertions(+), 8 deletions(-) Index: llvm/tools/llvm-as/llvm-as.cpp diff -u llvm/tools/llvm-as/llvm-as.cpp:1.45 llvm/tools/llvm-as/llvm-as.cpp:1.46 --- llvm/tools/llvm-as/llvm-as.cpp:1.45 Mon May 29 13:52:52 2006 +++ llvm/tools/llvm-as/llvm-as.cpp Thu Jul 6 13:01:01 2006 @@ -63,14 +63,14 @@ return 1; } -try { - if (!DisableVerify) -verifyModule(*M.get(), ThrowExceptionAction); -} catch (const std::string Err) { - std::cerr argv[0] - : assembly parsed, but does not verify as correct!\n; - std::cerr Err; - return 1; +if (!DisableVerify) { + std::string Err; + if (verifyModule(*M.get(), ReturnStatusAction, Err)) { +std::cerr argv[0] + : assembly parsed, but does not verify as correct!\n; +std::cerr Err; +return 1; + } } if (DumpAsm) std::cerr Here's the assembly:\n *M.get(); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/tools/llvm-as/llvm-as.cpp
Changes in directory llvm/tools/llvm-as: llvm-as.cpp updated: 1.44 - 1.45 --- Log message: Silly cleanup --- Diffs of the changes: (+1 -1) llvm-as.cpp |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/tools/llvm-as/llvm-as.cpp diff -u llvm/tools/llvm-as/llvm-as.cpp:1.44 llvm/tools/llvm-as/llvm-as.cpp:1.45 --- llvm/tools/llvm-as/llvm-as.cpp:1.44 Thu Apr 21 18:59:34 2005 +++ llvm/tools/llvm-as/llvm-as.cpp Mon May 29 13:52:52 2006 @@ -13,7 +13,7 @@ // llvm-as [options] x.ll - Read LLVM asm from the x.ll file, write bytecode //to the x.bc file. // -//====== +//===--===// #include llvm/Module.h #include llvm/Assembly/Parser.h ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits