mirror of
https://github.com/RPCSX/llvm.git
synced 2025-04-02 16:21:36 +00:00
[TableGen] Use SmallString instead of std::string to build up a string to avoid heap allocations. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254221 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
feed6dbc9f
commit
b51ae5ef11
@ -14,6 +14,7 @@
|
||||
|
||||
#include "CodeGenDAGPatterns.h"
|
||||
#include "llvm/ADT/STLExtras.h"
|
||||
#include "llvm/ADT/SmallString.h"
|
||||
#include "llvm/ADT/StringExtras.h"
|
||||
#include "llvm/ADT/Twine.h"
|
||||
#include "llvm/Support/Debug.h"
|
||||
@ -873,14 +874,14 @@ std::string PatternToMatch::getPredicateCheck() const {
|
||||
// Sort so that different orders get canonicalized to the same string.
|
||||
std::sort(PredicateRecs.begin(), PredicateRecs.end(), LessRecord());
|
||||
|
||||
std::string PredicateCheck;
|
||||
SmallString<128> PredicateCheck;
|
||||
for (Record *Pred : PredicateRecs) {
|
||||
if (!PredicateCheck.empty())
|
||||
PredicateCheck += " && ";
|
||||
PredicateCheck += "(" + Pred->getValueAsString("CondString") + ")";
|
||||
}
|
||||
|
||||
return PredicateCheck;
|
||||
return PredicateCheck.str();
|
||||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
Loading…
x
Reference in New Issue
Block a user