[llvm-commits] [llvm] r95152 - in /llvm/trunk/lib/CodeGen: AsmPrinter/AsmPrinter.cpp LLVMTargetMachine.cpp

Chris Lattner sabre at nondot.org
Tue Feb 2 14:54:51 PST 2010


Author: lattner
Date: Tue Feb  2 16:54:51 2010
New Revision: 95152

URL: http://llvm.org/viewvc/llvm-project?rev=95152&view=rev
Log:
move handling of asm-verbose out of AsmPrinter.cpp into LLVMTargetMachine.cpp with the rest of the command line options.

Modified:
    llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
    llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp?rev=95152&r1=95151&r2=95152&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Tue Feb  2 16:54:51 2010
@@ -53,22 +53,9 @@
 
 STATISTIC(EmittedInsts, "Number of machine instrs printed");
 
-static cl::opt<cl::boolOrDefault>
-AsmVerbose("asm-verbose", cl::desc("Add comments to directives."),
-           cl::init(cl::BOU_UNSET));
-
-static bool getVerboseAsm(bool VDef) {
-  switch (AsmVerbose) {
-  default:
-  case cl::BOU_UNSET: return VDef;
-  case cl::BOU_TRUE:  return true;
-  case cl::BOU_FALSE: return false;
-  }      
-}
-
 char AsmPrinter::ID = 0;
 AsmPrinter::AsmPrinter(formatted_raw_ostream &o, TargetMachine &tm,
-                       const MCAsmInfo *T, bool VDef)
+                       const MCAsmInfo *T, bool VerboseAsm)
   : MachineFunctionPass(&ID), O(o),
     TM(tm), MAI(T), TRI(tm.getRegisterInfo()),
 
@@ -76,11 +63,11 @@
     // FIXME: Pass instprinter to streamer.
     OutStreamer(*createAsmStreamer(OutContext, O, *T,
                                    TM.getTargetData()->isLittleEndian(),
-                                   getVerboseAsm(VDef), 0)),
+                                   VerboseAsm, 0)),
 
     LastMI(0), LastFn(0), Counter(~0U), PrevDLT(NULL) {
   DW = 0; MMI = 0;
-  VerboseAsm = getVerboseAsm(VDef);
+  this->VerboseAsm = VerboseAsm;
 }
 
 AsmPrinter::~AsmPrinter() {

Modified: llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp?rev=95152&r1=95151&r2=95152&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp (original)
+++ llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp Tue Feb  2 16:54:51 2010
@@ -62,6 +62,18 @@
     cl::desc("Verify generated machine code"),
     cl::init(getenv("LLVM_VERIFY_MACHINEINSTRS")!=NULL));
 
+static cl::opt<cl::boolOrDefault>
+AsmVerbose("asm-verbose", cl::desc("Add comments to directives."),
+           cl::init(cl::BOU_UNSET));
+
+static bool getVerboseAsm(bool VDef) {
+  switch (AsmVerbose) {
+    default:
+    case cl::BOU_UNSET: return VDef;
+    case cl::BOU_TRUE:  return true;
+    case cl::BOU_FALSE: return false;
+  }      
+}
 
 // Enable or disable FastISel. Both options are needed, because
 // FastISel is enabled by default with -fast, and we wish to be
@@ -111,7 +123,7 @@
   case CGFT_AssemblyFile: {
     FunctionPass *Printer =
       getTarget().createAsmPrinter(Out, *this, getMCAsmInfo(),
-                                   getAsmVerbosityDefault());
+                                   getVerboseAsm(getAsmVerbosityDefault()));
     if (Printer == 0) return CGFT_ErrorOccurred;
     PM.add(Printer);
     break;





More information about the llvm-commits mailing list