freebsd-dev/contrib/llvm/patches/patch-14-llvm-r216571-dynamiclib-usability.diff
Dimitry Andric 9cac79b378 Upgrade our copy of clang and llvm to 3.5.1 release. This is a bugfix
only release, no new features have been added.

Please note that this version requires C++11 support to build; see
UPDATING for more information.

Release notes for llvm and clang can be found here:
<http://llvm.org/releases/3.5.1/docs/ReleaseNotes.html>
<http://llvm.org/releases/3.5.1/tools/clang/docs/ReleaseNotes.html>

MFC after:	1 month
X-MFC-With:	276479
2015-01-18 14:14:47 +00:00

33 lines
1.1 KiB
Diff

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.