Rename ConversionTarget::isLegal to isDynamicallyLegal to better represent what the function is actually checking.

PiperOrigin-RevId: 254141073
This commit is contained in:
River Riddle 2019-06-19 23:39:06 -07:00 committed by jpienaar
parent d7ba69e811
commit 7202c4e69d
2 changed files with 5 additions and 5 deletions

View File

@ -240,9 +240,9 @@ public:
/// Runs a custom legalization query for the given operation. This should
/// return true if the given operation is legal, otherwise false.
virtual bool isLegal(Operation *op) const {
virtual bool isDynamicallyLegal(Operation *op) const {
llvm_unreachable(
"targets with custom legalization must override 'isLegal'");
"targets with custom legalization must override 'isDynamicallyLegal'");
}
//===--------------------------------------------------------------------===//
@ -265,7 +265,7 @@ public:
}
/// Register the given operation as dynamically legal, i.e. requiring custom
/// handling by the target via 'isLegal'.
/// handling by the target via 'isDynamicallyLegal'.
template <typename OpT> void addDynamicallyLegalOp() {
setOpAction<OpT>(LegalizationAction::Dynamic);
}
@ -291,7 +291,7 @@ public:
}
/// Register the operations of the given dialects as dynamically legal, i.e.
/// requiring custom handling by the target via 'isLegal'.
/// requiring custom handling by the target via 'isDynamicallyLegal'.
template <typename... Names>
void addDynamicallyLegalDialect(StringRef name, Names... names) {
SmallVector<StringRef, 2> dialectNames({name, names...});

View File

@ -582,7 +582,7 @@ OperationLegalizer::legalize(Operation *op,
// Otherwise, handle dynamic legalization.
LLVM_DEBUG(llvm::dbgs() << "- Trying dynamic legalization.\n");
if (target.isLegal(op))
if (target.isDynamicallyLegal(op))
return success();
// Fallthough to see if a pattern can convert this into a legal operation.