diff options
author | Chris Lattner <sabre@nondot.org> | 2002-04-07 22:34:19 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-04-07 22:34:19 +0000 |
commit | 06272dcfb277367caddb578fb7f0e1cade8c00e5 (patch) | |
tree | ab02f5d910a40c11b4a8c7170c14a37c5197744b /tools/llvm-as | |
parent | 25d15a7ff75f04a26c9643e849807895ab67babd (diff) | |
download | external_llvm-06272dcfb277367caddb578fb7f0e1cade8c00e5.zip external_llvm-06272dcfb277367caddb578fb7f0e1cade8c00e5.tar.gz external_llvm-06272dcfb277367caddb578fb7f0e1cade8c00e5.tar.bz2 |
use dump method instead of Asm/Writer to do debug printing
Rename C to M because C used to be 'Class' and now we are 'Module'
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2151 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-as')
-rw-r--r-- | tools/llvm-as/as.cpp | 13 | ||||
-rw-r--r-- | tools/llvm-as/llvm-as.cpp | 13 |
2 files changed, 14 insertions, 12 deletions
diff --git a/tools/llvm-as/as.cpp b/tools/llvm-as/as.cpp index 5904974..7bea711 100644 --- a/tools/llvm-as/as.cpp +++ b/tools/llvm-as/as.cpp @@ -11,7 +11,6 @@ #include "llvm/Module.h" #include "llvm/Assembly/Parser.h" -#include "llvm/Assembly/Writer.h" #include "llvm/Bytecode/Writer.h" #include "Support/CommandLine.h" #include <fstream> @@ -29,14 +28,16 @@ int main(int argc, char **argv) { ostream *Out = 0; try { // Parse the file now... - std::auto_ptr<Module> C(ParseAssemblyFile(InputFilename)); - if (C.get() == 0) { + std::auto_ptr<Module> M(ParseAssemblyFile(InputFilename)); + if (M.get() == 0) { cerr << "assembly didn't read correctly.\n"; return 1; } - if (DumpAsm) - cerr << "Here's the assembly:\n" << C.get(); + if (DumpAsm) { + cerr << "Here's the assembly:\n"; + M.get()->dump(); + } if (OutputFilename != "") { // Specified an output filename? if (!Force && std::ifstream(OutputFilename.c_str())) { @@ -77,7 +78,7 @@ int main(int argc, char **argv) { return 1; } - WriteBytecodeToFile(C.get(), *Out); + WriteBytecodeToFile(M.get(), *Out); } catch (const ParseException &E) { cerr << E.getMessage() << endl; return 1; diff --git a/tools/llvm-as/llvm-as.cpp b/tools/llvm-as/llvm-as.cpp index 5904974..7bea711 100644 --- a/tools/llvm-as/llvm-as.cpp +++ b/tools/llvm-as/llvm-as.cpp @@ -11,7 +11,6 @@ #include "llvm/Module.h" #include "llvm/Assembly/Parser.h" -#include "llvm/Assembly/Writer.h" #include "llvm/Bytecode/Writer.h" #include "Support/CommandLine.h" #include <fstream> @@ -29,14 +28,16 @@ int main(int argc, char **argv) { ostream *Out = 0; try { // Parse the file now... - std::auto_ptr<Module> C(ParseAssemblyFile(InputFilename)); - if (C.get() == 0) { + std::auto_ptr<Module> M(ParseAssemblyFile(InputFilename)); + if (M.get() == 0) { cerr << "assembly didn't read correctly.\n"; return 1; } - if (DumpAsm) - cerr << "Here's the assembly:\n" << C.get(); + if (DumpAsm) { + cerr << "Here's the assembly:\n"; + M.get()->dump(); + } if (OutputFilename != "") { // Specified an output filename? if (!Force && std::ifstream(OutputFilename.c_str())) { @@ -77,7 +78,7 @@ int main(int argc, char **argv) { return 1; } - WriteBytecodeToFile(C.get(), *Out); + WriteBytecodeToFile(M.get(), *Out); } catch (const ParseException &E) { cerr << E.getMessage() << endl; return 1; |