[clang] [clang][SME] Rework streaming mode always_inline errors/warnings (PR #174608)

Benjamin Maxwell via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 13 07:30:53 PST 2026


================
@@ -1829,6 +1829,11 @@ class DeclContext {
     // refers to an enclosing template for hte purposes of [temp.friend]p9.
     LLVM_PREFERRED_TYPE(bool)
     uint64_t FriendConstraintRefersToEnclosingTemplate : 1;
+
+    // Indicates this function contains a non-(arm)-streaming safe expression.
+    // This can be directly, or transitively via always_inline calls.
+    LLVM_PREFERRED_TYPE(bool)
+    uint64_t BodyContainsNonStreamingSafeExpression : 1;
----------------
MacDue wrote:

I've reworked this to add a DenseSet (`AArch64ContansExprNotSafeForStreamingFunctions`) to ASTContext. I think this should be acceptable as it only adds the cost of a single set to the context (rather than an extra `bool` to all decls). It seems like this is also what other targets do as there's already `FunctionDecl` sets like `CUDAImplicitHostDeviceFunUsedByDevice`. 

I can't simple add a field to `SemaARM` since the logic is split between `SemaARM` and `AArch64TargetCodeGenInfo`, and AFAIK, the only way to pass state between those is via the AST/ASTContext. 


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


More information about the cfe-commits mailing list