diff --git a/mlir/examples/toy/Ch4/mlir/MLIRGen.cpp b/mlir/examples/toy/Ch4/mlir/MLIRGen.cpp --- a/mlir/examples/toy/Ch4/mlir/MLIRGen.cpp +++ b/mlir/examples/toy/Ch4/mlir/MLIRGen.cpp @@ -172,7 +172,7 @@ // If this function isn't main, then set the visibility to private. if (funcAST.getProto()->getName() != "main") - function.setVisibility(mlir::FuncOp::Visibility::Private); + function.setPrivate(); return function; } diff --git a/mlir/examples/toy/Ch5/mlir/MLIRGen.cpp b/mlir/examples/toy/Ch5/mlir/MLIRGen.cpp --- a/mlir/examples/toy/Ch5/mlir/MLIRGen.cpp +++ b/mlir/examples/toy/Ch5/mlir/MLIRGen.cpp @@ -172,7 +172,7 @@ // If this function isn't main, then set the visibility to private. if (funcAST.getProto()->getName() != "main") - function.setVisibility(mlir::FuncOp::Visibility::Private); + function.setPrivate(); return function; } diff --git a/mlir/examples/toy/Ch6/mlir/MLIRGen.cpp b/mlir/examples/toy/Ch6/mlir/MLIRGen.cpp --- a/mlir/examples/toy/Ch6/mlir/MLIRGen.cpp +++ b/mlir/examples/toy/Ch6/mlir/MLIRGen.cpp @@ -172,7 +172,7 @@ // If this function isn't main, then set the visibility to private. if (funcAST.getProto()->getName() != "main") - function.setVisibility(mlir::FuncOp::Visibility::Private); + function.setPrivate(); return function; } diff --git a/mlir/examples/toy/Ch7/mlir/MLIRGen.cpp b/mlir/examples/toy/Ch7/mlir/MLIRGen.cpp --- a/mlir/examples/toy/Ch7/mlir/MLIRGen.cpp +++ b/mlir/examples/toy/Ch7/mlir/MLIRGen.cpp @@ -225,7 +225,7 @@ // If this function isn't main, then set the visibility to private. if (funcAST.getProto()->getName() != "main") - function.setVisibility(mlir::FuncOp::Visibility::Private); + function.setPrivate(); return function; } diff --git a/mlir/include/mlir/IR/SymbolInterfaces.td b/mlir/include/mlir/IR/SymbolInterfaces.td --- a/mlir/include/mlir/IR/SymbolInterfaces.td +++ b/mlir/include/mlir/IR/SymbolInterfaces.td @@ -53,12 +53,6 @@ return mlir::SymbolTable::getSymbolVisibility(this->getOperation()); }] >, - InterfaceMethod<"Sets the visibility of this symbol.", - "void", "setVisibility", (ins "mlir::SymbolTable::Visibility":$vis), [{}], - /*defaultImplementation=*/[{ - mlir::SymbolTable::setSymbolVisibility(this->getOperation(), vis); - }] - >, InterfaceMethod<"Returns true if this symbol has nested visibility.", "bool", "isNested", (ins), [{}], /*defaultImplementation=*/[{ @@ -77,6 +71,30 @@ return getVisibility() == mlir::SymbolTable::Visibility::Public; }] >, + InterfaceMethod<"Sets the visibility of this symbol.", + "void", "setVisibility", (ins "mlir::SymbolTable::Visibility":$vis), [{}], + /*defaultImplementation=*/[{ + mlir::SymbolTable::setSymbolVisibility(this->getOperation(), vis); + }] + >, + InterfaceMethod<"Sets the visibility of this symbol to be nested.", + "void", "setNested", (ins), [{}], + /*defaultImplementation=*/[{ + setVisibility(mlir::SymbolTable::Visibility::Nested); + }] + >, + InterfaceMethod<"Sets the visibility of this symbol to be private.", + "void", "setPrivate", (ins), [{}], + /*defaultImplementation=*/[{ + setVisibility(mlir::SymbolTable::Visibility::Private); + }] + >, + InterfaceMethod<"Sets the visibility of this symbol to be public.", + "void", "setPublic", (ins), [{}], + /*defaultImplementation=*/[{ + setVisibility(mlir::SymbolTable::Visibility::Public); + }] + >, InterfaceMethod<[{ Get all of the uses of the current symbol that are nested within the given operation 'from'.