mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-21 08:17:40 +00:00
Use ArrayRef to simplify some code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199712 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -136,8 +136,7 @@ static void ContractNodes(OwningPtr<Matcher> &MatcherPtr,
|
||||
const SmallVectorImpl<MVT::SimpleValueType> &VTs = EN->getVTList();
|
||||
const SmallVectorImpl<unsigned> &Operands = EN->getOperandList();
|
||||
MatcherPtr.reset(new MorphNodeToMatcher(EN->getOpcodeName(),
|
||||
VTs.data(), VTs.size(),
|
||||
Operands.data(),Operands.size(),
|
||||
VTs, Operands,
|
||||
EN->hasChain(), EN->hasInFlag(),
|
||||
EN->hasOutFlag(),
|
||||
EN->hasMemRefs(),
|
||||
@@ -380,7 +379,7 @@ static void FactorNodes(OwningPtr<Matcher> &MatcherPtr) {
|
||||
EqualMatchers[i] = Tmp;
|
||||
}
|
||||
|
||||
Shared->setNext(new ScopeMatcher(&EqualMatchers[0], EqualMatchers.size()));
|
||||
Shared->setNext(new ScopeMatcher(EqualMatchers));
|
||||
|
||||
// Recursively factor the newly created node.
|
||||
FactorNodes(Shared->getNextPtr());
|
||||
@@ -455,7 +454,7 @@ static void FactorNodes(OwningPtr<Matcher> &MatcherPtr) {
|
||||
Cases.push_back(std::make_pair(&COM->getOpcode(), COM->getNext()));
|
||||
}
|
||||
|
||||
MatcherPtr.reset(new SwitchOpcodeMatcher(&Cases[0], Cases.size()));
|
||||
MatcherPtr.reset(new SwitchOpcodeMatcher(Cases));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -482,7 +481,7 @@ static void FactorNodes(OwningPtr<Matcher> &MatcherPtr) {
|
||||
}
|
||||
|
||||
Matcher *Entries[2] = { PrevMatcher, MatcherWithoutCTM };
|
||||
Cases[Entry-1].second = new ScopeMatcher(Entries, 2);
|
||||
Cases[Entry-1].second = new ScopeMatcher(Entries);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -491,7 +490,7 @@ static void FactorNodes(OwningPtr<Matcher> &MatcherPtr) {
|
||||
}
|
||||
|
||||
if (Cases.size() != 1) {
|
||||
MatcherPtr.reset(new SwitchTypeMatcher(&Cases[0], Cases.size()));
|
||||
MatcherPtr.reset(new SwitchTypeMatcher(Cases));
|
||||
} else {
|
||||
// If we factored and ended up with one case, create it now.
|
||||
MatcherPtr.reset(new CheckTypeMatcher(Cases[0].first, 0));
|
||||
|
||||
Reference in New Issue
Block a user