Skip to content

Commit 7237bef

Browse files
committed
[RISCV] Use map::count instead of hasExtension in computeDefaultABI. NFC
hasExtension checks if the extension name is a known extension name. That should always be true for the extensions listed here so we can skip that check.
1 parent 435e850 commit 7237bef

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

llvm/lib/TargetParser/RISCVISAInfo.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -998,19 +998,19 @@ RISCVISAInfo::postProcessAndChecking(std::unique_ptr<RISCVISAInfo> &&ISAInfo) {
998998

999999
StringRef RISCVISAInfo::computeDefaultABI() const {
10001000
if (XLen == 32) {
1001-
if (hasExtension("e"))
1001+
if (Exts.count("e"))
10021002
return "ilp32e";
1003-
if (hasExtension("d"))
1003+
if (Exts.count("d"))
10041004
return "ilp32d";
1005-
if (hasExtension("f"))
1005+
if (Exts.count("f"))
10061006
return "ilp32f";
10071007
return "ilp32";
10081008
} else if (XLen == 64) {
1009-
if (hasExtension("e"))
1009+
if (Exts.count("e"))
10101010
return "lp64e";
1011-
if (hasExtension("d"))
1011+
if (Exts.count("d"))
10121012
return "lp64d";
1013-
if (hasExtension("f"))
1013+
if (Exts.count("f"))
10141014
return "lp64f";
10151015
return "lp64";
10161016
}

0 commit comments

Comments
 (0)