Make module ownership methods on LLVMContext private, and make Module a friend

so that it can access them.  These are not intended to be externally accessible APIs.

llvm-svn: 113380
This commit is contained in:
Owen Anderson 2010-09-08 18:22:11 +00:00
parent 04ebde017f
commit c6a36a23e8
1 changed files with 8 additions and 5 deletions

View File

@ -33,11 +33,6 @@ class LLVMContext {
LLVMContext(LLVMContext&); LLVMContext(LLVMContext&);
void operator=(LLVMContext&); void operator=(LLVMContext&);
public:
LLVMContextImpl *const pImpl;
LLVMContext();
~LLVMContext();
/// addModule - Register a module as being instantiated in this context. If /// addModule - Register a module as being instantiated in this context. If
/// the context is deleted, the module will be deleted as well. /// the context is deleted, the module will be deleted as well.
void addModule(Module*); void addModule(Module*);
@ -45,6 +40,14 @@ public:
/// removeModule - Unregister a module from this context. /// removeModule - Unregister a module from this context.
void removeModule(Module*); 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 // Pinned metadata names, which always have the same value. This is a
// compile-time performance optimization, not a correctness optimization. // compile-time performance optimization, not a correctness optimization.
enum { enum {