summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/Support/DynamicLibrary/PipSqueak.h
diff options
context:
space:
mode:
authorFrederich Munch <colsebas@hotmail.com>2017-04-24 02:30:12 +0000
committerFrederich Munch <colsebas@hotmail.com>2017-04-24 02:30:12 +0000
commit9f40457d61dc8285e454d688e9062c5813299341 (patch)
tree6e5120defd9628318c05250ed5e7fc4f63e935b6 /llvm/unittests/Support/DynamicLibrary/PipSqueak.h
parentfe3c21c8797e7fe12b4c9727ae6d4e70236c869a (diff)
downloadbcm5719-llvm-9f40457d61dc8285e454d688e9062c5813299341.tar.gz
bcm5719-llvm-9f40457d61dc8285e454d688e9062c5813299341.zip
Refactor DynamicLibrary so searching for a symbol will have a defined order and
libraries are properly unloaded when llvm_shutdown is called. Summary: This was mostly affecting usage of the JIT, where storing the library handles in a set made iteration unordered/undefined. This lead to disagreement between the JIT and native code as to what the address and implementation of particularly on Windows with stdlib functions: JIT: putenv_s("TEST", "VALUE") // called msvcrt.dll, putenv_s JIT: getenv("TEST") -> "VALUE" // called msvcrt.dll, getenv Native: getenv("TEST") -> NULL // called ucrt.dll, getenv Also fixed is the issue of DynamicLibrary::getPermanentLibrary(0,0) on Windows not giving priority to the process' symbols as it did on Unix. Reviewers: chapuni, v.g.vassilev, lhames Reviewed By: lhames Subscribers: danalbert, srhines, mgorny, vsk, llvm-commits Differential Revision: https://reviews.llvm.org/D30107 llvm-svn: 301153
Diffstat (limited to 'llvm/unittests/Support/DynamicLibrary/PipSqueak.h')
-rw-r--r--llvm/unittests/Support/DynamicLibrary/PipSqueak.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/llvm/unittests/Support/DynamicLibrary/PipSqueak.h b/llvm/unittests/Support/DynamicLibrary/PipSqueak.h
new file mode 100644
index 00000000000..e6a859d6071
--- /dev/null
+++ b/llvm/unittests/Support/DynamicLibrary/PipSqueak.h
@@ -0,0 +1,19 @@
+//===- llvm/unittest/Support/DynamicLibrary/PipSqueak.h -------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_PIPSQUEAK_H
+#define LLVM_PIPSQUEAK_H
+
+#ifdef _WIN32
+#define PIPSQUEAK_EXPORT __declspec(dllexport)
+#else
+#define PIPSQUEAK_EXPORT
+#endif
+
+#endif
OpenPOWER on IntegriCloud