mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-13 09:33:50 +00:00
Use unique_ptr to remove explicit delete.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224224 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
1c3a1516f8
commit
55c9dbf599
@ -157,12 +157,12 @@ void DAGISelEmitter::run(raw_ostream &OS) {
|
||||
}
|
||||
}
|
||||
|
||||
Matcher *TheMatcher = new ScopeMatcher(PatternMatchers);
|
||||
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 {
|
||||
|
@ -30,7 +30,8 @@ namespace llvm {
|
||||
|
||||
Matcher *ConvertPatternToMatcher(const PatternToMatch &Pattern,unsigned Variant,
|
||||
const CodeGenDAGPatterns &CGP);
|
||||
Matcher *OptimizeMatcher(Matcher *Matcher, const CodeGenDAGPatterns &CGP);
|
||||
void OptimizeMatcher(std::unique_ptr<Matcher> &Matcher,
|
||||
const CodeGenDAGPatterns &CGP);
|
||||
void EmitMatcherTable(const Matcher *Matcher, const CodeGenDAGPatterns &CGP,
|
||||
raw_ostream &OS);
|
||||
|
||||
|
@ -511,11 +511,10 @@ static void FactorNodes(std::unique_ptr<Matcher> &MatcherPtr) {
|
||||
Scope->resetChild(i, NewOptionsToMatch[i]);
|
||||
}
|
||||
|
||||
Matcher *llvm::OptimizeMatcher(Matcher *TheMatcher,
|
||||
const CodeGenDAGPatterns &CGP) {
|
||||
std::unique_ptr<Matcher> MatcherPtr(TheMatcher);
|
||||
void
|
||||
llvm::OptimizeMatcher(std::unique_ptr<Matcher> &MatcherPtr,
|
||||
const CodeGenDAGPatterns &CGP) {
|
||||
ContractNodes(MatcherPtr, CGP);
|
||||
SinkPatternPredicates(MatcherPtr);
|
||||
FactorNodes(MatcherPtr);
|
||||
return MatcherPtr.release();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user