[PATCH] D104043: [IR] Value: Fix OpCode checks

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 10 11:59:51 PDT 2021


craig.topper added inline comments.


================
Comment at: llvm/lib/IR/Value.cpp:67
     assert((VTy->isFirstClassType() || VTy->isVoidTy() || VTy->isStructTy()) &&
            "invalid CallInst type!");
   else if (SubclassID != BasicBlockVal &&
----------------
Can we change this to CallBase while we're here? Only one of those opcodes is CallInst, the others are InvokeInst and CallBrInst. They all inherit from CallBase.

I was hoping there was a better constructor on CallBase to stash this in to simplify things, but I don't think there is.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D104043/new/

https://reviews.llvm.org/D104043



More information about the llvm-commits mailing list