================ @@ -464,7 +466,8 @@ void RISCVIntrinsicManagerImpl::CreateRVVIntrinsicDecl(LookupResult &LR, bool RISCVIntrinsicManagerImpl::CreateIntrinsicIfFound(LookupResult &LR, IdentifierInfo *II, Preprocessor &PP) { - StringRef Name = II->getName().substr(8); + StringRef Name = II->getName(); + Name.consume_front("__riscv_"); ---------------- topperc wrote:
I think we should return false if consume_front returns false. If the string didn't start with __riscv we can't proceed as if it did. https://github.com/llvm/llvm-project/pull/77487 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits