[NFC] Add a method to just ask if a tuple AP vanishes under substitution

This commit is contained in:
John McCall
2023-06-29 14:49:59 -04:00
parent 622f7a26e9
commit e14f2bc0c7
6 changed files with 19 additions and 8 deletions

View File

@@ -1354,6 +1354,10 @@ public:
llvm::Optional<AbstractionPattern>
getVanishingTupleElementPatternType() const;
/// Does this tuple type vanish, i.e. is it flattened to a singleton
/// non-expansion element under substitution?
bool doesTupleVanish() const;
static AbstractionPattern
projectTupleElementType(const AbstractionPattern *base, size_t index) {
return base->getTupleElementType(index);

View File

@@ -224,6 +224,11 @@ public:
return origEltIndex == numOrigElts;
}
/// Does the entire original tuple vanish?
bool doesOrigTupleVanish() const {
return origTupleVanishes;
}
/// Advance to the next orig element.
void advance() {
assert(!isFinished());