diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-12-20 15:55:23 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-12-20 15:55:23 -0800 |
commit | 731dde9cc830ebfa03a49f78dc06fd3bbb362950 (patch) | |
tree | 2d4b90d5a9cd50a61d7a713a68a6e21a9d0ee5df | |
parent | 093210d4dc1fa495d901b7689ecba36c7b5e2fc3 (diff) |
fix branch on constant
-rw-r--r-- | lib/Target/CppBackend/CPPBackend.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/Target/CppBackend/CPPBackend.cpp b/lib/Target/CppBackend/CPPBackend.cpp index c7b2feb30a..c413639939 100644 --- a/lib/Target/CppBackend/CPPBackend.cpp +++ b/lib/Target/CppBackend/CPPBackend.cpp @@ -253,7 +253,6 @@ namespace { std::string getValueAsCastStr(const Value*, AsmCast sign=ASM_SIGNED); std::string getValueAsParenStr(const Value*); std::string getValueAsCastParenStr(const Value*, AsmCast sign=ASM_SIGNED); - std::string getCppName(Type* val); std::string getCppName(const Value* val); @@ -1125,8 +1124,8 @@ void JSWriter::printFunctionBody(const Function *F) { BasicBlock *S1 = br->getSuccessor(1); std::string P0 = getPhiCode(&*BI, S0); std::string P1 = getPhiCode(&*BI, S1); - LLVMToRelooper[&*BI]->AddBranchTo(LLVMToRelooper[&*S0], getOpName(TI->getOperand(0)).c_str(), P0.size() > 0 ? P0.c_str() : NULL); - LLVMToRelooper[&*BI]->AddBranchTo(LLVMToRelooper[&*S1], NULL, P1.size() > 0 ? P1.c_str() : NULL); + LLVMToRelooper[&*BI]->AddBranchTo(LLVMToRelooper[&*S0], getValueAsStr(TI->getOperand(0)).c_str(), P0.size() > 0 ? P0.c_str() : NULL); + LLVMToRelooper[&*BI]->AddBranchTo(LLVMToRelooper[&*S1], NULL, P1.size() > 0 ? P1.c_str() : NULL); } else if (br->getNumOperands() == 1) { BasicBlock *S = br->getSuccessor(0); std::string P = getPhiCode(&*BI, S); |