forked from OSchip/llvm-project
Revert MSVC 2017 build fix and fix it by moving the method that implicitly instantiates addPredicate out of line
llvm-svn: 315932
This commit is contained in:
parent
a98a2be869
commit
cfdd4a2699
|
@ -715,18 +715,6 @@ public:
|
|||
virtual unsigned countRendererFns() const { return 0; }
|
||||
};
|
||||
|
||||
// Specialize OperandMatcher::addPredicate() to refrain from adding redundant
|
||||
// predicates.
|
||||
template <>
|
||||
template <class Kind, class... Args>
|
||||
Optional<Kind *>
|
||||
PredicateListMatcher<OperandPredicateMatcher>::addPredicate(Args &&... args) {
|
||||
if (static_cast<OperandMatcher *>(this)->isSameAsAnotherOperand())
|
||||
return None;
|
||||
Predicates.emplace_back(llvm::make_unique<Kind>(std::forward<Args>(args)...));
|
||||
return static_cast<Kind *>(Predicates.back().get());
|
||||
}
|
||||
|
||||
template <>
|
||||
std::string
|
||||
PredicateListMatcher<OperandPredicateMatcher>::getNoPredicateComment() const {
|
||||
|
@ -990,26 +978,7 @@ public:
|
|||
InstructionMatcher &getInstructionMatcher() const { return Insn; }
|
||||
|
||||
Error addTypeCheckPredicate(const TypeSetByHwMode &VTy,
|
||||
bool OperandIsAPointer) {
|
||||
if (!VTy.isMachineValueType())
|
||||
return failedImport("unsupported typeset");
|
||||
|
||||
if (VTy.getMachineValueType() == MVT::iPTR && OperandIsAPointer) {
|
||||
addPredicate<PointerToAnyOperandMatcher>(0);
|
||||
return Error::success();
|
||||
}
|
||||
|
||||
auto OpTyOrNone = MVTToLLT(VTy.getMachineValueType().SimpleTy);
|
||||
if (!OpTyOrNone)
|
||||
return failedImport("unsupported type");
|
||||
|
||||
if (OperandIsAPointer)
|
||||
addPredicate<PointerToAnyOperandMatcher>(
|
||||
OpTyOrNone->get().getSizeInBits());
|
||||
else
|
||||
addPredicate<LLTOperandMatcher>(*OpTyOrNone);
|
||||
return Error::success();
|
||||
}
|
||||
bool OperandIsAPointer);
|
||||
|
||||
/// Emit MatchTable opcodes to capture instructions into the MIs table.
|
||||
void emitCaptureOpcodes(MatchTable &Table, RuleMatcher &Rule,
|
||||
|
@ -1078,6 +1047,39 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
// Specialize OperandMatcher::addPredicate() to refrain from adding redundant
|
||||
// predicates.
|
||||
template <>
|
||||
template <class Kind, class... Args>
|
||||
Optional<Kind *>
|
||||
PredicateListMatcher<OperandPredicateMatcher>::addPredicate(Args &&... args) {
|
||||
if (static_cast<OperandMatcher *>(this)->isSameAsAnotherOperand())
|
||||
return None;
|
||||
Predicates.emplace_back(llvm::make_unique<Kind>(std::forward<Args>(args)...));
|
||||
return static_cast<Kind *>(Predicates.back().get());
|
||||
}
|
||||
|
||||
Error OperandMatcher::addTypeCheckPredicate(const TypeSetByHwMode &VTy,
|
||||
bool OperandIsAPointer) {
|
||||
if (!VTy.isMachineValueType())
|
||||
return failedImport("unsupported typeset");
|
||||
|
||||
if (VTy.getMachineValueType() == MVT::iPTR && OperandIsAPointer) {
|
||||
addPredicate<PointerToAnyOperandMatcher>(0);
|
||||
return Error::success();
|
||||
}
|
||||
|
||||
auto OpTyOrNone = MVTToLLT(VTy.getMachineValueType().SimpleTy);
|
||||
if (!OpTyOrNone)
|
||||
return failedImport("unsupported type");
|
||||
|
||||
if (OperandIsAPointer)
|
||||
addPredicate<PointerToAnyOperandMatcher>(OpTyOrNone->get().getSizeInBits());
|
||||
else
|
||||
addPredicate<LLTOperandMatcher>(*OpTyOrNone);
|
||||
return Error::success();
|
||||
}
|
||||
|
||||
unsigned ComplexPatternOperandMatcher::getAllocatedTemporariesBaseID() const {
|
||||
return Operand.getAllocatedTemporariesBaseID();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue