use early exits to reduce indentation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92335 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2009-12-31 02:33:14 +00:00
parent 85b1912dba
commit c65b72ca26

View File

@@ -1257,20 +1257,22 @@ private:
void AssemblyWriter::writeOperand(const Value *Operand, bool PrintType) { void AssemblyWriter::writeOperand(const Value *Operand, bool PrintType) {
if (Operand == 0) { if (Operand == 0) {
Out << "<null operand!>"; Out << "<null operand!>";
} else { return;
}
if (PrintType) { if (PrintType) {
TypePrinter.print(Operand->getType(), Out); TypePrinter.print(Operand->getType(), Out);
Out << ' '; Out << ' ';
} }
WriteAsOperandInternal(Out, Operand, &TypePrinter, &Machine); WriteAsOperandInternal(Out, Operand, &TypePrinter, &Machine);
} }
}
void AssemblyWriter::writeParamOperand(const Value *Operand, void AssemblyWriter::writeParamOperand(const Value *Operand,
Attributes Attrs) { Attributes Attrs) {
if (Operand == 0) { if (Operand == 0) {
Out << "<null operand!>"; Out << "<null operand!>";
} else { return;
}
// Print the type // Print the type
TypePrinter.print(Operand->getType(), Out); TypePrinter.print(Operand->getType(), Out);
// Print parameter attributes list // Print parameter attributes list
@@ -1280,7 +1282,6 @@ void AssemblyWriter::writeParamOperand(const Value *Operand,
// Print the operand // Print the operand
WriteAsOperandInternal(Out, Operand, &TypePrinter, &Machine); WriteAsOperandInternal(Out, Operand, &TypePrinter, &Machine);
} }
}
void AssemblyWriter::printModule(const Module *M) { void AssemblyWriter::printModule(const Module *M) {
if (!M->getModuleIdentifier().empty() && if (!M->getModuleIdentifier().empty() &&