[PATCH] [Verifier] Rephrase visitIntrinsicFunctionCall in terms of CallSites

Sanjoy Das sanjoy at playingwithpointers.com
Wed Jun 17 18:47:52 PDT 2015


I think this is okay to check in, modulo three inline comments (and that the `s/CI/CS` fix  happens post-commit).  However, it would be nice if someone else who's touched `CallSite.h` also takes a look.


================
Comment at: include/llvm/IR/CallSite.h:84
@@ -83,1 +83,3 @@
 
+  BasicBlock* getParent() { return getInstruction()->getParent(); }
+  const BasicBlock* getParent() const { return getInstruction()->getParent(); }
----------------
I think the type should be a template parameter so that we return a `const BasicBlock *` from an `ImmutableCallSite` and a `BasicBlock *` from a normal `CallSite`.

================
Comment at: include/llvm/IR/CallSite.h:200
@@ +199,3 @@
+
+  Value *getArgOperand(unsigned i) const { 
+    CALLSITE_DELEGATE_GETTER(getArgOperand(i));
----------------
Should be `ValTy *`.

================
Comment at: lib/IR/Verifier.cpp:108
@@ +107,3 @@
+      return;
+    Write(CS->getInstruction());
+  }
----------------
Why not just `Assert(..., CS.getInstruction())` instead?

http://reviews.llvm.org/D10118

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list