summaryrefslogtreecommitdiffstats
path: root/contrib/llvm/patches/patch-14-llvm-r216571-dynamiclib-usability.diff
blob: ff0a6d174fa3ec1693b885243f57a820a4ecc6fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
Pull in r216571 from upstream llvm trunk (by Zachary Turner):

  Fix some semantic usability issues with DynamicLibrary.

  This patch allows invalid DynamicLibrary instances to be
  constructed, and fixes the const-correctness of the isValid()
  method.

  No functional change.

This is needed for supporting the upgrade to a newer LLDB snapshot.

Introduced here: http://svnweb.freebsd.org/changeset/base/275153

Index: include/llvm/Support/DynamicLibrary.h
===================================================================
--- include/llvm/Support/DynamicLibrary.h
+++ include/llvm/Support/DynamicLibrary.h
@@ -43,10 +43,11 @@ namespace sys {
     // Opaque data used to interface with OS-specific dynamic library handling.
     void *Data;
 
+  public:
     explicit DynamicLibrary(void *data = &Invalid) : Data(data) {}
-  public:
+
     /// Returns true if the object refers to a valid library.
-    bool isValid() { return Data != &Invalid; }
+    bool isValid() const { return Data != &Invalid; }
 
     /// Searches through the library for the symbol \p symbolName. If it is
     /// found, the address of that symbol is returned. If not, NULL is returned.
OpenPOWER on IntegriCloud