mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-14 23:48:56 +00:00
Fixed PR#596:
Add parenthesis around the value being negated; that way, if the value begins with a minus sign (e.g. negative integer), we won't generate a C predecrement operator by mistake. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22437 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
c5f44add43
commit
ce4e1e419e
@ -1361,9 +1361,9 @@ void CWriter::visitBinaryOperator(Instruction &I) {
|
||||
// If this is a negation operation, print it out as such. For FP, we don't
|
||||
// want to print "-0.0 - X".
|
||||
if (BinaryOperator::isNeg(&I)) {
|
||||
Out << "-";
|
||||
Out << "-(";
|
||||
writeOperand(BinaryOperator::getNegArgument(cast<BinaryOperator>(&I)));
|
||||
|
||||
Out << ")";
|
||||
} else {
|
||||
writeOperand(I.getOperand(0));
|
||||
|
||||
|
@ -1361,9 +1361,9 @@ void CWriter::visitBinaryOperator(Instruction &I) {
|
||||
// If this is a negation operation, print it out as such. For FP, we don't
|
||||
// want to print "-0.0 - X".
|
||||
if (BinaryOperator::isNeg(&I)) {
|
||||
Out << "-";
|
||||
Out << "-(";
|
||||
writeOperand(BinaryOperator::getNegArgument(cast<BinaryOperator>(&I)));
|
||||
|
||||
Out << ")";
|
||||
} else {
|
||||
writeOperand(I.getOperand(0));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user