[llvm] 43f5f69 - [ORC][JITLink] Move JITDylib name into JITLinkDylib base class.
Lang Hames via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 19 20:55:12 PST 2021
Author: Lang Hames
Date: 2021-11-19T20:54:28-08:00
New Revision: 43f5f6916f0e2b0095a943eb19d06dfb8e13c727
URL: https://github.com/llvm/llvm-project/commit/43f5f6916f0e2b0095a943eb19d06dfb8e13c727
DIFF: https://github.com/llvm/llvm-project/commit/43f5f6916f0e2b0095a943eb19d06dfb8e13c727.diff
LOG: [ORC][JITLink] Move JITDylib name into JITLinkDylib base class.
This will enable better error messages and debug logs in JITLink.
Added:
Modified:
llvm/include/llvm/ExecutionEngine/JITLink/JITLinkDylib.h
llvm/include/llvm/ExecutionEngine/Orc/Core.h
llvm/lib/ExecutionEngine/Orc/Core.cpp
Removed:
################################################################################
diff --git a/llvm/include/llvm/ExecutionEngine/JITLink/JITLinkDylib.h b/llvm/include/llvm/ExecutionEngine/JITLink/JITLinkDylib.h
index 2aa88cb500748..6bb1b5a285b16 100644
--- a/llvm/include/llvm/ExecutionEngine/JITLink/JITLinkDylib.h
+++ b/llvm/include/llvm/ExecutionEngine/JITLink/JITLinkDylib.h
@@ -13,10 +13,21 @@
#ifndef LLVM_EXECUTIONENGINE_JITLINK_JITLINKDYLIB_H
#define LLVM_EXECUTIONENGINE_JITLINK_JITLINKDYLIB_H
+#include <string>
+
namespace llvm {
namespace jitlink {
-class JITLinkDylib {};
+class JITLinkDylib {
+public:
+ JITLinkDylib(std::string Name) : Name(std::move(Name)) {}
+
+ /// Get the name for this JITLinkDylib.
+ const std::string &getName() const { return Name; }
+
+private:
+ std::string Name;
+};
} // end namespace jitlink
} // end namespace llvm
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/Core.h b/llvm/include/llvm/ExecutionEngine/Orc/Core.h
index 5cac65b49a058..70256c12ea173 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/Core.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/Core.h
@@ -935,9 +935,6 @@ class JITDylib : public ThreadSafeRefCountedBase<JITDylib>,
JITDylib(JITDylib &&) = delete;
JITDylib &operator=(JITDylib &&) = delete;
- /// Get the name for this JITDylib.
- const std::string &getName() const { return JITDylibName; }
-
/// Get a reference to the ExecutionSession for this JITDylib.
ExecutionSession &getExecutionSession() const { return ES; }
@@ -1200,7 +1197,6 @@ class JITDylib : public ThreadSafeRefCountedBase<JITDylib>,
failSymbols(FailedSymbolsWorklist);
ExecutionSession &ES;
- std::string JITDylibName;
std::mutex GeneratorsMutex;
bool Open = true;
SymbolTable Symbols;
diff --git a/llvm/lib/ExecutionEngine/Orc/Core.cpp b/llvm/lib/ExecutionEngine/Orc/Core.cpp
index 64e5090e4c533..6b24d6461b637 100644
--- a/llvm/lib/ExecutionEngine/Orc/Core.cpp
+++ b/llvm/lib/ExecutionEngine/Orc/Core.cpp
@@ -1364,7 +1364,7 @@ Error JITDylib::remove(const SymbolNameSet &Names) {
void JITDylib::dump(raw_ostream &OS) {
ES.runSessionLocked([&, this]() {
- OS << "JITDylib \"" << JITDylibName << "\" (ES: "
+ OS << "JITDylib \"" << getName() << "\" (ES: "
<< format("0x%016" PRIx64, reinterpret_cast<uintptr_t>(&ES)) << "):\n"
<< "Link order: " << LinkOrder << "\n"
<< "Symbol table:\n";
@@ -1450,7 +1450,7 @@ JITDylib::MaterializingInfo::takeQueriesMeeting(SymbolState RequiredState) {
}
JITDylib::JITDylib(ExecutionSession &ES, std::string Name)
- : ES(ES), JITDylibName(std::move(Name)) {
+ : JITLinkDylib(std::move(Name)), ES(ES) {
LinkOrder.push_back({this, JITDylibLookupFlags::MatchAllSymbols});
}
More information about the llvm-commits
mailing list