diff --git a/include/llvm/LLVMContext.h b/include/llvm/LLVMContext.h index 76492b7102e..fb89aa4bc6e 100644 --- a/include/llvm/LLVMContext.h +++ b/include/llvm/LLVMContext.h @@ -33,11 +33,6 @@ class LLVMContext { LLVMContext(LLVMContext&); void operator=(LLVMContext&); -public: - LLVMContextImpl *const pImpl; - LLVMContext(); - ~LLVMContext(); - /// addModule - Register a module as being instantiated in this context. If /// the context is deleted, the module will be deleted as well. void addModule(Module*); @@ -45,6 +40,14 @@ public: /// removeModule - Unregister a module from this context. void removeModule(Module*); + // Module needs access to the add/removeModule methods. + friend class Module; + +public: + LLVMContextImpl *const pImpl; + LLVMContext(); + ~LLVMContext(); + // Pinned metadata names, which always have the same value. This is a // compile-time performance optimization, not a correctness optimization. enum {