diff options
author | Craig Topper <craig.topper@gmail.com> | 2014-01-29 07:06:07 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@gmail.com> | 2014-01-29 07:06:07 +0000 |
commit | 01a5c17219db7b7473dcf6cffa52deb11eaacdd3 (patch) | |
tree | 1f24e75414560fd11751d4c779d20c03b783c80e /utils | |
parent | 99c3e481f3c1028b48764a7d30a48f8cda56c9ea (diff) | |
download | llvm-01a5c17219db7b7473dcf6cffa52deb11eaacdd3.tar.gz |
Delete the Matchers stored in the SmallVectors in SwitchOpcodeMatcher/SwitchTypeMatcher.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200377 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils')
-rw-r--r-- | utils/TableGen/DAGISelMatcher.cpp | 9 | ||||
-rw-r--r-- | utils/TableGen/DAGISelMatcher.h | 2 |
2 files changed, 11 insertions, 0 deletions
diff --git a/utils/TableGen/DAGISelMatcher.cpp b/utils/TableGen/DAGISelMatcher.cpp index 5d6a11ae0dc7..64764bdb92e6 100644 --- a/utils/TableGen/DAGISelMatcher.cpp +++ b/utils/TableGen/DAGISelMatcher.cpp @@ -84,6 +84,15 @@ ScopeMatcher::~ScopeMatcher() { delete Children[i]; } +SwitchOpcodeMatcher::~SwitchOpcodeMatcher() { + for (unsigned i = 0, e = Cases.size(); i != e; ++i) + delete Cases[i].second; +} + +SwitchTypeMatcher::~SwitchTypeMatcher() { + for (unsigned i = 0, e = Cases.size(); i != e; ++i) + delete Cases[i].second; +} CheckPredicateMatcher::CheckPredicateMatcher(const TreePredicateFn &pred) : Matcher(CheckPredicate), Pred(pred.getOrigPatFragRecord()) {} diff --git a/utils/TableGen/DAGISelMatcher.h b/utils/TableGen/DAGISelMatcher.h index 8d01ffcc5f56..4a07df8f9d4f 100644 --- a/utils/TableGen/DAGISelMatcher.h +++ b/utils/TableGen/DAGISelMatcher.h @@ -505,6 +505,7 @@ class SwitchOpcodeMatcher : public Matcher { public: SwitchOpcodeMatcher(ArrayRef<std::pair<const SDNodeInfo*, Matcher*> > cases) : Matcher(SwitchOpcode), Cases(cases.begin(), cases.end()) {} + virtual ~SwitchOpcodeMatcher(); static inline bool classof(const Matcher *N) { return N->getKind() == SwitchOpcode; @@ -558,6 +559,7 @@ class SwitchTypeMatcher : public Matcher { public: SwitchTypeMatcher(ArrayRef<std::pair<MVT::SimpleValueType, Matcher*> > cases) : Matcher(SwitchType), Cases(cases.begin(), cases.end()) {} + virtual ~SwitchTypeMatcher(); static inline bool classof(const Matcher *N) { return N->getKind() == SwitchType; |