[clang] [AArch64] Warn when calling a NEON builtin in a streaming function (PR #73672)

Sander de Smalen via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 30 02:34:47 PST 2023


================
@@ -2993,6 +2993,47 @@ static QualType getNeonEltType(NeonTypeFlags Flags, ASTContext &Context,
   llvm_unreachable("Invalid NeonTypeFlag!");
 }
 
+enum ArmStreamingType {
+  ArmNonStreaming,
+  ArmStreaming,
+  ArmStreamingCompatible,
+  ArmLocallyStreaming
+};
+
+static ArmStreamingType getArmStreamingFnType(const FunctionDecl *FD) {
+  if (FD->hasAttr<ArmLocallyStreamingAttr>())
+    return ArmLocallyStreaming;
----------------
sdesmalen-arm wrote:

I wonder if we should change this to `ArmStreaming`, because for the purpose of checking whether the streaming-properties match, it doesn't matter whether the 'streaming-ness' is set for either the body (ArmLocallyStreaming) or the interface (ArmStreaming) of the caller. That simplifies one of the conditions below, and we can remove `ArmLocallyStreaming` from the enum above.

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


More information about the cfe-commits mailing list