Skip to content

Commit f420d26

Browse files
committed
[ORC] Make ObjectLinkingLayerJITLinkContext a private nested class.
This class is an implementation detail, so doesn't need a publicly accessible name.
1 parent e4fb302 commit f420d26

File tree

2 files changed

+8
-13
lines changed

2 files changed

+8
-13
lines changed

llvm/include/llvm/ExecutionEngine/Orc/ObjectLinkingLayer.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,14 @@ class Symbol;
3939

4040
namespace orc {
4141

42-
class ObjectLinkingLayerJITLinkContext;
43-
4442
/// An ObjectLayer implementation built on JITLink.
4543
///
4644
/// Clients can use this class to add relocatable object files to an
4745
/// ExecutionSession, and it typically serves as the base layer (underneath
4846
/// a compiling layer like IRCompileLayer) for the rest of the JIT.
4947
class ObjectLinkingLayer : public RTTIExtends<ObjectLinkingLayer, ObjectLayer>,
5048
private ResourceManager {
51-
friend class ObjectLinkingLayerJITLinkContext;
49+
class JITLinkCtx;
5250

5351
public:
5452
static char ID;

llvm/lib/ExecutionEngine/Orc/ObjectLinkingLayer.cpp

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -148,19 +148,18 @@ std::atomic<uint64_t> LinkGraphMaterializationUnit::Counter{0};
148148
namespace llvm {
149149
namespace orc {
150150

151-
class ObjectLinkingLayerJITLinkContext final : public JITLinkContext {
151+
class ObjectLinkingLayer::JITLinkCtx final : public JITLinkContext {
152152
public:
153-
ObjectLinkingLayerJITLinkContext(
154-
ObjectLinkingLayer &Layer,
155-
std::unique_ptr<MaterializationResponsibility> MR,
156-
std::unique_ptr<MemoryBuffer> ObjBuffer)
153+
JITLinkCtx(ObjectLinkingLayer &Layer,
154+
std::unique_ptr<MaterializationResponsibility> MR,
155+
std::unique_ptr<MemoryBuffer> ObjBuffer)
157156
: JITLinkContext(&MR->getTargetJITDylib()), Layer(Layer),
158157
MR(std::move(MR)), ObjBuffer(std::move(ObjBuffer)) {
159158
std::lock_guard<std::mutex> Lock(Layer.LayerMutex);
160159
Plugins = Layer.Plugins;
161160
}
162161

163-
~ObjectLinkingLayerJITLinkContext() {
162+
~JITLinkCtx() {
164163
// If there is an object buffer return function then use it to
165164
// return ownership of the buffer.
166165
if (Layer.ReturnObjectBuffer && ObjBuffer)
@@ -624,8 +623,7 @@ void ObjectLinkingLayer::emit(std::unique_ptr<MaterializationResponsibility> R,
624623
assert(O && "Object must not be null");
625624
MemoryBufferRef ObjBuffer = O->getMemBufferRef();
626625

627-
auto Ctx = std::make_unique<ObjectLinkingLayerJITLinkContext>(
628-
*this, std::move(R), std::move(O));
626+
auto Ctx = std::make_unique<JITLinkCtx>(*this, std::move(R), std::move(O));
629627
if (auto G = createLinkGraphFromObject(
630628
ObjBuffer, getExecutionSession().getSymbolStringPool())) {
631629
Ctx->notifyMaterializing(**G);
@@ -637,8 +635,7 @@ void ObjectLinkingLayer::emit(std::unique_ptr<MaterializationResponsibility> R,
637635

638636
void ObjectLinkingLayer::emit(std::unique_ptr<MaterializationResponsibility> R,
639637
std::unique_ptr<LinkGraph> G) {
640-
auto Ctx = std::make_unique<ObjectLinkingLayerJITLinkContext>(
641-
*this, std::move(R), nullptr);
638+
auto Ctx = std::make_unique<JITLinkCtx>(*this, std::move(R), nullptr);
642639
Ctx->notifyMaterializing(*G);
643640
link(std::move(G), std::move(Ctx));
644641
}

0 commit comments

Comments
 (0)