[Lldb-commits] [lldb] r170934 - /lldb/trunk/source/Expression/IRInterpreter.cpp

Sean Callanan scallanan at apple.com
Fri Dec 21 14:27:55 PST 2012


Author: spyffe
Date: Fri Dec 21 16:27:55 2012
New Revision: 170934

URL: http://llvm.org/viewvc/llvm-project?rev=170934&view=rev
Log:
Added support for the modulus operator (%) to
the IR interpreter.

<rdar://problem/12921700>

Modified:
    lldb/trunk/source/Expression/IRInterpreter.cpp

Modified: lldb/trunk/source/Expression/IRInterpreter.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/IRInterpreter.cpp?rev=170934&r1=170933&r2=170934&view=diff
==============================================================================
--- lldb/trunk/source/Expression/IRInterpreter.cpp (original)
+++ lldb/trunk/source/Expression/IRInterpreter.cpp Fri Dec 21 16:27:55 2012
@@ -1048,9 +1048,11 @@
             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 @@
         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 @@
                 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);





More information about the lldb-commits mailing list