diff options
author | Lang Hames <lhames@gmail.com> | 2018-01-25 01:43:00 +0000 |
---|---|---|
committer | Lang Hames <lhames@gmail.com> | 2018-01-25 01:43:00 +0000 |
commit | c8a74a04489f9cb8d3c40a0455a88b8900185e9e (patch) | |
tree | 6d89cca4b92ec7d5f972a6b1f7de3c4295297d26 /llvm/lib/ExecutionEngine | |
parent | a674a8fd1e1a9db00bb0d43b656b17cf3615601c (diff) | |
download | bcm5719-llvm-c8a74a04489f9cb8d3c40a0455a88b8900185e9e.tar.gz bcm5719-llvm-c8a74a04489f9cb8d3c40a0455a88b8900185e9e.zip |
[ORC] Refactor the various lookupFlags methods to return the flags map via the
first argument.
This makes lookupFlags more consistent with lookup (which takes the query as the
first argument) and composes better in practice, since lookups are usually
linearly chained: Each lookupFlags can populate the result map based on the
symbols not found in the previous lookup. (If the maps were returned rather than
passed by reference there would have to be a merge step at the end).
llvm-svn: 323398
Diffstat (limited to 'llvm/lib/ExecutionEngine')
-rw-r--r-- | llvm/lib/ExecutionEngine/Orc/Core.cpp | 7 | ||||
-rw-r--r-- | llvm/lib/ExecutionEngine/Orc/Legacy.cpp | 4 |
2 files changed, 6 insertions, 5 deletions
diff --git a/llvm/lib/ExecutionEngine/Orc/Core.cpp b/llvm/lib/ExecutionEngine/Orc/Core.cpp index ff78ba19939..886bd7e7915 100644 --- a/llvm/lib/ExecutionEngine/Orc/Core.cpp +++ b/llvm/lib/ExecutionEngine/Orc/Core.cpp @@ -288,8 +288,7 @@ void VSO::finalize(SymbolNameSet SymbolsToFinalize) { } } -LookupFlagsResult VSO::lookupFlags(SymbolNameSet Names) { - SymbolFlagsMap FlagsFound; +SymbolNameSet VSO::lookupFlags(SymbolFlagsMap &Flags, SymbolNameSet Names) { for (SymbolNameSet::iterator I = Names.begin(), E = Names.end(); I != E;) { auto Tmp = I++; @@ -301,11 +300,11 @@ LookupFlagsResult VSO::lookupFlags(SymbolNameSet Names) { Names.erase(Tmp); - FlagsFound[SymI->first] = + Flags[SymI->first] = JITSymbolFlags::stripTransientFlags(SymI->second.getFlags()); } - return {std::move(FlagsFound), std::move(Names)}; + return Names; } VSO::LookupResult VSO::lookup(AsynchronousSymbolQuery &Query, diff --git a/llvm/lib/ExecutionEngine/Orc/Legacy.cpp b/llvm/lib/ExecutionEngine/Orc/Legacy.cpp index e4eba8bd756..7a11b94c7cf 100644 --- a/llvm/lib/ExecutionEngine/Orc/Legacy.cpp +++ b/llvm/lib/ExecutionEngine/Orc/Legacy.cpp @@ -62,8 +62,10 @@ JITSymbolResolverAdapter::lookupFlags(const LookupSet &Symbols) { for (auto &S : Symbols) InternedSymbols.insert(ES.getSymbolStringPool().intern(S)); + SymbolFlagsMap SymbolFlags; + R.lookupFlags(SymbolFlags, InternedSymbols); LookupFlagsResult Result; - for (auto &KV : R.lookupFlags(InternedSymbols).SymbolFlags) { + for (auto &KV : SymbolFlags) { ResolvedStrings.insert(KV.first); Result[*KV.first] = KV.second; } |