mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-14 00:32:55 +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();
|
//Matcher->dump();
|
||||||
EmitMatcherTable(TheMatcher, CGP, OS);
|
EmitMatcherTable(TheMatcher.get(), CGP, OS);
|
||||||
delete TheMatcher;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace llvm {
|
namespace llvm {
|
||||||
|
@ -30,7 +30,8 @@ namespace llvm {
|
|||||||
|
|
||||||
Matcher *ConvertPatternToMatcher(const PatternToMatch &Pattern,unsigned Variant,
|
Matcher *ConvertPatternToMatcher(const PatternToMatch &Pattern,unsigned Variant,
|
||||||
const CodeGenDAGPatterns &CGP);
|
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,
|
void EmitMatcherTable(const Matcher *Matcher, const CodeGenDAGPatterns &CGP,
|
||||||
raw_ostream &OS);
|
raw_ostream &OS);
|
||||||
|
|
||||||
|
@ -511,11 +511,10 @@ static void FactorNodes(std::unique_ptr<Matcher> &MatcherPtr) {
|
|||||||
Scope->resetChild(i, NewOptionsToMatch[i]);
|
Scope->resetChild(i, NewOptionsToMatch[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
Matcher *llvm::OptimizeMatcher(Matcher *TheMatcher,
|
void
|
||||||
const CodeGenDAGPatterns &CGP) {
|
llvm::OptimizeMatcher(std::unique_ptr<Matcher> &MatcherPtr,
|
||||||
std::unique_ptr<Matcher> MatcherPtr(TheMatcher);
|
const CodeGenDAGPatterns &CGP) {
|
||||||
ContractNodes(MatcherPtr, CGP);
|
ContractNodes(MatcherPtr, CGP);
|
||||||
SinkPatternPredicates(MatcherPtr);
|
SinkPatternPredicates(MatcherPtr);
|
||||||
FactorNodes(MatcherPtr);
|
FactorNodes(MatcherPtr);
|
||||||
return MatcherPtr.release();
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user