[PATCH] D104043: [IR] Value: Fix OpCode checks
Nick Desaulniers via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 10 16:46:50 PDT 2021
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGffaca140d01b: [IR] Value: Fix OpCode checks (authored by samitolvanen, committed by nickdesaulniers).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D104043/new/
https://reviews.llvm.org/D104043
Files:
llvm/lib/IR/Value.cpp
Index: llvm/lib/IR/Value.cpp
===================================================================
--- llvm/lib/IR/Value.cpp
+++ llvm/lib/IR/Value.cpp
@@ -58,10 +58,13 @@
// FIXME: Why isn't this in the subclass gunk??
// Note, we cannot call isa<CallInst> before the CallInst has been
// constructed.
- if (SubclassID == Instruction::Call || SubclassID == Instruction::Invoke ||
- SubclassID == Instruction::CallBr)
+ unsigned OpCode = 0;
+ if (SubclassID >= InstructionVal)
+ OpCode = SubclassID - InstructionVal;
+ if (OpCode == Instruction::Call || OpCode == Instruction::Invoke ||
+ OpCode == Instruction::CallBr)
assert((VTy->isFirstClassType() || VTy->isVoidTy() || VTy->isStructTy()) &&
- "invalid CallInst type!");
+ "invalid CallBase type!");
else if (SubclassID != BasicBlockVal &&
(/*SubclassID < ConstantFirstVal ||*/ SubclassID > ConstantLastVal))
assert((VTy->isFirstClassType() || VTy->isVoidTy()) &&
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D104043.351302.patch
Type: text/x-patch
Size: 986 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210610/b46333d4/attachment-0001.bin>
More information about the llvm-commits
mailing list