summaryrefslogtreecommitdiffstats
path: root/lldb/source/Expression/IRInterpreter.cpp
diff options
context:
space:
mode:
authorSean Callanan <scallanan@apple.com>2012-12-21 22:27:55 +0000
committerSean Callanan <scallanan@apple.com>2012-12-21 22:27:55 +0000
commitf466a6eddc24a7fc95795d1ccf10a6d69dbd6e96 (patch)
tree8ef38b97ab7e87cbd74a4851eea35f63ac869fcd /lldb/source/Expression/IRInterpreter.cpp
parent92f0dccbada26d0b937ff7ce5965e8286fd6a0f4 (diff)
downloadbcm5719-llvm-f466a6eddc24a7fc95795d1ccf10a6d69dbd6e96.tar.gz
bcm5719-llvm-f466a6eddc24a7fc95795d1ccf10a6d69dbd6e96.zip
Added support for the modulus operator (%) to
the IR interpreter. <rdar://problem/12921700> llvm-svn: 170934
Diffstat (limited to 'lldb/source/Expression/IRInterpreter.cpp')
-rw-r--r--lldb/source/Expression/IRInterpreter.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/lldb/source/Expression/IRInterpreter.cpp b/lldb/source/Expression/IRInterpreter.cpp
index 626e270ab3e..5fddc5c327b 100644
--- a/lldb/source/Expression/IRInterpreter.cpp
+++ b/lldb/source/Expression/IRInterpreter.cpp
@@ -1048,9 +1048,11 @@ IRInterpreter::supportsFunction (Function &llvm_function,
case Instruction::Mul:
case Instruction::Ret:
case Instruction::SDiv:
+ case Instruction::SRem:
case Instruction::Store:
case Instruction::Sub:
case Instruction::UDiv:
+ case Instruction::URem:
case Instruction::ZExt:
break;
}
@@ -1135,6 +1137,8 @@ IRInterpreter::runOnFunction (lldb::ClangExpressionVariableSP &result,
case Instruction::Mul:
case Instruction::SDiv:
case Instruction::UDiv:
+ case Instruction::SRem:
+ case Instruction::URem:
{
const BinaryOperator *bin_op = dyn_cast<BinaryOperator>(inst);
@@ -1192,6 +1196,12 @@ IRInterpreter::runOnFunction (lldb::ClangExpressionVariableSP &result,
case Instruction::UDiv:
result = L.GetRawBits64(0) / R.GetRawBits64(1);
break;
+ case Instruction::SRem:
+ result = L % R;
+ break;
+ case Instruction::URem:
+ result = L.GetRawBits64(0) % R.GetRawBits64(1);
+ break;
}
frame.AssignValue(inst, result, llvm_module);
OpenPOWER on IntegriCloud