[clang] [Clang] Fix pack indexing profiling (PR #139276)
via cfe-commits
cfe-commits at lists.llvm.org
Fri May 9 07:58:56 PDT 2025
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff HEAD~1 HEAD --extensions h,cpp -- clang/include/clang/AST/ASTContext.h clang/include/clang/AST/ExprCXX.h clang/include/clang/AST/Type.h clang/lib/AST/ASTContext.cpp clang/lib/AST/StmtProfile.cpp clang/lib/AST/Type.cpp clang/test/SemaTemplate/concepts-out-of-line-def.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index 0f90eb07b..0ace0a55a 100644
--- a/clang/lib/AST/ASTContext.cpp
+++ b/clang/lib/AST/ASTContext.cpp
@@ -6446,9 +6446,9 @@ QualType ASTContext::getPackIndexingType(QualType Pattern, Expr *IndexExpr,
void *Mem = Allocate(
PackIndexingType::totalSizeToAlloc<QualType>(Expansions.size()),
TypeAlignment);
- Canon = new (Mem)
- PackIndexingType(QualType(), Pattern.getCanonicalType(),
- IndexExpr, FullySubstituted, Expansions);
+ Canon =
+ new (Mem) PackIndexingType(QualType(), Pattern.getCanonicalType(),
+ IndexExpr, FullySubstituted, Expansions);
DependentPackIndexingTypes.InsertNode(Canon, InsertPos);
}
Canonical = QualType(Canon, 0);
diff --git a/clang/lib/AST/Type.cpp b/clang/lib/AST/Type.cpp
index b6099b9e0..9b37f25e7 100644
--- a/clang/lib/AST/Type.cpp
+++ b/clang/lib/AST/Type.cpp
@@ -4175,7 +4175,8 @@ PackIndexingType::computeDependence(QualType Pattern, Expr *IndexExpr,
void PackIndexingType::Profile(llvm::FoldingSetNodeID &ID,
const ASTContext &Context) {
- Profile(ID, Context, getPattern(), getIndexExpr(), isFullySubstituted(), getExpansions());
+ Profile(ID, Context, getPattern(), getIndexExpr(), isFullySubstituted(),
+ getExpansions());
}
void PackIndexingType::Profile(llvm::FoldingSetNodeID &ID,
@@ -4185,12 +4186,11 @@ void PackIndexingType::Profile(llvm::FoldingSetNodeID &ID,
E->Profile(ID, Context, true);
ID.AddBoolean(FullySubstituted);
- if(!Expansions.empty()) {
+ if (!Expansions.empty()) {
ID.AddInteger(Expansions.size());
- for(QualType T : Expansions)
+ for (QualType T : Expansions)
T.getCanonicalType().Profile(ID);
- }
- else {
+ } else {
Pattern.Profile(ID);
}
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/139276
More information about the cfe-commits
mailing list