[PATCH] D105168: [RISCV] Unify the arch string parsing logic to RISCVISAInfo.

Craig Topper via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 18 13:13:21 PDT 2021


craig.topper added a comment.

In D105168#3071249 <https://reviews.llvm.org/D105168#3071249>, @jrtc27 wrote:

> Two options come to mind if we really need to be outputting a StringRef list:
>
> 1. (the simpler option) Pass in a Twine -> `const char *` lambda that the caller hooks up to Args.MakeArgString

Good idea. I'll post a patch for that shortly.

> 2. (probably the nicer option) Invent our own MakeArgString that allocates from storage owned by RISCVISAInfo itself; lots of ways you can do that

I don't think the RISCVISAInfo objects lives long enough for that. It only lives for the duration of the function that calls toFeatures, but the Features vector is returned from that function.

> Adding a new library just so we can use MakeArgString seems overkill, even if there are other things that perhaps belong in something a bit less shared than Support.




Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D105168/new/

https://reviews.llvm.org/D105168



More information about the cfe-commits mailing list