diff options
author | Lang Hames <lhames@gmail.com> | 2018-09-28 22:03:17 +0000 |
---|---|---|
committer | Lang Hames <lhames@gmail.com> | 2018-09-28 22:03:17 +0000 |
commit | 2afc22ed9e099c27e727eb5189c248b9ea66ebc1 (patch) | |
tree | 7eeae3ca9816d8fb110bd13abcf88375528798a4 | |
parent | 91def5cc6a008ef16f8a858f872f1af885326527 (diff) | |
download | bcm5719-llvm-2afc22ed9e099c27e727eb5189c248b9ea66ebc1.tar.gz bcm5719-llvm-2afc22ed9e099c27e727eb5189c248b9ea66ebc1.zip |
[ORC] Make MaterializationResponsibility::getRequestedSymbols() const.
This makes it available for use in IRTransformLayer2::TransformFunction
instances (since a const MaterializationResponsibility& parameter was
added in r343365).
llvm-svn: 343367
-rw-r--r-- | llvm/include/llvm/ExecutionEngine/Orc/Core.h | 4 | ||||
-rw-r--r-- | llvm/lib/ExecutionEngine/Orc/Core.cpp | 7 |
2 files changed, 6 insertions, 5 deletions
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/Core.h b/llvm/include/llvm/ExecutionEngine/Orc/Core.h index 43bbd9ef319..b96b31a3e27 100644 --- a/llvm/include/llvm/ExecutionEngine/Orc/Core.h +++ b/llvm/include/llvm/ExecutionEngine/Orc/Core.h @@ -167,7 +167,7 @@ public: /// MaterializationResponsibility object that have queries pending. This /// information can be used to return responsibility for unrequested symbols /// back to the JITDylib via the delegate method. - SymbolNameSet getRequestedSymbols(); + SymbolNameSet getRequestedSymbols() const; /// Notifies the target JITDylib that the given symbols have been resolved. /// This will update the given symbols' addresses in the JITDylib, and notify @@ -623,7 +623,7 @@ private: void replace(std::unique_ptr<MaterializationUnit> MU); - SymbolNameSet getRequestedSymbols(const SymbolFlagsMap &SymbolFlags); + SymbolNameSet getRequestedSymbols(const SymbolFlagsMap &SymbolFlags) const; void addDependencies(const SymbolStringPtr &Name, const SymbolDependenceMap &Dependants); diff --git a/llvm/lib/ExecutionEngine/Orc/Core.cpp b/llvm/lib/ExecutionEngine/Orc/Core.cpp index 9cbc7792708..7d38c3262a4 100644 --- a/llvm/lib/ExecutionEngine/Orc/Core.cpp +++ b/llvm/lib/ExecutionEngine/Orc/Core.cpp @@ -367,7 +367,7 @@ MaterializationResponsibility::~MaterializationResponsibility() { "All symbols should have been explicitly materialized or failed"); } -SymbolNameSet MaterializationResponsibility::getRequestedSymbols() { +SymbolNameSet MaterializationResponsibility::getRequestedSymbols() const { return JD.getRequestedSymbols(SymbolFlags); } @@ -775,13 +775,14 @@ void JITDylib::replace(std::unique_ptr<MaterializationUnit> MU) { ES.dispatchMaterialization(*this, std::move(MustRunMU)); } -SymbolNameSet JITDylib::getRequestedSymbols(const SymbolFlagsMap &SymbolFlags) { +SymbolNameSet +JITDylib::getRequestedSymbols(const SymbolFlagsMap &SymbolFlags) const { return ES.runSessionLocked([&]() { SymbolNameSet RequestedSymbols; for (auto &KV : SymbolFlags) { assert(Symbols.count(KV.first) && "JITDylib does not cover this symbol?"); - assert(Symbols[KV.first].getFlags().isMaterializing() && + assert(Symbols.find(KV.first)->second.getFlags().isMaterializing() && "getRequestedSymbols can only be called for materializing " "symbols"); auto I = MaterializingInfos.find(KV.first); |