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

Nick Desaulniers via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 10 12:11:56 PDT 2021


nickdesaulniers requested changes to this revision.
nickdesaulniers added inline comments.
This revision now requires changes to proceed.


================
Comment at: llvm/lib/IR/Value.cpp:67
     assert((VTy->isFirstClassType() || VTy->isVoidTy() || VTy->isStructTy()) &&
            "invalid CallInst type!");
   else if (SubclassID != BasicBlockVal &&
----------------
craig.topper wrote:
> 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.
I think there's a 4th class derived from `CallBase`: `GCStatePointInst`, though there's nothing in langref about it; seems like an intrinsic.  Probably should be fine.  The text of the assert can be cleaned up, too.


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