[PATCH] D33659: Extend DynamicLibrary class to be usable without loading permanently.

Frederich Munch via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 6 10:22:33 PDT 2017


marsupial updated this revision to Diff 105466.

https://reviews.llvm.org/D33659

Files:
  lib/StaticAnalyzer/Frontend/CheckerRegistration.cpp


Index: lib/StaticAnalyzer/Frontend/CheckerRegistration.cpp
===================================================================
--- lib/StaticAnalyzer/Frontend/CheckerRegistration.cpp
+++ lib/StaticAnalyzer/Frontend/CheckerRegistration.cpp
@@ -53,23 +53,23 @@
        i != e; ++i) {
     // Get access to the plugin.
     std::string err;
-    DynamicLibrary lib = DynamicLibrary::getPermanentLibrary(i->c_str(), &err);
-    if (!lib.isValid()) {
+    DynamicLibrary *lib = DynamicLibrary::getPermanentLibrary(i->c_str(), &err);
+    if (!lib) {
       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 =
-      (const char *) lib.getAddressOfSymbol("clang_analyzerAPIVersionString");
+      (const char *) lib->getAddressOfSymbol("clang_analyzerAPIVersionString");
     if (!isCompatibleAPIVersion(pluginAPIVersion)) {
       warnIncompatible(diags, *i, pluginAPIVersion);
       continue;
     }
 
     // Register its checkers.
     RegisterCheckersFn registerPluginCheckers =
-      (RegisterCheckersFn) (intptr_t) lib.getAddressOfSymbol(
+      (RegisterCheckersFn) (intptr_t) lib->getAddressOfSymbol(
                                                       "clang_registerCheckers");
     if (registerPluginCheckers)
       registerPluginCheckers(*this);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D33659.105466.patch
Type: text/x-patch
Size: 1390 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170706/9b39db0f/attachment.bin>


More information about the cfe-commits mailing list