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
This commit is contained in:
Craig Topper 2014-01-29 07:06:07 +00:00
parent 99c3e481f3
commit 01a5c17219
2 changed files with 11 additions and 0 deletions

View File

@ -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()) {}

View File

@ -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;