[NFC] Re-instate use of FuncOp::isPublic()

PiperOrigin-RevId: 317774876
Change-Id: I6a832236377d403b1ebd24ecbc26025c37dc1c13
This commit is contained in:
Rahul Joshi 2020-06-22 18:11:15 -07:00 committed by TensorFlower Gardener
parent 4d13d6416d
commit e60cf08994

View File

@ -232,22 +232,19 @@ static LogicalResult VerifySavedModelModule(
for (auto func : module.getOps<FuncOp>()) {
const bool is_exported = IsExported(func);
if (is_exported && func.getVisibility() != FuncOp::Visibility::Public) {
if (is_exported && !func.isPublic()) {
return func.emitError()
<< "exported function @" << func.getName() << " should be public";
}
if (!is_exported && func.getVisibility() == FuncOp::Visibility::Public) {
if (!is_exported && func.isPublic()) {
return func.emitError() << "non-exported function @" << func.getName()
<< " should be private";
}
if (HasAnyTfSavedModelArgAttr(func)) {
if (!is_exported) {
return func.emitError()
<< "can only apply 'tf_saved_model' argument attributes "
"to exported functions";
}
if (!is_exported && HasAnyTfSavedModelArgAttr(func)) {
return func.emitError() << "can only apply 'tf_saved_model' argument "
"attributes to exported functions";
}
}