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,29 +1257,30 @@ 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) {
TypePrinter.print(Operand->getType(), Out);
Out << ' ';
}
WriteAsOperandInternal(Out, Operand, &TypePrinter, &Machine);
} }
if (PrintType) {
TypePrinter.print(Operand->getType(), Out);
Out << ' ';
}
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
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);
} }
// 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) { void AssemblyWriter::printModule(const Module *M) {