[PATCH] D154596: [RISCV] Fix required features checking with empty string

Jim Lin via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 6 04:31:16 PDT 2023


Jim created this revision.
Herald added subscribers: jobnoorman, VincentWu, vkmr, luismarques, sameer.abuasal, s.egerton, benna, psnobl, PkmX, rogfer01, shiva0217, kito-cheng, simoncook, arichardson.
Herald added a project: All.
Jim requested review of this revision.
Herald added subscribers: cfe-commits, wangpc, eopXD.
Herald added a project: clang.

In our downstream, we define some intrinsics that don't require any
extension enabled. Such as

TARGET_BUILTIN(__builtin_riscv_xxx, "LiLi", "nc", "")

But `split` function's `KeepEmpty` argument isn't True. Got the error message

error: builtin requires at least one of the following extensions support to be enabled : ''

when we use our customized intrinsic.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D154596

Files:
  clang/lib/Sema/SemaChecking.cpp


Index: clang/lib/Sema/SemaChecking.cpp
===================================================================
--- clang/lib/Sema/SemaChecking.cpp
+++ clang/lib/Sema/SemaChecking.cpp
@@ -4481,7 +4481,7 @@
   bool FeatureMissing = false;
   SmallVector<StringRef> ReqFeatures;
   StringRef Features = Context.BuiltinInfo.getRequiredFeatures(BuiltinID);
-  Features.split(ReqFeatures, ',');
+  Features.split(ReqFeatures, ',', -1, false);
 
   // Check if each required feature is included
   for (StringRef F : ReqFeatures) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D154596.537662.patch
Type: text/x-patch
Size: 521 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230706/de6b4b90/attachment.bin>


More information about the cfe-commits mailing list