summaryrefslogtreecommitdiffstats
path: root/llvm/utils/TableGen/CodeGenDAGPatterns.h
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2017-09-20 18:01:40 +0000
committerZachary Turner <zturner@google.com>2017-09-20 18:01:40 +0000
commit249dc1497964696944f343353daf31d5e4a9ddec (patch)
treea996f29c13e3b67ad2c7d6c78e7aec37ed3ad175 /llvm/utils/TableGen/CodeGenDAGPatterns.h
parente2ef0500673859affe33f9b8051adc0cafc25d7e (diff)
downloadbcm5719-llvm-249dc1497964696944f343353daf31d5e4a9ddec.tar.gz
bcm5719-llvm-249dc1497964696944f343353daf31d5e4a9ddec.zip
[TableGen] Some optimizations to TableGen.
This changes some STL data types to corresponding LLVM data types that have better performance characteristics. Differential Revision: https://reviews.llvm.org/D37957 llvm-svn: 313783
Diffstat (limited to 'llvm/utils/TableGen/CodeGenDAGPatterns.h')
-rw-r--r--llvm/utils/TableGen/CodeGenDAGPatterns.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/llvm/utils/TableGen/CodeGenDAGPatterns.h b/llvm/utils/TableGen/CodeGenDAGPatterns.h
index a1b0b2a3b0f..6d904a103c2 100644
--- a/llvm/utils/TableGen/CodeGenDAGPatterns.h
+++ b/llvm/utils/TableGen/CodeGenDAGPatterns.h
@@ -20,6 +20,7 @@
#include "CodeGenTarget.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringMap.h"
+#include "llvm/ADT/StringSet.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/MathExtras.h"
#include <algorithm>
@@ -222,11 +223,11 @@ struct TypeSetByHwMode : public InfoByHwMode<MachineValueTypeSet> {
bool insert(const ValueTypeByHwMode &VVT);
bool constrain(const TypeSetByHwMode &VTS);
template <typename Predicate> bool constrain(Predicate P);
- template <typename Predicate> bool assign_if(const TypeSetByHwMode &VTS,
- Predicate P);
+ template <typename Predicate>
+ bool assign_if(const TypeSetByHwMode &VTS, Predicate P);
- std::string getAsString() const;
- static std::string getAsString(const SetType &S);
+ void writeToStream(raw_ostream &OS) const;
+ static void writeToStream(const SetType &S, raw_ostream &OS);
bool operator==(const TypeSetByHwMode &VTS) const;
bool operator!=(const TypeSetByHwMode &VTS) const { return !(*this == VTS); }
@@ -333,7 +334,7 @@ private:
};
/// Set type used to track multiply used variables in patterns
-typedef std::set<std::string> MultipleUseVarSet;
+typedef StringSet<> MultipleUseVarSet;
/// SDTypeConstraint - This is a discriminated union of constraints,
/// corresponding to the SDTypeConstraint tablegen class in Target.td.
OpenPOWER on IntegriCloud