[clang] [HLSL] Implement array temporary support (PR #79382)

via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 24 14:43:27 PST 2024


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 6e4930c67508a90bdfd756f6e45417b5253cd741 d01d3dd8de6e955ad19a0ad8399547dbc59f7a52 -- clang/include/clang/AST/Expr.h clang/include/clang/AST/RecursiveASTVisitor.h clang/lib/AST/Expr.cpp clang/lib/AST/ExprClassification.cpp clang/lib/AST/ExprConstant.cpp clang/lib/AST/ItaniumMangle.cpp clang/lib/AST/StmtPrinter.cpp clang/lib/AST/StmtProfile.cpp clang/lib/CodeGen/CGExpr.cpp clang/lib/CodeGen/CGExprAgg.cpp clang/lib/Sema/SemaExceptionSpec.cpp clang/lib/Sema/SemaInit.cpp clang/lib/Sema/TreeTransform.h clang/lib/Serialization/ASTReaderStmt.cpp clang/lib/Serialization/ASTWriterStmt.cpp clang/lib/StaticAnalyzer/Core/ExprEngine.cpp clang/tools/libclang/CXCursor.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/clang/lib/AST/Expr.cpp b/clang/lib/AST/Expr.cpp
index 5903e2763d..35b80ecc39 100644
--- a/clang/lib/AST/Expr.cpp
+++ b/clang/lib/AST/Expr.cpp
@@ -5229,8 +5229,8 @@ OMPIteratorExpr *OMPIteratorExpr::CreateEmpty(const ASTContext &Context,
   return new (Mem) OMPIteratorExpr(EmptyShell(), NumIterators);
 }
 
-HLSLArrayTemporaryExpr *
-HLSLArrayTemporaryExpr::Create(const ASTContext &Ctx, Expr *Base) {
+HLSLArrayTemporaryExpr *HLSLArrayTemporaryExpr::Create(const ASTContext &Ctx,
+                                                       Expr *Base) {
   return new (Ctx) HLSLArrayTemporaryExpr(Base);
 }
 
diff --git a/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp b/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp
index 39cdec7886..da29cbeea0 100644
--- a/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp
+++ b/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp
@@ -1821,7 +1821,7 @@ void ExprEngine::Visit(const Stmt *S, ExplodedNode *Pred,
     case Stmt::OMPTargetParallelGenericLoopDirectiveClass:
     case Stmt::CapturedStmtClass:
     case Stmt::OMPUnrollDirectiveClass:
-    case Stmt::OMPMetaDirectiveClass: 
+    case Stmt::OMPMetaDirectiveClass:
     case Stmt::HLSLArrayTemporaryExprClass: {
       const ExplodedNode *node = Bldr.generateSink(S, Pred, Pred->getState());
       Engine.addAbortedBlock(node, currBldrCtx->getBlock());

``````````

</details>


https://github.com/llvm/llvm-project/pull/79382


More information about the cfe-commits mailing list