[opt/llc] Determine the context of loaded plugin with optimization passes

Hello, everyone, I have written a simple plugin with exposed optimization passes (via Legacy Pass Manager API, as a initializeMyPass1(), initializeMyPass2(), etc. calls at library load. But some passes are machine specific (are derived from MachineFunctionPass), some passes are not (e.g. derived from ModulePass).
As the opt doesn’t support the machine-specific passes (only IR->IR transformations) I have to determine in which context the plugin has been loaded to avoid registering some optimization which might crash the opt.
Is there any standardized way to determine which tool is loading the plugin in plugin context?
Thanks in advance.