summaryrefslogtreecommitdiffstats
path: root/llvm/utils/TableGen/CodeGenDAGPatterns.h
diff options
context:
space:
mode:
authorSimon Pilgrim <llvm-dev@redking.me.uk>2017-10-14 21:27:53 +0000
committerSimon Pilgrim <llvm-dev@redking.me.uk>2017-10-14 21:27:53 +0000
commit6ecae9fc97a964ecd44703acd3dc2fc1ab79e7e4 (patch)
treeb823cc07b187fa5ac8a962633a68c0c2aff1feda /llvm/utils/TableGen/CodeGenDAGPatterns.h
parent36fe00ee1739cbcc41cc69f66d439f9788408687 (diff)
downloadbcm5719-llvm-6ecae9fc97a964ecd44703acd3dc2fc1ab79e7e4.tar.gz
bcm5719-llvm-6ecae9fc97a964ecd44703acd3dc2fc1ab79e7e4.zip
[TableGen] Avoid unnecessary std::string creations
Avoid unnecessary std::string creations in the TreePredicateFn getters. llvm-svn: 315826
Diffstat (limited to 'llvm/utils/TableGen/CodeGenDAGPatterns.h')
-rw-r--r--llvm/utils/TableGen/CodeGenDAGPatterns.h13
1 files changed, 6 insertions, 7 deletions
diff --git a/llvm/utils/TableGen/CodeGenDAGPatterns.h b/llvm/utils/TableGen/CodeGenDAGPatterns.h
index 5918e901a3d..2103e154dad 100644
--- a/llvm/utils/TableGen/CodeGenDAGPatterns.h
+++ b/llvm/utils/TableGen/CodeGenDAGPatterns.h
@@ -452,13 +452,12 @@ public:
/// getImmediatePredicateCode - Return the code that evaluates this pattern if
/// this is an immediate predicate. It is an error to call this on a
/// non-immediate pattern.
- std::string getImmediatePredicateCode() const {
- std::string Result = getImmCode();
+ StringRef getImmediatePredicateCode() const {
+ StringRef Result = getImmCode();
assert(!Result.empty() && "Isn't an immediate pattern!");
return Result;
}
-
bool operator==(const TreePredicateFn &RHS) const {
return PatFragRec == RHS.PatFragRec;
}
@@ -476,15 +475,15 @@ public:
std::string getCodeToRunOnSDNode() const;
/// Get the data type of the argument to getImmediatePredicateCode().
- std::string getImmType() const;
+ StringRef getImmType() const;
/// Get a string that describes the type returned by getImmType() but is
/// usable as part of an identifier.
- std::string getImmTypeIdentifier() const;
+ StringRef getImmTypeIdentifier() const;
private:
- std::string getPredCode() const;
- std::string getImmCode() const;
+ StringRef getPredCode() const;
+ StringRef getImmCode() const;
bool immCodeUsesAPInt() const;
bool immCodeUsesAPFloat() const;
};
OpenPOWER on IntegriCloud