From: Roman Lebedev Date: Tue, 27 Apr 2021 17:40:15 +0000 (+0300) Subject: [NFC][IR] PHINode: assert we aren't trying to create token-typed PHI X-Git-Tag: llvmorg-14-init~8302 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1ebbf84ba45b1af8b6469f79a6c6798d185bc1d2;p=platform%2Fupstream%2Fllvm.git [NFC][IR] PHINode: assert we aren't trying to create token-typed PHI Verifier will complain, but by then it may be too late, because we might have never reached it because we already crashed with some bogus bug. It is best to catch this the moment it happens. --- diff --git a/llvm/include/llvm/IR/Instructions.h b/llvm/include/llvm/IR/Instructions.h index 14ba509..650746c 100644 --- a/llvm/include/llvm/IR/Instructions.h +++ b/llvm/include/llvm/IR/Instructions.h @@ -2583,6 +2583,7 @@ class PHINode : public Instruction { Instruction *InsertBefore = nullptr) : Instruction(Ty, Instruction::PHI, nullptr, 0, InsertBefore), ReservedSpace(NumReservedValues) { + assert(!Ty->isTokenTy() && "PHI nodes cannot have token type!"); setName(NameStr); allocHungoffUses(ReservedSpace); }