Assert that we have all use/users in the getters.
[oota-llvm.git] / lib / IR / Verifier.cpp
index 1a22d37ba8af94320761acffe28d53d520824649..9ed044638f321462c9dd6b6b6029914119fab766 100644 (file)
@@ -1831,7 +1831,9 @@ void Verifier::visitFunction(const Function &F) {
 
   // If this function is actually an intrinsic, verify that it is only used in
   // direct call/invokes, never having its "address taken".
-  if (F.getIntrinsicID()) {
+  // Only do this if the module is materialized, otherwise we don't have all the
+  // uses.
+  if (F.getIntrinsicID() && F.getParent()->isMaterialized()) {
     const User *U;
     if (F.hasAddressTaken(&U))
       Assert(0, "Invalid user of intrinsic instruction!", U);