Skip to content

Commit 8eb0945

Browse files
committed
[Clang][AArch64] NFC: Simplify checkArmStreamingBuiltin.
Changing this into if -> else if -> else if > else is NFC, because the values of FnType are mutually exclusive.
1 parent 1d57594 commit 8eb0945

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

clang/lib/Sema/SemaChecking.cpp

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3551,22 +3551,16 @@ static void checkArmStreamingBuiltin(Sema &S, CallExpr *TheCall,
35513551
BuiltinType = ArmStreaming;
35523552
}
35533553

3554-
if (FnType == ArmStreaming && BuiltinType == ArmNonStreaming) {
3554+
if (FnType == ArmStreaming && BuiltinType == ArmNonStreaming)
35553555
S.Diag(TheCall->getBeginLoc(), diag::warn_attribute_arm_sm_incompat_builtin)
35563556
<< TheCall->getSourceRange() << "streaming";
3557-
}
3558-
3559-
if (FnType == ArmStreamingCompatible &&
3560-
BuiltinType != ArmStreamingCompatible) {
3561-
S.Diag(TheCall->getBeginLoc(), diag::warn_attribute_arm_sm_incompat_builtin)
3562-
<< TheCall->getSourceRange() << "streaming compatible";
3563-
return;
3564-
}
3565-
3566-
if (FnType == ArmNonStreaming && BuiltinType == ArmStreaming) {
3557+
else if (FnType == ArmNonStreaming && BuiltinType == ArmStreaming)
35673558
S.Diag(TheCall->getBeginLoc(), diag::warn_attribute_arm_sm_incompat_builtin)
35683559
<< TheCall->getSourceRange() << "non-streaming";
3569-
}
3560+
else if (FnType == ArmStreamingCompatible &&
3561+
BuiltinType != ArmStreamingCompatible)
3562+
S.Diag(TheCall->getBeginLoc(), diag::warn_attribute_arm_sm_incompat_builtin)
3563+
<< TheCall->getSourceRange() << "streaming compatible";
35703564
}
35713565

35723566
static bool hasArmZAState(const FunctionDecl *FD) {

0 commit comments

Comments
 (0)