Skip to content
Snippets Groups Projects
Commit 7eba45f7 authored by NAKAMURA Takumi's avatar NAKAMURA Takumi
Browse files

Revert r260265, "clang-cl: Support loading plugins on Windows"

It causes memory exhaust on mingw-w64(x64). Investigating.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@260536 91177308-0d34-0410-b5e6-96231b3b80d8
parent aba1af8a
No related branches found
No related tags found
No related merge requests found
...@@ -37,14 +37,11 @@ Registering a plugin ...@@ -37,14 +37,11 @@ Registering a plugin
==================== ====================
A plugin is loaded from a dynamic library at runtime by the compiler. To A plugin is loaded from a dynamic library at runtime by the compiler. To
register a plugin in a library, use ``FrontendPluginRegistry::Add<>``. register a plugin in a library, use ``FrontendPluginRegistry::Add<>``:
On Windows, you also need to export your plugin registry using
``LLVM_EXPORT_REGISTRY``. Here is an example:
.. code-block:: c++ .. code-block:: c++
static FrontendPluginRegistry::Add<MyPlugin> X("my-plugin-name", "my plugin description"); static FrontendPluginRegistry::Add<MyPlugin> X("my-plugin-name", "my plugin description");
LLVM_EXPORT_REGISTRY(FrontendPluginRegistry)
Putting it all together Putting it all together
======================= =======================
......
...@@ -121,4 +121,3 @@ protected: ...@@ -121,4 +121,3 @@ protected:
static FrontendPluginRegistry::Add<PrintFunctionNamesAction> static FrontendPluginRegistry::Add<PrintFunctionNamesAction>
X("print-fns", "print function names"); X("print-fns", "print function names");
LLVM_EXPORT_REGISTRY(FrontendPluginRegistry)
...@@ -189,16 +189,9 @@ bool clang::ExecuteCompilerInvocation(CompilerInstance *Clang) { ...@@ -189,16 +189,9 @@ bool clang::ExecuteCompilerInvocation(CompilerInstance *Clang) {
e = Clang->getFrontendOpts().Plugins.size(); i != e; ++i) { e = Clang->getFrontendOpts().Plugins.size(); i != e; ++i) {
const std::string &Path = Clang->getFrontendOpts().Plugins[i]; const std::string &Path = Clang->getFrontendOpts().Plugins[i];
std::string Error; std::string Error;
llvm::sys::DynamicLibrary DL( if (llvm::sys::DynamicLibrary::LoadLibraryPermanently(Path.c_str(), &Error))
llvm::sys::DynamicLibrary::getPermanentLibrary(Path.c_str(), &Error));
if (DL.isValid()) {
// On Windows, we need to import the plugin front-end action
// dynamically.
LLVM_IMPORT_REGISTRY(FrontendPluginRegistry, DL);
} else {
Clang->getDiagnostics().Report(diag::err_fe_unable_to_load_plugin) Clang->getDiagnostics().Report(diag::err_fe_unable_to_load_plugin)
<< Path << Error; << Path << Error;
}
} }
// Honor -mllvm. // Honor -mllvm.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment