summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ExecutionEngine/Orc/ExecutionUtils.cpp
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2018-10-15 05:07:54 +0000
committerLang Hames <lhames@gmail.com>2018-10-15 05:07:54 +0000
commita5157d6f4bed542993ae83d7a7826146eed3e019 (patch)
tree881ca55e5c456ef6042268ac8f7d02825f74d0ae /llvm/lib/ExecutionEngine/Orc/ExecutionUtils.cpp
parent3c01508409d3e9a7e43950318b626e2bd1bf7e78 (diff)
downloadbcm5719-llvm-a5157d6f4bed542993ae83d7a7826146eed3e019.tar.gz
bcm5719-llvm-a5157d6f4bed542993ae83d7a7826146eed3e019.zip
[ORC] Simplify naming for JITDylib definition generators.
Renames: JITDylib's setFallbackDefinitionGenerator method to setGenerator. DynamicLibraryFallbackGenerator class to DynamicLibrarySearchGenerator. ReexportsFallbackDefinitionGenerator to ReexportsGenerator. llvm-svn: 344489
Diffstat (limited to 'llvm/lib/ExecutionEngine/Orc/ExecutionUtils.cpp')
-rw-r--r--llvm/lib/ExecutionEngine/Orc/ExecutionUtils.cpp20
1 files changed, 12 insertions, 8 deletions
diff --git a/llvm/lib/ExecutionEngine/Orc/ExecutionUtils.cpp b/llvm/lib/ExecutionEngine/Orc/ExecutionUtils.cpp
index 6a180106240..667237373ca 100644
--- a/llvm/lib/ExecutionEngine/Orc/ExecutionUtils.cpp
+++ b/llvm/lib/ExecutionEngine/Orc/ExecutionUtils.cpp
@@ -178,21 +178,22 @@ Error LocalCXXRuntimeOverrides2::enable(JITDylib &JD,
return JD.define(absoluteSymbols(std::move(RuntimeInterposes)));
}
-DynamicLibraryFallbackGenerator::DynamicLibraryFallbackGenerator(
+DynamicLibrarySearchGenerator::DynamicLibrarySearchGenerator(
sys::DynamicLibrary Dylib, const DataLayout &DL, SymbolPredicate Allow)
: Dylib(std::move(Dylib)), Allow(std::move(Allow)),
GlobalPrefix(DL.getGlobalPrefix()) {}
-Expected<DynamicLibraryFallbackGenerator> DynamicLibraryFallbackGenerator::Load(
- const char *FileName, const DataLayout &DL, SymbolPredicate Allow) {
+Expected<DynamicLibrarySearchGenerator>
+DynamicLibrarySearchGenerator::Load(const char *FileName, const DataLayout &DL,
+ SymbolPredicate Allow) {
std::string ErrMsg;
auto Lib = sys::DynamicLibrary::getPermanentLibrary(FileName, &ErrMsg);
if (!Lib.isValid())
return make_error<StringError>(std::move(ErrMsg), inconvertibleErrorCode());
- return DynamicLibraryFallbackGenerator(std::move(Lib), DL, std::move(Allow));
+ return DynamicLibrarySearchGenerator(std::move(Lib), DL, std::move(Allow));
}
-SymbolNameSet DynamicLibraryFallbackGenerator::
+SymbolNameSet DynamicLibrarySearchGenerator::
operator()(JITDylib &JD, const SymbolNameSet &Names) {
orc::SymbolNameSet Added;
orc::SymbolMap NewSymbols;
@@ -200,7 +201,10 @@ operator()(JITDylib &JD, const SymbolNameSet &Names) {
bool HasGlobalPrefix = (GlobalPrefix != '\0');
for (auto &Name : Names) {
- if (!Allow(Name) || (*Name).empty())
+ if ((*Name).empty())
+ continue;
+
+ if (Allow && !Allow(Name))
continue;
if (HasGlobalPrefix && (*Name).front() != GlobalPrefix)
@@ -215,8 +219,8 @@ operator()(JITDylib &JD, const SymbolNameSet &Names) {
}
}
- // Add any new symbols to JD. Since the fallback generator is only called for
- // symbols that are not already defined, this will never trigger a duplicate
+ // Add any new symbols to JD. Since the generator is only called for symbols
+ // that are not already defined, this will never trigger a duplicate
// definition error, so we can wrap this call in a 'cantFail'.
if (!NewSymbols.empty())
cantFail(JD.define(absoluteSymbols(std::move(NewSymbols))));
OpenPOWER on IntegriCloud