Skip to content

Commit 858aa36

Browse files
committed
remove isdPartiallySubstituted, add comments
1 parent 9171151 commit 858aa36

File tree

4 files changed

+10
-13
lines changed

4 files changed

+10
-13
lines changed

clang/include/clang/AST/ExprCXX.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4547,12 +4547,9 @@ class PackIndexingExpr final
45474547
static PackIndexingExpr *CreateDeserialized(ASTContext &Context,
45484548
unsigned NumTransformedExprs);
45494549

4550+
// The index expression and all elements of the pack have been substituted.
45504551
bool isFullySubstituted() const { return FullySubstituted; }
45514552

4552-
bool isPartiallySubstituted() const {
4553-
return isValueDependent() && TransformedExpressions;
4554-
};
4555-
45564553
/// Determine if the expression was expanded to empty.
45574554
bool expandsToEmptyPack() const {
45584555
return isFullySubstituted() && TransformedExpressions == 0;

clang/lib/AST/ASTContext.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6446,9 +6446,9 @@ QualType ASTContext::getPackIndexingType(QualType Pattern, Expr *IndexExpr,
64466446
void *Mem = Allocate(
64476447
PackIndexingType::totalSizeToAlloc<QualType>(Expansions.size()),
64486448
TypeAlignment);
6449-
Canon = new (Mem)
6450-
PackIndexingType(QualType(), Pattern.getCanonicalType(),
6451-
IndexExpr, FullySubstituted, Expansions);
6449+
Canon =
6450+
new (Mem) PackIndexingType(QualType(), Pattern.getCanonicalType(),
6451+
IndexExpr, FullySubstituted, Expansions);
64526452
DependentPackIndexingTypes.InsertNode(Canon, InsertPos);
64536453
}
64546454
Canonical = QualType(Canon, 0);

clang/lib/AST/StmtProfile.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2293,7 +2293,7 @@ void StmtProfiler::VisitSizeOfPackExpr(const SizeOfPackExpr *S) {
22932293
void StmtProfiler::VisitPackIndexingExpr(const PackIndexingExpr *E) {
22942294
VisitExpr(E->getIndexExpr());
22952295

2296-
if (E->isPartiallySubstituted()) {
2296+
if (E->expandsToEmptyPack() || E->getExpressions().size() != 0) {
22972297
ID.AddInteger(E->getExpressions().size());
22982298
for (const Expr *Sub : E->getExpressions())
22992299
Visit(Sub);

clang/lib/AST/Type.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4176,7 +4176,8 @@ PackIndexingType::computeDependence(QualType Pattern, Expr *IndexExpr,
41764176

41774177
void PackIndexingType::Profile(llvm::FoldingSetNodeID &ID,
41784178
const ASTContext &Context) {
4179-
Profile(ID, Context, getPattern(), getIndexExpr(), isFullySubstituted(), getExpansions());
4179+
Profile(ID, Context, getPattern(), getIndexExpr(), isFullySubstituted(),
4180+
getExpansions());
41804181
}
41814182

41824183
void PackIndexingType::Profile(llvm::FoldingSetNodeID &ID,
@@ -4186,12 +4187,11 @@ void PackIndexingType::Profile(llvm::FoldingSetNodeID &ID,
41864187

41874188
E->Profile(ID, Context, true);
41884189
ID.AddBoolean(FullySubstituted);
4189-
if(!Expansions.empty()) {
4190+
if (!Expansions.empty()) {
41904191
ID.AddInteger(Expansions.size());
4191-
for(QualType T : Expansions)
4192+
for (QualType T : Expansions)
41924193
T.getCanonicalType().Profile(ID);
4193-
}
4194-
else {
4194+
} else {
41954195
Pattern.Profile(ID);
41964196
}
41974197
}

0 commit comments

Comments
 (0)