Skip to content

Commit

Permalink
[clang][Sema][NFC] Use existing TargetInfo local variable
Browse files Browse the repository at this point in the history
  • Loading branch information
tbaederr committed Apr 20, 2023
1 parent afc2b7d commit 30aea03
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions clang/lib/Sema/Sema.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2008,7 +2008,7 @@ void Sema::checkTypeSupport(QualType Ty, SourceLocation Loc, ValueDecl *D) {

if (Diag(Loc, PD, FD)
<< false /*show bit size*/ << 0 << Ty << false /*return*/
<< Context.getTargetInfo().getTriple().str()) {
<< TI.getTriple().str()) {
if (D)
D->setInvalidDecl();
}
Expand All @@ -2027,7 +2027,7 @@ void Sema::checkTypeSupport(QualType Ty, SourceLocation Loc, ValueDecl *D) {

if (Diag(Loc, PD, FD)
<< false /*show bit size*/ << 0 << Ty << true /*return*/
<< Context.getTargetInfo().getTriple().str()) {
<< TI.getTriple().str()) {
if (D)
D->setInvalidDecl();
}
Expand All @@ -2037,17 +2037,17 @@ void Sema::checkTypeSupport(QualType Ty, SourceLocation Loc, ValueDecl *D) {

// RISC-V vector builtin types (RISCVVTypes.def)
if (Ty->isRVVType(/* Bitwidth */ 64, /* IsFloat */ false) &&
!Context.getTargetInfo().hasFeature("zve64x"))
!TI.hasFeature("zve64x"))
Diag(Loc, diag::err_riscv_type_requires_extension, FD) << Ty << "zve64x";
if (Ty->isRVVType(/* Bitwidth */ 16, /* IsFloat */ true) &&
!Context.getTargetInfo().hasFeature("experimental-zvfh"))
!TI.hasFeature("experimental-zvfh"))
Diag(Loc, diag::err_riscv_type_requires_extension, FD)
<< Ty << "zvfh";
if (Ty->isRVVType(/* Bitwidth */ 32, /* IsFloat */ true) &&
!Context.getTargetInfo().hasFeature("zve32f"))
!TI.hasFeature("zve32f"))
Diag(Loc, diag::err_riscv_type_requires_extension, FD) << Ty << "zve32f";
if (Ty->isRVVType(/* Bitwidth */ 64, /* IsFloat */ true) &&
!Context.getTargetInfo().hasFeature("zve64d"))
!TI.hasFeature("zve64d"))
Diag(Loc, diag::err_riscv_type_requires_extension, FD) << Ty << "zve64d";

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

0 comments on commit 30aea03

Please sign in to comment.