diff options
| author | Filip Pizlo <fpizlo@apple.com> | 2013-09-18 16:40:14 +0000 |
|---|---|---|
| committer | Filip Pizlo <fpizlo@apple.com> | 2013-09-18 16:40:14 +0000 |
| commit | 57093e88e013efeac744af18dc9deda113dd1417 (patch) | |
| tree | 578a905f7609f9b4f6d7faa64caeb73aa29d815c /llvm/lib/Support/Windows/DynamicLibrary.inc | |
| parent | 82066ed0fb8cb7adca31545b39feff604029f497 (diff) | |
| download | bcm5719-llvm-57093e88e013efeac744af18dc9deda113dd1417.tar.gz bcm5719-llvm-57093e88e013efeac744af18dc9deda113dd1417.zip | |
Make DynamicLibrary use ManagedStatic. This is pretty simple and should just work as
advertised - but it does have the caveat that calls to DynamicLibrary::AddSymbol will
"reset" if you shutdown llvm and try to come back for seconds. This is a subtle
behavior change, but I'm assuming that nobody is affected by it.
llvm-svn: 190946
Diffstat (limited to 'llvm/lib/Support/Windows/DynamicLibrary.inc')
| -rw-r--r-- | llvm/lib/Support/Windows/DynamicLibrary.inc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Support/Windows/DynamicLibrary.inc b/llvm/lib/Support/Windows/DynamicLibrary.inc index 83da82a949c..2edaf74fa56 100644 --- a/llvm/lib/Support/Windows/DynamicLibrary.inc +++ b/llvm/lib/Support/Windows/DynamicLibrary.inc @@ -71,7 +71,7 @@ extern "C" { DynamicLibrary DynamicLibrary::getPermanentLibrary(const char *filename, std::string *errMsg) { - SmartScopedLock<true> lock(getMutex()); + SmartScopedLock<true> lock(*SymbolsMutex); if (!filename) { // When no file is specified, enumerate all DLLs and EXEs in the process. @@ -114,10 +114,10 @@ DynamicLibrary DynamicLibrary::getPermanentLibrary(const char *filename, #undef EXPLICIT_SYMBOL2 void* DynamicLibrary::SearchForAddressOfSymbol(const char* symbolName) { - SmartScopedLock<true> Lock(getMutex()); + SmartScopedLock<true> Lock(*SymbolsMutex); // First check symbols added via AddSymbol(). - if (ExplicitSymbols) { + if (ExplicitSymbols.isConstructed()) { StringMap<void *>::iterator i = ExplicitSymbols->find(symbolName); if (i != ExplicitSymbols->end()) |

