use early exits to reduce indentation.
authorChris Lattner <sabre@nondot.org>
Thu, 31 Dec 2009 02:33:14 +0000 (02:33 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 31 Dec 2009 02:33:14 +0000 (02:33 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92335 91177308-0d34-0410-b5e6-96231b3b80d8

lib/VMCore/AsmWriter.cpp

index b1b806adea7ea79969cd2fc84e5cdf119e114f4f..8ee364edbb3d342e2ac465bf28e3caabaeff094f 100644 (file)
@@ -1257,29 +1257,30 @@ private:
 void AssemblyWriter::writeOperand(const Value *Operand, bool PrintType) {
   if (Operand == 0) {
     Out << "<null operand!>";
-  } else {
-    if (PrintType) {
-      TypePrinter.print(Operand->getType(), Out);
-      Out << ' ';
-    }
-    WriteAsOperandInternal(Out, Operand, &TypePrinter, &Machine);
+    return;
+  }
+  if (PrintType) {
+    TypePrinter.print(Operand->getType(), Out);
+    Out << ' ';
   }
+  WriteAsOperandInternal(Out, Operand, &TypePrinter, &Machine);
 }
 
 void AssemblyWriter::writeParamOperand(const Value *Operand,
                                        Attributes Attrs) {
   if (Operand == 0) {
     Out << "<null operand!>";
-  } else {
-    // Print the type
-    TypePrinter.print(Operand->getType(), Out);
-    // Print parameter attributes list
-    if (Attrs != Attribute::None)
-      Out << ' ' << Attribute::getAsString(Attrs);
-    Out << ' ';
-    // Print the operand
-    WriteAsOperandInternal(Out, Operand, &TypePrinter, &Machine);
+    return;
   }
+
+  // Print the type
+  TypePrinter.print(Operand->getType(), Out);
+  // Print parameter attributes list
+  if (Attrs != Attribute::None)
+    Out << ' ' << Attribute::getAsString(Attrs);
+  Out << ' ';
+  // Print the operand
+  WriteAsOperandInternal(Out, Operand, &TypePrinter, &Machine);
 }
 
 void AssemblyWriter::printModule(const Module *M) {