Skip to content

Commit

Permalink
[RISCV] Use Triple::isRISCV64(). NFC
Browse files Browse the repository at this point in the history
  • Loading branch information
topperc committed Dec 9, 2023
1 parent cd4067a commit 5c8755f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions clang/lib/Basic/Targets/RISCV.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ static unsigned getVersionValue(unsigned MajorVersion, unsigned MinorVersion) {
void RISCVTargetInfo::getTargetDefines(const LangOptions &Opts,
MacroBuilder &Builder) const {
Builder.defineMacro("__riscv");
bool Is64Bit = getTriple().getArch() == llvm::Triple::riscv64;
bool Is64Bit = getTriple().isRISCV64();
Builder.defineMacro("__riscv_xlen", Is64Bit ? "64" : "32");
StringRef CodeModel = getTargetOpts().CodeModel;
unsigned FLen = ISAInfo->getFLen();
Expand Down Expand Up @@ -281,7 +281,7 @@ bool RISCVTargetInfo::initFeatureMap(

unsigned XLen = 32;

if (getTriple().getArch() == llvm::Triple::riscv64) {
if (getTriple().isRISCV64()) {
Features["64bit"] = true;
XLen = 64;
} else {
Expand Down Expand Up @@ -336,7 +336,7 @@ RISCVTargetInfo::getVScaleRange(const LangOptions &LangOpts) const {

/// Return true if has this feature, need to sync with handleTargetFeatures.
bool RISCVTargetInfo::hasFeature(StringRef Feature) const {
bool Is64Bit = getTriple().getArch() == llvm::Triple::riscv64;
bool Is64Bit = getTriple().isRISCV64();
auto Result = llvm::StringSwitch<std::optional<bool>>(Feature)
.Case("riscv", true)
.Case("riscv32", !Is64Bit)
Expand Down

0 comments on commit 5c8755f

Please sign in to comment.