This will enable better error messages and debug logs in JITLink.
#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
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; }
failSymbols(FailedSymbolsWorklist);
ExecutionSession &ES;
- std::string JITDylibName;
std::mutex GeneratorsMutex;
bool Open = true;
SymbolTable Symbols;
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";
}
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});
}