hanchenye-llvm-project/llvm/lib/TableGen
Craig Topper 2b8419a22d [TableGen] Make Record::getValueAsString and getValueAsListOfStrings return StringRefs instead of std::string
Internally both these methods just return the result of getValue on either a StringInit or a CodeInit object. In both cases this returns a StringRef pointing to a string allocated in the BumpPtrAllocator so its not going anywhere. So we can just pass that StringRef along.

This is a fairly naive patch that targets just the build failures caused by this change. There's additional work that can be done to avoid creating std::string at call sites that still think getValueAsString returns a std::string. I'll try to clean those up in future patches.

Differential Revision: https://reviews.llvm.org/D33710

llvm-svn: 304325
2017-05-31 19:01:11 +00:00
..
CMakeLists.txt
Error.cpp
LLVMBuild.txt
Main.cpp [TableGen] Centralize/Unify error handling. 2016-12-05 22:58:01 +00:00
Record.cpp [TableGen] Make Record::getValueAsString and getValueAsListOfStrings return StringRefs instead of std::string 2017-05-31 19:01:11 +00:00
SetTheory.cpp
StringMatcher.cpp [Hexagon, TableGen] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-01-04 02:02:05 +00:00
TGLexer.cpp TableGen: Add operator !or 2016-11-15 06:49:28 +00:00
TGLexer.h TableGen: Add operator !or 2016-11-15 06:49:28 +00:00
TGParser.cpp Use print() instead of dump() in code 2017-01-28 02:47:46 +00:00
TGParser.h TableGen: Some more std::string->StringInit* replacements 2016-12-05 07:35:13 +00:00
TableGenBackend.cpp