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 | cfe8f53a4b82dab02a5ae8fd2e89e55d9910c300 (patch) | |
| tree | 07fdca98abdc11e432562e398dfab0749607eebe /llvm/lib | |
| parent | 7f325cd0bcc511efc7df09e89bedb9798b48966d (diff) | |
| download | llvm-cfe8f53a4b82dab02a5ae8fd2e89e55d9910c300.zip llvm-cfe8f53a4b82dab02a5ae8fd2e89e55d9910c300.tar.gz llvm-cfe8f53a4b82dab02a5ae8fd2e89e55d9910c300.tar.bz2 | |
Changed parser to always use parenthesis on ConstExprs to be consistent
llvm-svn: 3363
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/VMCore/AsmWriter.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/llvm/lib/VMCore/AsmWriter.cpp b/llvm/lib/VMCore/AsmWriter.cpp index 46589085..d8a1394 100644 --- a/llvm/lib/VMCore/AsmWriter.cpp +++ b/llvm/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>"; |
