[PATCH] D88832: [TableGen] Add new getAllDerivedDefinitionsTwo function to RecordKeeper

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 7 09:29:27 PDT 2020


craig.topper added a comment.

In D88832#2316995 <https://reviews.llvm.org/D88832#2316995>, @Paul-C-Anagnostopoulos wrote:

> No, there is no ArrayRef constructor that accepts a StringRef. You get the expected error "cannot convert argument 1 ..."
>
> I changed the new definition to accept a SmallVector rather than a std::vector, which at least gets rid of the malloc.

Is the conversion error because a string literal isn't a StringRef so you have to go through two conversions? string literal -> StringRef -> ArrayRef<StringRef>
Could you change all callers that only pass one string to do getAllDerivedDefinitions({"string"});  That seems to be what's done in Attributes::emitTargetIndependentNames for example.


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

https://reviews.llvm.org/D88832



More information about the llvm-commits mailing list