[clang] [HLSL] add support for HLSLAggregateSplatCast and HLSLElementwiseCast to constant expression evaluator (PR #164700)
via cfe-commits
cfe-commits at lists.llvm.org
Thu Oct 30 14:09:35 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 origin/main HEAD --extensions cpp -- clang/lib/AST/ExprConstant.cpp --diff_from_common_commit
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/clang/lib/AST/ExprConstant.cpp b/clang/lib/AST/ExprConstant.cpp
index a961e4869..f093737a1 100644
--- a/clang/lib/AST/ExprConstant.cpp
+++ b/clang/lib/AST/ExprConstant.cpp
@@ -11243,8 +11243,7 @@ bool RecordExprEvaluator::VisitCastExpr(const CastExpr *E) {
// flatten the source
SmallVector<APValue> SrcEls;
SmallVector<QualType> SrcTypes;
- if (!flattenAPValue(Info.Ctx, Val, SE->getType(), SrcEls, SrcTypes,
- NEls))
+ if (!flattenAPValue(Info.Ctx, Val, SE->getType(), SrcEls, SrcTypes, NEls))
return Error(E);
// cast the elements and construct our struct result
@@ -13796,8 +13795,7 @@ bool ArrayExprEvaluator::VisitCastExpr(const CastExpr *E) {
// flatten the source
SmallVector<APValue> SrcEls;
SmallVector<QualType> SrcTypes;
- if (!flattenAPValue(Info.Ctx, Val, SE->getType(), SrcEls, SrcTypes,
- NEls))
+ if (!flattenAPValue(Info.Ctx, Val, SE->getType(), SrcEls, SrcTypes, NEls))
return Error(E);
// cast the elements
``````````
</details>
https://github.com/llvm/llvm-project/pull/164700
More information about the cfe-commits
mailing list