diff options
| author | Chris Lattner <sabre@nondot.org> | 2009-12-31 02:33:14 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2009-12-31 02:33:14 +0000 |
| commit | b419a1e44f66b43a64dd225290bb2bee518c5af5 (patch) | |
| tree | 3871556b4a0d056bebf161bef0822ccc7ca0c544 /llvm/lib/VMCore/AsmWriter.cpp | |
| parent | cdec581a355b77064c3083eb1999cf4dd3c29d7e (diff) | |
| download | bcm5719-llvm-b419a1e44f66b43a64dd225290bb2bee518c5af5.tar.gz bcm5719-llvm-b419a1e44f66b43a64dd225290bb2bee518c5af5.zip | |
use early exits to reduce indentation.
llvm-svn: 92335
Diffstat (limited to 'llvm/lib/VMCore/AsmWriter.cpp')
| -rw-r--r-- | llvm/lib/VMCore/AsmWriter.cpp | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/llvm/lib/VMCore/AsmWriter.cpp b/llvm/lib/VMCore/AsmWriter.cpp index b1b806adea7..8ee364edbb3 100644 --- a/llvm/lib/VMCore/AsmWriter.cpp +++ b/llvm/lib/VMCore/AsmWriter.cpp @@ -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) { |

