aboutsummaryrefslogtreecommitdiff
path: root/lib/Target/CppBackend/CPPBackend.cpp
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-12-20 13:40:28 -0800
committerAlon Zakai <alonzakai@gmail.com>2013-12-20 13:40:28 -0800
commit093210d4dc1fa495d901b7689ecba36c7b5e2fc3 (patch)
tree41c3de1b25877062cdf544a7737d26e722e07ed0 /lib/Target/CppBackend/CPPBackend.cpp
parent5d6485adfbec4ed65bb2e8bcb64bc2d2d186ab1e (diff)
fix parens in ashr/lshr
Diffstat (limited to 'lib/Target/CppBackend/CPPBackend.cpp')
-rw-r--r--lib/Target/CppBackend/CPPBackend.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Target/CppBackend/CPPBackend.cpp b/lib/Target/CppBackend/CPPBackend.cpp
index 2ca1e92d25..c7b2feb30a 100644
--- a/lib/Target/CppBackend/CPPBackend.cpp
+++ b/lib/Target/CppBackend/CPPBackend.cpp
@@ -837,7 +837,7 @@ std::string JSWriter::generateInstruction(const Instruction *I) {
case Instruction::LShr: {
std::string Input = getValueAsStr(I->getOperand(0));
if (I->getType()->getIntegerBitWidth() < 32) {
- Input = getParenCast(Input, I->getType(), opcode == Instruction::AShr ? ASM_SIGNED : ASM_UNSIGNED); // fill in high bits, as shift needs those and is done in 32-bit
+ Input = '(' + getCast(Input, I->getType(), opcode == Instruction::AShr ? ASM_SIGNED : ASM_UNSIGNED) + ')'; // fill in high bits, as shift needs those and is done in 32-bit
}
text += Input + (opcode == Instruction::AShr ? " >> " : " >>> ") + getValueAsStr(I->getOperand(1));
break;