[PATCH] D81588: Make behavior of getValueAsListOfStrings consistent with getValueAsString

Daniel Grumberg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 10 10:32:24 PDT 2020


dang created this revision.
dang added reviewers: Bigcheese, craig.topper.
Herald added subscribers: llvm-commits, dexonsmith, hiraditya.
Herald added a project: LLVM.

This lets users get lists of `code` values as strings in the same way that users can currently get a `code` values as strings separately.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D81588

Files:
  llvm/lib/TableGen/Record.cpp


Index: llvm/lib/TableGen/Record.cpp
===================================================================
--- llvm/lib/TableGen/Record.cpp
+++ llvm/lib/TableGen/Record.cpp
@@ -2294,6 +2294,8 @@
   for (Init *I : List->getValues()) {
     if (StringInit *SI = dyn_cast<StringInit>(I))
       Strings.push_back(SI->getValue());
+    else if (CodeInit *CI = dyn_cast<CodeInit>(I))
+      Strings.push_back(CI->getValue());
     else
       PrintFatalError(getLoc(),
                       Twine("Record `") + getName() + "', field `" + FieldName +


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D81588.269889.patch
Type: text/x-patch
Size: 543 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200610/cace303b/attachment.bin>


More information about the llvm-commits mailing list