[clang] [AArch64] Warn when calling a NEON builtin in a streaming function (PR #73672)
via cfe-commits
cfe-commits at lists.llvm.org
Thu Nov 30 05:17:59 PST 2023
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 1566380e6b47d7876c0f3eaa105097063dbe7cc8 c5c17a44bde23c488141514383b364a434f0e920 -- clang/test/Sema/aarch64-incompat-sm-builtin-calls.c clang/lib/Sema/SemaChecking.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp
index b8f3ffa913..77c8334f3c 100644
--- a/clang/lib/Sema/SemaChecking.cpp
+++ b/clang/lib/Sema/SemaChecking.cpp
@@ -2993,11 +2993,7 @@ static QualType getNeonEltType(NeonTypeFlags Flags, ASTContext &Context,
llvm_unreachable("Invalid NeonTypeFlag!");
}
-enum ArmStreamingType {
- ArmNonStreaming,
- ArmStreaming,
- ArmStreamingCompatible
-};
+enum ArmStreamingType { ArmNonStreaming, ArmStreaming, ArmStreamingCompatible };
static ArmStreamingType getArmStreamingFnType(const FunctionDecl *FD) {
if (FD->hasAttr<ArmLocallyStreamingAttr>())
@@ -3016,8 +3012,7 @@ static void checkArmStreamingBuiltin(Sema &S, CallExpr *TheCall,
ArmStreamingType BuiltinType) {
ArmStreamingType FnType = getArmStreamingFnType(FD);
- if (FnType == ArmStreaming &&
- BuiltinType == ArmNonStreaming) {
+ if (FnType == ArmStreaming && BuiltinType == ArmNonStreaming) {
S.Diag(TheCall->getBeginLoc(), diag::warn_attribute_arm_sm_incompat_builtin)
<< TheCall->getSourceRange() << "streaming";
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/73672
More information about the cfe-commits
mailing list