diff options
| author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2018-03-24 21:04:20 +0000 |
|---|---|---|
| committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2018-03-24 21:04:20 +0000 |
| commit | 34d512ec1e5d8fb8cf4cb72734c82a31988f5c8a (patch) | |
| tree | edbb08b60db3b0a5b7a8d7eff7ef19e1a5c9140f | |
| parent | 31a96337249054680d6bff0d27f17417e1ddb3d3 (diff) | |
| download | bcm5719-llvm-34d512ec1e5d8fb8cf4cb72734c82a31988f5c8a.tar.gz bcm5719-llvm-34d512ec1e5d8fb8cf4cb72734c82a31988f5c8a.zip | |
[SchedModel] Avoid std::string creation for instregex patterns that don't contain regex metas. NFCI.
llvm-svn: 328436
| -rw-r--r-- | llvm/utils/TableGen/CodeGenSchedule.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/utils/TableGen/CodeGenSchedule.cpp b/llvm/utils/TableGen/CodeGenSchedule.cpp index 1b516c17530..b73e0767e3b 100644 --- a/llvm/utils/TableGen/CodeGenSchedule.cpp +++ b/llvm/utils/TableGen/CodeGenSchedule.cpp @@ -95,9 +95,10 @@ struct InstRegexOp : public SetTheory::Operator { Optional<Regex> Regexpr = None; StringRef Prefix = Original.substr(0, FirstMeta); - std::string pat = Original.substr(FirstMeta); - if (!pat.empty()) { + StringRef PatStr = Original.substr(FirstMeta); + if (!PatStr.empty()) { // For the rest use a python-style prefix match. + std::string pat = PatStr; if (pat[0] != '^') { pat.insert(0, "^("); pat.insert(pat.end(), ')'); |

