[PATCH] D152423: [RISCV] Add function that check extension name with version
Craig Topper via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 23 17:52:50 PDT 2023
craig.topper added inline comments.
Herald added a subscriber: wangpc.
================
Comment at: llvm/lib/Support/RISCVISAInfo.cpp:1226
+ StringRef Name = Ext.substr(0, Pos);
+ StringRef Vers = Ext.substr(Pos);
+
----------------
I don't think `Vers` needs to exist. It's only used for `!Vers.empty()` which is equivalent to `Pos != Ext.size()`
================
Comment at: llvm/unittests/Support/RISCVISAInfoTest.cpp:490
+TEST(isSupportedExtensionWithVersion, AcceptsSingleExtensionWithVersion) {
+ EXPECT_EQ(RISCVISAInfo::isSupportedExtensionWithVersion("zbb1p0"), true);
+ EXPECT_EQ(RISCVISAInfo::isSupportedExtensionWithVersion("zbb"), false);
----------------
Use EXPECT_TRUE and EXPECT_FALSE
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D152423/new/
https://reviews.llvm.org/D152423
More information about the llvm-commits
mailing list