Skip to content

Commit

Permalink
[clang][Sema] Only check RVV types if we have them (#67669)
Browse files Browse the repository at this point in the history
isRVVType() is suprisingly expensive, so do the checks only if the
target has rvv types.
  • Loading branch information
tbaederr authored Oct 6, 2023
1 parent 8b356f4 commit 3717147
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion clang/lib/Sema/Sema.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2071,7 +2071,7 @@ void Sema::checkTypeSupport(QualType Ty, SourceLocation Loc, ValueDecl *D) {
targetDiag(D->getLocation(), diag::note_defined_here, FD) << D;
}

if (Ty->isRVVType())
if (TI.hasRISCVVTypes() && Ty->isRVVType())
checkRVVTypeSupport(Ty, Loc, D);

// Don't allow SVE types in functions without a SVE target.
Expand Down

0 comments on commit 3717147

Please sign in to comment.