summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNAKAMURA Takumi <geek4civic@gmail.com>2016-02-11 16:33:20 +0000
committerNAKAMURA Takumi <geek4civic@gmail.com>2016-02-11 16:33:20 +0000
commitd8cd0604223442ff2d25e64653667f85363398bd (patch)
treec8cc27691e1c7f6cc62680be10f1155f59157a9d
parentcf0f0069e7d9e89a06d6ebc6a6d09c50d8872e99 (diff)
downloadbcm5719-llvm-d8cd0604223442ff2d25e64653667f85363398bd.tar.gz
bcm5719-llvm-d8cd0604223442ff2d25e64653667f85363398bd.zip
Revert r260265, "clang-cl: Support loading plugins on Windows"
It causes memory exhaust on mingw-w64(x64). Investigating. llvm-svn: 260536
-rw-r--r--clang/docs/ClangPlugins.rst5
-rw-r--r--clang/examples/PrintFunctionNames/PrintFunctionNames.cpp1
-rw-r--r--clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp9
3 files changed, 2 insertions, 13 deletions
diff --git a/clang/docs/ClangPlugins.rst b/clang/docs/ClangPlugins.rst
index 1aeff62e2fd..9a5bc142130 100644
--- a/clang/docs/ClangPlugins.rst
+++ b/clang/docs/ClangPlugins.rst
@@ -37,14 +37,11 @@ Registering a plugin
====================
A plugin is loaded from a dynamic library at runtime by the compiler. To
-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:
+register a plugin in a library, use ``FrontendPluginRegistry::Add<>``:
.. code-block:: c++
static FrontendPluginRegistry::Add<MyPlugin> X("my-plugin-name", "my plugin description");
- LLVM_EXPORT_REGISTRY(FrontendPluginRegistry)
Putting it all together
=======================
diff --git a/clang/examples/PrintFunctionNames/PrintFunctionNames.cpp b/clang/examples/PrintFunctionNames/PrintFunctionNames.cpp
index e2834b9ad23..9f8f6e3f050 100644
--- a/clang/examples/PrintFunctionNames/PrintFunctionNames.cpp
+++ b/clang/examples/PrintFunctionNames/PrintFunctionNames.cpp
@@ -121,4 +121,3 @@ protected:
static FrontendPluginRegistry::Add<PrintFunctionNamesAction>
X("print-fns", "print function names");
-LLVM_EXPORT_REGISTRY(FrontendPluginRegistry)
diff --git a/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp b/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp
index 90642abb5d5..116590e5375 100644
--- a/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp
+++ b/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp
@@ -189,16 +189,9 @@ bool clang::ExecuteCompilerInvocation(CompilerInstance *Clang) {
e = Clang->getFrontendOpts().Plugins.size(); i != e; ++i) {
const std::string &Path = Clang->getFrontendOpts().Plugins[i];
std::string Error;
- llvm::sys::DynamicLibrary DL(
- 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 {
+ if (llvm::sys::DynamicLibrary::LoadLibraryPermanently(Path.c_str(), &Error))
Clang->getDiagnostics().Report(diag::err_fe_unable_to_load_plugin)
<< Path << Error;
- }
}
// Honor -mllvm.
OpenPOWER on IntegriCloud