[NFC] Re-instate use of FuncOp::isPublic()
PiperOrigin-RevId: 317774876 Change-Id: I6a832236377d403b1ebd24ecbc26025c37dc1c13
This commit is contained in:
parent
4d13d6416d
commit
e60cf08994
@ -232,22 +232,19 @@ static LogicalResult VerifySavedModelModule(
|
|||||||
for (auto func : module.getOps<FuncOp>()) {
|
for (auto func : module.getOps<FuncOp>()) {
|
||||||
const bool is_exported = IsExported(func);
|
const bool is_exported = IsExported(func);
|
||||||
|
|
||||||
if (is_exported && func.getVisibility() != FuncOp::Visibility::Public) {
|
if (is_exported && !func.isPublic()) {
|
||||||
return func.emitError()
|
return func.emitError()
|
||||||
<< "exported function @" << func.getName() << " should be public";
|
<< "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()
|
return func.emitError() << "non-exported function @" << func.getName()
|
||||||
<< " should be private";
|
<< " should be private";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (HasAnyTfSavedModelArgAttr(func)) {
|
if (!is_exported && HasAnyTfSavedModelArgAttr(func)) {
|
||||||
if (!is_exported) {
|
return func.emitError() << "can only apply 'tf_saved_model' argument "
|
||||||
return func.emitError()
|
"attributes to exported functions";
|
||||||
<< "can only apply 'tf_saved_model' argument attributes "
|
|
||||||
"to exported functions";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user