Rename Op::isClassFor to Op::classof to match the LLVM isa/dyn_cast standard naming scheme.

--

PiperOrigin-RevId: 247771192
This commit is contained in:
River Riddle 2019-05-11 12:45:35 -07:00 committed by Mehdi Amini
parent e686a11523
commit 360f8a209e
5 changed files with 16 additions and 16 deletions

View File

@ -776,7 +776,7 @@ public:
/// This hook can be overridden with a more specific implementation in
/// the subclass of Base.
///
static bool isClassFor(Operation *op) {
static bool classof(Operation *op) {
return op->getName().getStringRef() == ConcreteType::getOperationName();
}

View File

@ -407,7 +407,7 @@ public:
/// The is methods return true if the operation is a typed op (like DimOp) of
/// of the given class.
template <typename OpClass> bool isa() { return OpClass::isClassFor(this); }
template <typename OpClass> bool isa() { return OpClass::classof(this); }
//===--------------------------------------------------------------------===//
// Operation Walkers

View File

@ -82,7 +82,7 @@ public:
Dialect &dialect;
/// Return true if this "op class" can match against the specified operation.
bool (&isClassFor)(Operation *op);
bool (&classof)(Operation *op);
/// Use the specified object to parse this ops custom assembly format.
ParseResult (&parseAssembly)(OpAsmParser *parser, OperationState *result);
@ -141,15 +141,15 @@ public:
/// operations they contain.
template <typename T> static AbstractOperation get(Dialect &dialect) {
return AbstractOperation(
T::getOperationName(), dialect, T::getOperationProperties(),
T::isClassFor, T::parseAssembly, T::printAssembly, T::verifyInvariants,
T::getOperationName(), dialect, T::getOperationProperties(), T::classof,
T::parseAssembly, T::printAssembly, T::verifyInvariants,
T::constantFoldHook, T::foldHook, T::getCanonicalizationPatterns);
}
private:
AbstractOperation(
StringRef name, Dialect &dialect, OperationProperties opProperties,
bool (&isClassFor)(Operation *op),
bool (&classof)(Operation *op),
ParseResult (&parseAssembly)(OpAsmParser *parser, OperationState *result),
void (&printAssembly)(Operation *op, OpAsmPrinter *p),
LogicalResult (&verifyInvariants)(Operation *op),
@ -160,7 +160,7 @@ private:
SmallVectorImpl<Value *> &results),
void (&getCanonicalizationPatterns)(OwningRewritePatternList &results,
MLIRContext *context))
: name(name), dialect(dialect), isClassFor(isClassFor),
: name(name), dialect(dialect), classof(classof),
parseAssembly(parseAssembly), printAssembly(printAssembly),
verifyInvariants(verifyInvariants), constantFoldHook(constantFoldHook),
foldHook(foldHook),

View File

@ -309,7 +309,7 @@ public:
APFloat getValue() { return getAttrOfType<FloatAttr>("value").getValue(); }
static bool isClassFor(Operation *op);
static bool classof(Operation *op);
};
/// This is a refinement of the "constant" op for the case where it is
@ -332,7 +332,7 @@ public:
int64_t getValue() { return getAttrOfType<IntegerAttr>("value").getInt(); }
static bool isClassFor(Operation *op);
static bool classof(Operation *op);
};
/// This is a refinement of the "constant" op for the case where it is
@ -350,7 +350,7 @@ public:
int64_t getValue() { return getAttrOfType<IntegerAttr>("value").getInt(); }
static bool isClassFor(Operation *op);
static bool classof(Operation *op);
};
// DmaStartOp starts a non-blocking DMA operation that transfers data from a

View File

@ -1171,14 +1171,14 @@ void ConstantFloatOp::build(Builder *builder, OperationState *result,
ConstantOp::build(builder, result, type, builder->getFloatAttr(type, value));
}
bool ConstantFloatOp::isClassFor(Operation *op) {
return ConstantOp::isClassFor(op) &&
bool ConstantFloatOp::classof(Operation *op) {
return ConstantOp::classof(op) &&
op->getResult(0)->getType().isa<FloatType>();
}
/// ConstantIntOp only matches values whose result type is an IntegerType.
bool ConstantIntOp::isClassFor(Operation *op) {
return ConstantOp::isClassFor(op) &&
bool ConstantIntOp::classof(Operation *op) {
return ConstantOp::classof(op) &&
op->getResult(0)->getType().isa<IntegerType>();
}
@ -1199,8 +1199,8 @@ void ConstantIntOp::build(Builder *builder, OperationState *result,
}
/// ConstantIndexOp only matches values whose result type is Index.
bool ConstantIndexOp::isClassFor(Operation *op) {
return ConstantOp::isClassFor(op) && op->getResult(0)->getType().isIndex();
bool ConstantIndexOp::classof(Operation *op) {
return ConstantOp::classof(op) && op->getResult(0)->getType().isIndex();
}
void ConstantIndexOp::build(Builder *builder, OperationState *result,