}
void CodeGenDAGPatterns::AddPatternToMatch(TreePattern *Pattern,
- const PatternToMatch &PTM) {
+ PatternToMatch &&PTM) {
// Do some sanity checking on the pattern we're about to match.
std::string Reason;
if (!PTM.getSrcPattern()->canPatternMatch(Reason, *this)) {
SrcNames[Entry.first].second == 1)
Pattern->error("Pattern has dead named input: $" + Entry.first);
- PatternsToMatch.push_back(PTM);
+ PatternsToMatch.push_back(std::move(PTM));
}
TreePattern Temp(Result.getRecord(), DstPattern, false, *this);
Temp.InferAllTypes();
-
- AddPatternToMatch(Pattern,
- PatternToMatch(CurPattern,
- CurPattern->getValueAsListInit("Predicates"),
- Pattern->getTree(0),
- Temp.getOnlyTree(), InstImpResults,
- CurPattern->getValueAsInt("AddedComplexity"),
- CurPattern->getID()));
+ AddPatternToMatch(
+ Pattern,
+ PatternToMatch(
+ CurPattern, CurPattern->getValueAsListInit("Predicates"),
+ Pattern->getTree(0), Temp.getOnlyTree(), std::move(InstImpResults),
+ CurPattern->getValueAsInt("AddedComplexity"), CurPattern->getID()));
}
}
/// processed to produce isel.
class PatternToMatch {
public:
- PatternToMatch(Record *srcrecord, ListInit *preds,
- TreePatternNode *src, TreePatternNode *dst,
- const std::vector<Record*> &dstregs,
+ PatternToMatch(Record *srcrecord, ListInit *preds, TreePatternNode *src,
+ TreePatternNode *dst, std::vector<Record *> dstregs,
int complexity, unsigned uid)
- : SrcRecord(srcrecord), Predicates(preds), SrcPattern(src), DstPattern(dst),
- Dstregs(dstregs), AddedComplexity(complexity), ID(uid) {}
+ : SrcRecord(srcrecord), Predicates(preds), SrcPattern(src),
+ DstPattern(dst), Dstregs(std::move(dstregs)),
+ AddedComplexity(complexity), ID(uid) {}
Record *SrcRecord; // Originating Record for the pattern.
ListInit *Predicates; // Top level predicate conditions to match.
void GenerateVariants();
void VerifyInstructionFlags();
- void AddPatternToMatch(TreePattern *Pattern, const PatternToMatch &PTM);
+ void AddPatternToMatch(TreePattern *Pattern, PatternToMatch &&PTM);
void FindPatternInputsAndOutputs(TreePattern *I, TreePatternNode *Pat,
std::map<std::string,
TreePatternNode*> &InstInputs,