Index: mlir/examples/standalone/include/Standalone/StandalonePasses.h =================================================================== --- mlir/examples/standalone/include/Standalone/StandalonePasses.h +++ mlir/examples/standalone/include/Standalone/StandalonePasses.h @@ -1,9 +1,16 @@ +//===- StandalonePasses.h - Standalone passes ------------------*- C++ -*-===// +// +// This file is licensed 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 +// +//===----------------------------------------------------------------------===// #ifndef STANDALONE_STANDALONEPASSES_H #define STANDALONE_STANDALONEPASSES_H -#include "mlir/Pass/Pass.h" -#include "Standalone/StandaloneOps.h" #include "Standalone/StandaloneDialect.h" +#include "Standalone/StandaloneOps.h" +#include "mlir/Pass/Pass.h" #include namespace mlir { Index: mlir/examples/standalone/lib/Standalone/StandalonePasses.cpp =================================================================== --- mlir/examples/standalone/lib/Standalone/StandalonePasses.cpp +++ mlir/examples/standalone/lib/Standalone/StandalonePasses.cpp @@ -1,3 +1,10 @@ +//===- StandalonePasses.cpp - Standalone passes -----------------*- C++ -*-===// +// +// This file is licensed 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 +// +//===----------------------------------------------------------------------===// #include "mlir/Dialect/Func/IR/FuncOps.h" #include "mlir/IR/BuiltinOps.h" #include "mlir/IR/PatternMatch.h" Index: mlir/examples/standalone/standalone-plugin/CMakeLists.txt =================================================================== --- mlir/examples/standalone/standalone-plugin/CMakeLists.txt +++ mlir/examples/standalone/standalone-plugin/CMakeLists.txt @@ -17,3 +17,5 @@ llvm_update_compile_flags(StandalonePlugin) target_link_libraries(StandalonePlugin PRIVATE ${LIBS}) + +mlir_check_all_link_libraries(StandalonePlugin) \ No newline at end of file Index: mlir/examples/standalone/standalone-plugin/standalone-plugin.cpp =================================================================== --- mlir/examples/standalone/standalone-plugin/standalone-plugin.cpp +++ mlir/examples/standalone/standalone-plugin/standalone-plugin.cpp @@ -1,5 +1,4 @@ -//===- standalone-plugin.cpp ---------------------------------------*- C++ -//-*-===// +//===- standalone-plugin.cpp ------------------------------------*- C++ -*-===// // // This file is licensed under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. @@ -20,7 +19,6 @@ using namespace mlir; - /// Dialect plugin registration mechanism. /// Observe that it also allows to register passes. DialectPluginLibraryInfo getStandaloneDialect() { Index: mlir/examples/standalone/test/Standalone/standalone-plugin.mlir =================================================================== --- mlir/examples/standalone/test/Standalone/standalone-plugin.mlir +++ mlir/examples/standalone/test/Standalone/standalone-plugin.mlir @@ -1,4 +1,4 @@ -// RUN: mlir-opt %s --load-dialect-plugin=lib/libStandalonePlugin.so --pass-pipeline="builtin.module(standalone-switch-bar-foo)" | FileCheck %s +// RUN: mlir-opt %s --load-dialect-plugin=%standalone_libs/libStandalonePlugin.so --pass-pipeline="builtin.module(standalone-switch-bar-foo)" | FileCheck %s module { // CHECK-LABEL: func @foo() Index: mlir/examples/standalone/test/lit.cfg.py =================================================================== --- mlir/examples/standalone/test/lit.cfg.py +++ mlir/examples/standalone/test/lit.cfg.py @@ -44,12 +44,16 @@ # test_exec_root: The root path where tests should be run. config.test_exec_root = os.path.join(config.standalone_obj_root, 'test') config.standalone_tools_dir = os.path.join(config.standalone_obj_root, 'bin') +config.standalone_libs_dir = os.path.join(config.standalone_obj_root, 'lib') + +config.substitutions.append(('%standalone_libs', config.standalone_libs_dir)) # Tweak the PATH to include the tools dir. llvm_config.with_environment('PATH', config.llvm_tools_dir, append_path=True) tool_dirs = [config.standalone_tools_dir, config.llvm_tools_dir] tools = [ + 'mlir-opt', 'standalone-capi-test', 'standalone-opt', 'standalone-translate', Index: mlir/lib/IR/DialectPlugin.cpp =================================================================== --- mlir/lib/IR/DialectPlugin.cpp +++ mlir/lib/IR/DialectPlugin.cpp @@ -18,9 +18,9 @@ auto Library = llvm::sys::DynamicLibrary::getPermanentLibrary(Filename.c_str(), &Error); if (!Library.isValid()) - return llvm::make_error(Twine("Could not load library '") + - Filename + "': " + Error, - llvm::inconvertibleErrorCode()); + return llvm::make_error( + Twine("Could not load library '") + Filename + "': " + Error, + llvm::inconvertibleErrorCode()); DialectPlugin P{Filename, Library}; Index: mlir/lib/Pass/PassPlugin.cpp =================================================================== --- mlir/lib/Pass/PassPlugin.cpp +++ mlir/lib/Pass/PassPlugin.cpp @@ -18,9 +18,9 @@ auto Library = llvm::sys::DynamicLibrary::getPermanentLibrary(Filename.c_str(), &Error); if (!Library.isValid()) - return llvm::make_error(Twine("Could not load library '") + - Filename + "': " + Error, - llvm::inconvertibleErrorCode()); + return llvm::make_error( + Twine("Could not load library '") + Filename + "': " + Error, + llvm::inconvertibleErrorCode()); PassPlugin P{Filename, Library}; @@ -30,9 +30,9 @@ (intptr_t)Library.getAddressOfSymbol("mlirGetPassPluginInfo"); if (!getDetailsFn) - return llvm::make_error(Twine("Plugin entry point not found in '") + - Filename, - llvm::inconvertibleErrorCode()); + return llvm::make_error( + Twine("Plugin entry point not found in '") + Filename, + llvm::inconvertibleErrorCode()); P.Info = reinterpret_cast(getDetailsFn)(); @@ -44,9 +44,9 @@ llvm::inconvertibleErrorCode()); if (!P.Info.RegisterPassRegistryCallbacks) - return llvm::make_error(Twine("Empty entry callback in plugin '") + - Filename + "'.'", - llvm::inconvertibleErrorCode()); + return llvm::make_error( + Twine("Empty entry callback in plugin '") + Filename + "'.'", + llvm::inconvertibleErrorCode()); return P; } \ No newline at end of file