[PATCH] D33710: [TableGen] Make Record::getValueAsString and getValueAsListOfStrings return StringRefs instead of std::string

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 31 08:22:26 PDT 2017


dblaikie accepted this revision.
dblaikie added inline comments.
This revision is now accepted and ready to land.


================
Comment at: utils/TableGen/OptParserEmitter.cpp:57
+    if (int Cmp = StrCmpOptionName(A->getValueAsString("Name").str().c_str(),
+                                   B->getValueAsString("Name").str().c_str()))
       return Cmp;
----------------
craig.topper wrote:
> This is a bit of a hack because the compare function expects a null terminated const char* array which the StringRef doesn't guarantee so I had to create a string first. This can be cleaned up in a future commit.
Please leave a FIXME unless you're planning to do this follow up soon.


https://reviews.llvm.org/D33710





More information about the llvm-commits mailing list