diff options
author | Gabor Horvath <xazax.hun@gmail.com> | 2015-07-15 20:32:07 +0000 |
---|---|---|
committer | Gabor Horvath <xazax.hun@gmail.com> | 2015-07-15 20:32:07 +0000 |
commit | a61bb64dcfdf95c2c8634889f1366bcbb4d591f2 (patch) | |
tree | 6688e2c01d77a60e7d0c2c9ee3a4c54b7377c51f | |
parent | b0b4132bcc8fc3cb16b25cf4d87abc11329f857b (diff) | |
download | bcm5719-llvm-a61bb64dcfdf95c2c8634889f1366bcbb4d591f2.tar.gz bcm5719-llvm-a61bb64dcfdf95c2c8634889f1366bcbb4d591f2.zip |
[Static Analyzer] Do not fail silently, when the analyzer is invoked from tooling lib, an analyzer plugin is loaded, but the runtime linker fails to link.
llvm-svn: 242326
-rw-r--r-- | clang/lib/StaticAnalyzer/Frontend/CheckerRegistration.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/clang/lib/StaticAnalyzer/Frontend/CheckerRegistration.cpp b/clang/lib/StaticAnalyzer/Frontend/CheckerRegistration.cpp index 7fced1e5c71..b534385358f 100644 --- a/clang/lib/StaticAnalyzer/Frontend/CheckerRegistration.cpp +++ b/clang/lib/StaticAnalyzer/Frontend/CheckerRegistration.cpp @@ -52,7 +52,12 @@ ClangCheckerRegistry::ClangCheckerRegistry(ArrayRef<std::string> plugins, for (ArrayRef<std::string>::iterator i = plugins.begin(), e = plugins.end(); i != e; ++i) { // Get access to the plugin. - DynamicLibrary lib = DynamicLibrary::getPermanentLibrary(i->c_str()); + std::string err; + DynamicLibrary lib = DynamicLibrary::getPermanentLibrary(i->c_str(), &err); + if (!lib.isValid()) { + diags->Report(diag::err_fe_unable_to_load_plugin) << *i << err; + continue; + } // See if it's compatible with this build of clang. const char *pluginAPIVersion = |