[flang-commits] [flang] [flang] Export fir-opt symbols for MLIR dialect/pass plugins (PR #212152)

Valentin Churavy via flang-commits flang-commits at lists.llvm.org
Sun Jul 26 14:40:52 PDT 2026


https://github.com/vchuravy created https://github.com/llvm/llvm-project/pull/212152

Lets plugins loaded with --load-dialect-plugin / --load-pass-plugin resolve
MLIR and LLVM symbols against fir-opt, as mlir-opt already does.



>From 8d53163b13b4077bab2fceef0c296ed7fa54dae2 Mon Sep 17 00:00:00 2001
From: Valentin Churavy <v.churavy at gmail.com>
Date: Wed, 22 Jul 2026 17:01:22 +0200
Subject: [PATCH] [flang] Export fir-opt symbols for MLIR dialect/pass plugins

Lets plugins loaded with --load-dialect-plugin / --load-pass-plugin resolve
MLIR and LLVM symbols against fir-opt, as mlir-opt already does.

Co-Authored-By: Claude Opus 4.8 <noreply at anthropic.com>
---
 flang/tools/fir-opt/CMakeLists.txt | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/flang/tools/fir-opt/CMakeLists.txt b/flang/tools/fir-opt/CMakeLists.txt
index 2697f74c2f0b8..10f2dd3be09e5 100644
--- a/flang/tools/fir-opt/CMakeLists.txt
+++ b/flang/tools/fir-opt/CMakeLists.txt
@@ -1,5 +1,9 @@
 add_flang_tool(fir-opt fir-opt.cpp)
 llvm_update_compile_flags(fir-opt)
+
+# Let plugins loaded with --load-dialect-plugin / --load-pass-plugin resolve
+# MLIR and LLVM symbols against fir-opt, as mlir-opt already does.
+export_executable_symbols_for_plugins(fir-opt)
 get_property(dialect_libs GLOBAL PROPERTY MLIR_DIALECT_LIBS)
 get_property(extension_libs GLOBAL PROPERTY MLIR_EXTENSION_LIBS)
 



More information about the flang-commits mailing list