diff options
author | Chris Lattner <sabre@nondot.org> | 2002-08-16 21:17:11 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-08-16 21:17:11 +0000 |
commit | 1c93e5bd26cf1b41ed7bdf5561b8f20607488b0f (patch) | |
tree | 2b6a6db2d7065b90152785593a2a31ce6c65d5c7 /lib/VMCore/AsmWriter.cpp | |
parent | d78700de8e01dd53b1e98a21163fd4e461501d6b (diff) |
Changed parser to always use parenthesis on ConstExprs to be consistent
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3363 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/AsmWriter.cpp')
-rw-r--r-- | lib/VMCore/AsmWriter.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/VMCore/AsmWriter.cpp b/lib/VMCore/AsmWriter.cpp index 465890858f..d8a1394497 100644 --- a/lib/VMCore/AsmWriter.cpp +++ b/lib/VMCore/AsmWriter.cpp @@ -337,7 +337,7 @@ static void WriteConstantInt(ostream &Out, const Constant *CV, bool PrintName, 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 @@ static void WriteConstantInt(ostream &Out, const Constant *CV, bool PrintName, 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>"; |