Skip to content

Commit 254bfe2

Browse files
committed
[Clang][AArch64] Expect valid FunctionDecl in IsArmStreamingFunction
This follows from a conversation on #150592 where we decided to split out this change and commit it separately. The rationale is that FunctionDecl must be sufficiently parsed/created in order to tell whether it is a streaming function.
1 parent 8070e9b commit 254bfe2

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

clang/lib/AST/Decl.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5988,11 +5988,10 @@ bool clang::IsArmStreamingFunction(const FunctionDecl *FD,
59885988
if (FD->hasAttr<ArmLocallyStreamingAttr>())
59895989
return true;
59905990

5991-
if (const Type *Ty = FD->getType().getTypePtrOrNull())
5992-
if (const auto *FPT = Ty->getAs<FunctionProtoType>())
5993-
if (FPT->getAArch64SMEAttributes() &
5994-
FunctionType::SME_PStateSMEnabledMask)
5995-
return true;
5991+
assert(!FD->getType().isNull() && "Expected a valid FunctionDecl");
5992+
if (const auto *FPT = FD->getType()->getAs<FunctionProtoType>())
5993+
if (FPT->getAArch64SMEAttributes() & FunctionType::SME_PStateSMEnabledMask)
5994+
return true;
59965995

59975996
return false;
59985997
}

0 commit comments

Comments
 (0)