[clang] [Clang][AArch64] Remove unwarranted 'cannot be used in non-streaming mode' diagnostic. (PR #150592)
Sander de Smalen via cfe-commits
cfe-commits at lists.llvm.org
Fri Jul 25 05:03:42 PDT 2025
================
@@ -5988,11 +5988,9 @@ bool clang::IsArmStreamingFunction(const FunctionDecl *FD,
if (FD->hasAttr<ArmLocallyStreamingAttr>())
return true;
- if (const Type *Ty = FD->getType().getTypePtrOrNull())
----------------
sdesmalen-arm wrote:
Not really, it was an intentional change because I think this function must be able to assume it is called with a `FunctionDecl` that is sufficiently complete. The if-block here was just hiding some unexpected issue.
If for example, I were to call `FD->dump()` in this function, then `dump` will run into an assertion that the type is null. If this function would need to assume the type can be null, then I think every function in Clang must have this check. By assuming the type is not null (and it running into an assertion or segfault), at least Clang won't (possibly quietly) do the wrong thing and it might expose other places we'd need to patch up. This was the only place I could find. The call to `IsArmStreamingFunction` below cannot be tested without `+sve` anyway because `arm_sve_vector_bits` requires it to be available.
https://github.com/llvm/llvm-project/pull/150592
More information about the cfe-commits
mailing list