[llvm] 4bf1124 - [TableGen] Make behavior of getValueAsListOfStrings consistent with getValueAsString

Daniel Grumberg via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 12 11:17:20 PDT 2020


Author: Daniel Grumberg
Date: 2020-06-12T19:16:48+01:00
New Revision: 4bf1124edab5cb489bdf21c05b083a95d263015e

URL: https://github.com/llvm/llvm-project/commit/4bf1124edab5cb489bdf21c05b083a95d263015e
DIFF: https://github.com/llvm/llvm-project/commit/4bf1124edab5cb489bdf21c05b083a95d263015e.diff

LOG: [TableGen] Make behavior of getValueAsListOfStrings consistent with getValueAsString

Added: 
    

Modified: 
    llvm/lib/TableGen/Record.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/TableGen/Record.cpp b/llvm/lib/TableGen/Record.cpp
index 6f774e960b43..50df5daaf4c1 100644
--- a/llvm/lib/TableGen/Record.cpp
+++ b/llvm/lib/TableGen/Record.cpp
@@ -2294,6 +2294,8 @@ Record::getValueAsListOfStrings(StringRef FieldName) const {
   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 +


        


More information about the llvm-commits mailing list