Interpreter.cpp (276479) | Interpreter.cpp (280031) |
---|---|
1//===- Interpreter.cpp - Top-Level LLVM Interpreter Implementation --------===// 2// 3// The LLVM Compiler Infrastructure 4// 5// This file is distributed under the University of Illinois Open Source 6// License. See LICENSE.TXT for details. 7// 8//===----------------------------------------------------------------------===// --- 16 unchanged lines hidden (view full) --- 25static struct RegisterInterp { 26 RegisterInterp() { Interpreter::Register(); } 27} InterpRegistrator; 28 29} 30 31extern "C" void LLVMLinkInInterpreter() { } 32 | 1//===- Interpreter.cpp - Top-Level LLVM Interpreter Implementation --------===// 2// 3// The LLVM Compiler Infrastructure 4// 5// This file is distributed under the University of Illinois Open Source 6// License. See LICENSE.TXT for details. 7// 8//===----------------------------------------------------------------------===// --- 16 unchanged lines hidden (view full) --- 25static struct RegisterInterp { 26 RegisterInterp() { Interpreter::Register(); } 27} InterpRegistrator; 28 29} 30 31extern "C" void LLVMLinkInInterpreter() { } 32 |
33/// create - Create a new interpreter object. This can never fail. | 33/// Create a new interpreter object. |
34/// | 34/// |
35ExecutionEngine *Interpreter::create(Module *M, std::string* ErrStr) { | 35ExecutionEngine *Interpreter::create(std::unique_ptr<Module> M, 36 std::string *ErrStr) { |
36 // Tell this Module to materialize everything and release the GVMaterializer. 37 if (std::error_code EC = M->materializeAllPermanently()) { 38 if (ErrStr) 39 *ErrStr = EC.message(); 40 // We got an error, just return 0 41 return nullptr; 42 } 43 | 37 // Tell this Module to materialize everything and release the GVMaterializer. 38 if (std::error_code EC = M->materializeAllPermanently()) { 39 if (ErrStr) 40 *ErrStr = EC.message(); 41 // We got an error, just return 0 42 return nullptr; 43 } 44 |
44 return new Interpreter(M); | 45 return new Interpreter(std::move(M)); |
45} 46 47//===----------------------------------------------------------------------===// 48// Interpreter ctor - Initialize stuff 49// | 46} 47 48//===----------------------------------------------------------------------===// 49// Interpreter ctor - Initialize stuff 50// |
50Interpreter::Interpreter(Module *M) 51 : ExecutionEngine(M), TD(M) { 52 | 51Interpreter::Interpreter(std::unique_ptr<Module> M) 52 : ExecutionEngine(std::move(M)), TD(Modules.back().get()) { 53 |
53 memset(&ExitValue.Untyped, 0, sizeof(ExitValue.Untyped)); 54 setDataLayout(&TD); 55 // Initialize the "backend" 56 initializeExecutionEngine(); 57 initializeExternalFunctions(); 58 emitGlobals(); 59 60 IL = new IntrinsicLowering(TD); --- 41 unchanged lines hidden --- | 54 memset(&ExitValue.Untyped, 0, sizeof(ExitValue.Untyped)); 55 setDataLayout(&TD); 56 // Initialize the "backend" 57 initializeExecutionEngine(); 58 initializeExternalFunctions(); 59 emitGlobals(); 60 61 IL = new IntrinsicLowering(TD); --- 41 unchanged lines hidden --- |