Skip to content

Commit 856c47b

Browse files
authored
ConstraintElim: assert on invalid union field (NFC) (#115898)
getContextInst currently returns an invalid union field, when it is called with a ConditionFact, although existing callers don't do this. In order to error out early and serve as documentation for future callers, add an assert forbidding the behavior.
1 parent 76befc8 commit 856c47b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

llvm/lib/Transforms/Scalar/ConstraintElimination.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ struct FactOrCheck {
164164
}
165165

166166
Instruction *getContextInst() const {
167+
assert(!isConditionFact());
167168
if (Ty == EntryTy::UseCheck)
168169
return getContextInstForUse(*U);
169170
return Inst;

0 commit comments

Comments
 (0)