projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
21db4cc
)
[NFC][IR] PHINode: assert we aren't trying to create token-typed PHI
author
Roman Lebedev
<lebedev.ri@gmail.com>
Tue, 27 Apr 2021 17:40:15 +0000
(20:40 +0300)
committer
Roman Lebedev
<lebedev.ri@gmail.com>
Tue, 27 Apr 2021 17:49:42 +0000
(20:49 +0300)
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.
llvm/include/llvm/IR/Instructions.h
patch
|
blob
|
history
diff --git
a/llvm/include/llvm/IR/Instructions.h
b/llvm/include/llvm/IR/Instructions.h
index
14ba509
..
650746c
100644
(file)
--- 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);
}