use dump method instead of Asm/Writer to do debug printing
authorChris Lattner <sabre@nondot.org>
Sun, 7 Apr 2002 22:34:19 +0000 (22:34 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 7 Apr 2002 22:34:19 +0000 (22:34 +0000)
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

tools/as/as.cpp
tools/llvm-as/as.cpp
tools/llvm-as/llvm-as.cpp

index 59049748354e6984b2775d3bd758869e82297993..7bea711826e57c4b5ce0c8c3db87cb5b4058c05e 100644 (file)
@@ -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;
index 59049748354e6984b2775d3bd758869e82297993..7bea711826e57c4b5ce0c8c3db87cb5b4058c05e 100644 (file)
@@ -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;
index 59049748354e6984b2775d3bd758869e82297993..7bea711826e57c4b5ce0c8c3db87cb5b4058c05e 100644 (file)
@@ -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;