random code cleanups.
authorChris Lattner <sabre@nondot.org>
Sun, 23 Aug 2009 00:51:47 +0000 (00:51 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 23 Aug 2009 00:51:47 +0000 (00:51 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79798 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/AsmPrinter/AsmPrinter.cpp

index d2afe1e46dde38ad9cdf36d7e68f7342db04b1c8..c3175dd67509c5c6f206caca704b581efb5c4df1 100644 (file)
@@ -1751,27 +1751,25 @@ void AsmPrinter::EmitComments(const MachineInstr &MI) const {
 }
 
 /// EmitComments - Pretty-print comments for instructions
-void AsmPrinter::EmitComments(const MCInst &MI) const
-{
-  if (VerboseAsm) {
-    if (!MI.getDebugLoc().isUnknown()) {
-      DebugLocTuple DLT = MF->getDebugLocTuple(MI.getDebugLoc());
+void AsmPrinter::EmitComments(const MCInst &MI) const {
+  if (!VerboseAsm ||
+      MI.getDebugLoc().isUnknown())
+    return;
+  
+  DebugLocTuple DLT = MF->getDebugLocTuple(MI.getDebugLoc());
 
-      // Print source line info
-      O.PadToColumn(MAI->getCommentColumn());
-      O << MAI->getCommentString() << " SrcLine ";
-      if (DLT.CompileUnit->hasInitializer()) {
-        Constant *Name = DLT.CompileUnit->getInitializer();
-        if (ConstantArray *NameString = dyn_cast<ConstantArray>(Name))
-          if (NameString->isString()) {
-            O << NameString->getAsString() << " ";
-          }
-      }
-      O << DLT.Line;
-      if (DLT.Col != 0) 
-        O << ":" << DLT.Col;
-    }
+  // Print source line info
+  O.PadToColumn(MAI->getCommentColumn());
+  O << MAI->getCommentString() << " SrcLine ";
+  if (DLT.CompileUnit->hasInitializer()) {
+    Constant *Name = DLT.CompileUnit->getInitializer();
+    if (ConstantArray *NameString = dyn_cast<ConstantArray>(Name))
+      if (NameString->isString())
+        O << NameString->getAsString() << " ";
   }
+  O << DLT.Line;
+  if (DLT.Col != 0) 
+    O << ":" << DLT.Col;
 }
 
 /// PrintChildLoopComment - Print comments about child loops within