mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-07 14:33:15 +00:00
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
This commit is contained in:
parent
d78700de8e
commit
1c93e5bd26
@ -337,7 +337,7 @@ static void WriteConstantInt(ostream &Out, const Constant *CV, bool PrintName,
|
|||||||
Out << CE->getOpcodeName();
|
Out << CE->getOpcodeName();
|
||||||
|
|
||||||
bool isGEP = CE->getOpcode() == Instruction::GetElementPtr;
|
bool isGEP = CE->getOpcode() == Instruction::GetElementPtr;
|
||||||
Out << (isGEP ? " (" : " ");
|
Out << " (";
|
||||||
|
|
||||||
for (User::const_op_iterator OI=CE->op_begin(); OI != CE->op_end(); ++OI) {
|
for (User::const_op_iterator OI=CE->op_begin(); OI != CE->op_end(); ++OI) {
|
||||||
printTypeInt(Out, (*OI)->getType(), TypeTable);
|
printTypeInt(Out, (*OI)->getType(), TypeTable);
|
||||||
@ -346,12 +346,11 @@ static void WriteConstantInt(ostream &Out, const Constant *CV, bool PrintName,
|
|||||||
Out << ", ";
|
Out << ", ";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isGEP)
|
if (CE->getOpcode() == Instruction::Cast) {
|
||||||
Out << ")";
|
|
||||||
else if (CE->getOpcode() == Instruction::Cast) {
|
|
||||||
Out << " to ";
|
Out << " to ";
|
||||||
printTypeInt(Out, CE->getType(), TypeTable);
|
printTypeInt(Out, CE->getType(), TypeTable);
|
||||||
}
|
}
|
||||||
|
Out << ")";
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
Out << "<placeholder or erroneous Constant>";
|
Out << "<placeholder or erroneous Constant>";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user