#include "llvm/TableGen/TableGenBackend.h"
using namespace llvm;
+#define DEBUG_TYPE "dag-isel-emitter"
+
namespace {
/// DAGISelEmitter - The top-level class which coordinates construction
/// and emission of the instruction selector.
// Otherwise, if the patterns might both match, sort based on complexity,
// which means that we prefer to match patterns that cover more nodes in the
// input over nodes that cover fewer.
- unsigned LHSSize = LHS->getPatternComplexity(CGP);
- unsigned RHSSize = RHS->getPatternComplexity(CGP);
+ int LHSSize = LHS->getPatternComplexity(CGP);
+ int RHSSize = RHS->getPatternComplexity(CGP);
if (LHSSize > RHSSize) return true; // LHS -> bigger -> less cost
if (LHSSize < RHSSize) return false;
}
}
- Matcher *TheMatcher = new ScopeMatcher(&PatternMatchers[0],
- PatternMatchers.size());
+ std::unique_ptr<Matcher> TheMatcher =
+ llvm::make_unique<ScopeMatcher>(PatternMatchers);
- TheMatcher = OptimizeMatcher(TheMatcher, CGP);
+ OptimizeMatcher(TheMatcher, CGP);
//Matcher->dump();
- EmitMatcherTable(TheMatcher, CGP, OS);
- delete TheMatcher;
+ EmitMatcherTable(TheMatcher.get(), CGP, OS);
}
namespace llvm {