Add support for the llvm.memmove intrinsic
[oota-llvm.git] / lib / VMCore / Verifier.cpp
index a9bcbd5f8f278186151d6c1360d9b73e28638ec1..e2ccb5b12b99fed706ca20babc9e407821f6ffff 100644 (file)
@@ -507,14 +507,15 @@ void Verifier::visitInstruction(Instruction &I) {
 
     else if (Instruction *Op = dyn_cast<Instruction>(I.getOperand(i))) {
       BasicBlock *OpBlock = Op->getParent();
-      // Invoke results are only usable in the normal destination, not in the
-      // exceptional destination.
-      if (InvokeInst *II = dyn_cast<InvokeInst>(Op))
-        OpBlock = II->getNormalDest();
 
       // Check that a definition dominates all of its uses.
       //
       if (!isa<PHINode>(I)) {
+        // Invoke results are only usable in the normal destination, not in the
+        // exceptional destination.
+        if (InvokeInst *II = dyn_cast<InvokeInst>(Op))
+          OpBlock = II->getNormalDest();
+
         // Definition must dominate use unless use is unreachable!
         Assert2(DS->dominates(OpBlock, BB) ||
                 !DS->dominates(&BB->getParent()->getEntryBlock(), BB),
@@ -560,6 +561,9 @@ void Verifier::visitIntrinsicFunctionCall(Intrinsic::ID ID, CallInst &CI) {
   case Intrinsic::dbg_region_end:  NumArgs = 1; break;
   case Intrinsic::dbg_func_start:  NumArgs = 1; break;
   case Intrinsic::dbg_declare:     NumArgs = 1; break;
+
+  case Intrinsic::memcpy:          NumArgs = 4; break;
+  case Intrinsic::memmove:         NumArgs = 4; break;
  
   case Intrinsic::alpha_ctlz:      NumArgs = 1; break;
   case Intrinsic::alpha_cttz:      NumArgs = 1; break;