simplify getVerboseAsm
authorChris Lattner <sabre@nondot.org>
Tue, 2 Feb 2010 22:58:13 +0000 (22:58 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 2 Feb 2010 22:58:13 +0000 (22:58 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95153 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/LLVMTargetMachine.cpp

index 3063e5e1efda50523151b4416f25a16adee43e9d..a4f313938d527751d74b71e233c3667f4ff8f7af 100644 (file)
@@ -66,12 +66,12 @@ static cl::opt<cl::boolOrDefault>
 AsmVerbose("asm-verbose", cl::desc("Add comments to directives."),
            cl::init(cl::BOU_UNSET));
 
-static bool getVerboseAsm(bool VDef) {
+static bool getVerboseAsm() {
   switch (AsmVerbose) {
-    default:
-    case cl::BOU_UNSET: return VDef;
-    case cl::BOU_TRUE:  return true;
-    case cl::BOU_FALSE: return false;
+  default:
+  case cl::BOU_UNSET: return TargetMachine::getAsmVerbosityDefault();
+  case cl::BOU_TRUE:  return true;
+  case cl::BOU_FALSE: return false;
   }      
 }
 
@@ -123,7 +123,7 @@ LLVMTargetMachine::addPassesToEmitFile(PassManagerBase &PM,
   case CGFT_AssemblyFile: {
     FunctionPass *Printer =
       getTarget().createAsmPrinter(Out, *this, getMCAsmInfo(),
-                                   getVerboseAsm(getAsmVerbosityDefault()));
+                                   getVerboseAsm());
     if (Printer == 0) return CGFT_ErrorOccurred;
     PM.add(Printer);
     break;