Make it explicit that ExecutionEngine takes ownership of the modules.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215967 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola
2014-08-19 04:04:25 +00:00
parent 4d48c3f2a4
commit 3f4ed32b43
27 changed files with 242 additions and 223 deletions

View File

@@ -94,7 +94,7 @@ class Interpreter : public ExecutionEngine, public InstVisitor<Interpreter> {
std::vector<Function*> AtExitHandlers;
public:
explicit Interpreter(Module *M);
explicit Interpreter(std::unique_ptr<Module> M);
~Interpreter();
/// runAtExitHandlers - Run any functions registered by the program's calls to
@@ -105,10 +105,11 @@ public:
static void Register() {
InterpCtor = create;
}
/// create - Create an interpreter ExecutionEngine. This can never fail.
/// Create an interpreter ExecutionEngine.
///
static ExecutionEngine *create(Module *M, std::string *ErrorStr = nullptr);
static ExecutionEngine *create(std::unique_ptr<Module> M,
std::string *ErrorStr = nullptr);
/// run - Start execution with the specified function and arguments.
///