1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 03:02:36 +01:00

Delete the Matchers stored in the SmallVectors in SwitchOpcodeMatcher/SwitchTypeMatcher.

llvm-svn: 200377
This commit is contained in:
Craig Topper 2014-01-29 07:06:07 +00:00
parent a50ca1f645
commit 237e63c6ee
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;