Changed parser to always use parenthesis on ConstExprs to be consistent
llvm-svn: 3363
diff --git a/llvm/lib/VMCore/AsmWriter.cpp b/llvm/lib/VMCore/AsmWriter.cpp
index 4658908..d8a1394 100644
--- a/llvm/lib/VMCore/AsmWriter.cpp
+++ b/llvm/lib/VMCore/AsmWriter.cpp
@@ -337,7 +337,7 @@
Out << CE->getOpcodeName();
bool isGEP = CE->getOpcode() == Instruction::GetElementPtr;
- Out << (isGEP ? " (" : " ");
+ Out << " (";
for (User::const_op_iterator OI=CE->op_begin(); OI != CE->op_end(); ++OI) {
printTypeInt(Out, (*OI)->getType(), TypeTable);
@@ -346,12 +346,11 @@
Out << ", ";
}
- if (isGEP)
- Out << ")";
- else if (CE->getOpcode() == Instruction::Cast) {
+ if (CE->getOpcode() == Instruction::Cast) {
Out << " to ";
printTypeInt(Out, CE->getType(), TypeTable);
}
+ Out << ")";
} else {
Out << "<placeholder or erroneous Constant>";