//===- SymbolPrivatize.cpp - Pass to mark symbols private -----------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // // This file implements an pass that marks all symbols as private unless // excluded. // //===----------------------------------------------------------------------===// #include "mlir/Transforms/Passes.h" #include "mlir/IR/SymbolTable.h" namespace mlir { #define GEN_PASS_DEF_SYMBOLPRIVATIZE #include "mlir/Transforms/Passes.h.inc" } // namespace mlir usingnamespacemlir; namespace { struct SymbolPrivatize : public impl::SymbolPrivatizeBase<SymbolPrivatize> { … }; } // namespace SymbolPrivatize::SymbolPrivatize(llvm::ArrayRef<std::string> excludeSymbols) { … } LogicalResult SymbolPrivatize::initialize(MLIRContext *context) { … } void SymbolPrivatize::runOnOperation() { … } std::unique_ptr<Pass> mlir::createSymbolPrivatizePass(ArrayRef<std::string> exclude) { … }