diff options
author | Lang Hames <lhames@gmail.com> | 2024-12-16 16:54:17 +1100 |
---|---|---|
committer | Lang Hames <lhames@gmail.com> | 2024-12-16 16:56:33 +1100 |
commit | f420d26e9dd7ff6aed435f86e7d6768501a29741 (patch) | |
tree | bb2fd2d51598da5b4d02abcaf80f4a94c2344850 | |
parent | e4fb30205f1df5156328b234ff2a2866b7035fef (diff) | |
download | llvm-f420d26e9dd7ff6aed435f86e7d6768501a29741.zip llvm-f420d26e9dd7ff6aed435f86e7d6768501a29741.tar.gz llvm-f420d26e9dd7ff6aed435f86e7d6768501a29741.tar.bz2 |
[ORC] Make ObjectLinkingLayerJITLinkContext a private nested class.
This class is an implementation detail, so doesn't need a publicly accessible
name.
-rw-r--r-- | llvm/include/llvm/ExecutionEngine/Orc/ObjectLinkingLayer.h | 4 | ||||
-rw-r--r-- | llvm/lib/ExecutionEngine/Orc/ObjectLinkingLayer.cpp | 17 |
2 files changed, 8 insertions, 13 deletions
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/ObjectLinkingLayer.h b/llvm/include/llvm/ExecutionEngine/Orc/ObjectLinkingLayer.h index 6e0c46b..340298f 100644 --- a/llvm/include/llvm/ExecutionEngine/Orc/ObjectLinkingLayer.h +++ b/llvm/include/llvm/ExecutionEngine/Orc/ObjectLinkingLayer.h @@ -39,8 +39,6 @@ class Symbol; namespace orc { -class ObjectLinkingLayerJITLinkContext; - /// An ObjectLayer implementation built on JITLink. /// /// Clients can use this class to add relocatable object files to an @@ -48,7 +46,7 @@ class ObjectLinkingLayerJITLinkContext; /// a compiling layer like IRCompileLayer) for the rest of the JIT. class ObjectLinkingLayer : public RTTIExtends<ObjectLinkingLayer, ObjectLayer>, private ResourceManager { - friend class ObjectLinkingLayerJITLinkContext; + class JITLinkCtx; public: static char ID; diff --git a/llvm/lib/ExecutionEngine/Orc/ObjectLinkingLayer.cpp b/llvm/lib/ExecutionEngine/Orc/ObjectLinkingLayer.cpp index dd15499..4630e62 100644 --- a/llvm/lib/ExecutionEngine/Orc/ObjectLinkingLayer.cpp +++ b/llvm/lib/ExecutionEngine/Orc/ObjectLinkingLayer.cpp @@ -148,19 +148,18 @@ std::atomic<uint64_t> LinkGraphMaterializationUnit::Counter{0}; namespace llvm { namespace orc { -class ObjectLinkingLayerJITLinkContext final : public JITLinkContext { +class ObjectLinkingLayer::JITLinkCtx final : public JITLinkContext { public: - ObjectLinkingLayerJITLinkContext( - ObjectLinkingLayer &Layer, - std::unique_ptr<MaterializationResponsibility> MR, - std::unique_ptr<MemoryBuffer> ObjBuffer) + JITLinkCtx(ObjectLinkingLayer &Layer, + std::unique_ptr<MaterializationResponsibility> MR, + std::unique_ptr<MemoryBuffer> ObjBuffer) : JITLinkContext(&MR->getTargetJITDylib()), Layer(Layer), MR(std::move(MR)), ObjBuffer(std::move(ObjBuffer)) { std::lock_guard<std::mutex> Lock(Layer.LayerMutex); Plugins = Layer.Plugins; } - ~ObjectLinkingLayerJITLinkContext() { + ~JITLinkCtx() { // If there is an object buffer return function then use it to // return ownership of the buffer. if (Layer.ReturnObjectBuffer && ObjBuffer) @@ -624,8 +623,7 @@ void ObjectLinkingLayer::emit(std::unique_ptr<MaterializationResponsibility> R, assert(O && "Object must not be null"); MemoryBufferRef ObjBuffer = O->getMemBufferRef(); - auto Ctx = std::make_unique<ObjectLinkingLayerJITLinkContext>( - *this, std::move(R), std::move(O)); + auto Ctx = std::make_unique<JITLinkCtx>(*this, std::move(R), std::move(O)); if (auto G = createLinkGraphFromObject( ObjBuffer, getExecutionSession().getSymbolStringPool())) { Ctx->notifyMaterializing(**G); @@ -637,8 +635,7 @@ void ObjectLinkingLayer::emit(std::unique_ptr<MaterializationResponsibility> R, void ObjectLinkingLayer::emit(std::unique_ptr<MaterializationResponsibility> R, std::unique_ptr<LinkGraph> G) { - auto Ctx = std::make_unique<ObjectLinkingLayerJITLinkContext>( - *this, std::move(R), nullptr); + auto Ctx = std::make_unique<JITLinkCtx>(*this, std::move(R), nullptr); Ctx->notifyMaterializing(*G); link(std::move(G), std::move(Ctx)); } |