Skip to content

Commit 5c8755f

Browse files
committed
[RISCV] Use Triple::isRISCV64(). NFC
1 parent cd4067a commit 5c8755f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

clang/lib/Basic/Targets/RISCV.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ static unsigned getVersionValue(unsigned MajorVersion, unsigned MinorVersion) {
131131
void RISCVTargetInfo::getTargetDefines(const LangOptions &Opts,
132132
MacroBuilder &Builder) const {
133133
Builder.defineMacro("__riscv");
134-
bool Is64Bit = getTriple().getArch() == llvm::Triple::riscv64;
134+
bool Is64Bit = getTriple().isRISCV64();
135135
Builder.defineMacro("__riscv_xlen", Is64Bit ? "64" : "32");
136136
StringRef CodeModel = getTargetOpts().CodeModel;
137137
unsigned FLen = ISAInfo->getFLen();
@@ -281,7 +281,7 @@ bool RISCVTargetInfo::initFeatureMap(
281281

282282
unsigned XLen = 32;
283283

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

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

0 commit comments

Comments
 (0)