/src/wrappers/llvm/library/llvm_module_provider.e
Specman e | 64 lines | 37 code | 9 blank | 18 comment | 0 complexity | 9b2f2afd1a4134e60a97a093f3f1a57a MD5 | raw file
1class LLVM_MODULE_PROVIDER 2 -- An helper class providing a module to JIT or interpreter. 3 4inherit 5 C_STRUCT 6 EIFFEL_OWNED 7 redefine 8 dispose 9 end 10 11insert CORE_EXTERNALS 12 13create {ANY} from_module 14create {WRAPPER} from_external_pointer 15feature {ANY} 16 module: LLVM_MODULE 17 -- The module owned by Current provider 18feature {} -- Creation 19 from_module (a_module: LLVM_MODULE) 20 -- Encapsulates `a_module' in a new module provider, taking ownership of the module. 21 require 22 a_module/=Void 23 not a_module.is_owned 24 do 25 module:=a_module 26 module.set_owner(Current) 27 from_external_pointer(llvmcreate_module_provider_for_existing_module(a_module.handle)) 28 ensure 29 a_module.is_owned 30 a_module.owner = Current 31 module = a_module 32 end 33 34feature {} -- Disposing 35 dispose 36 -- Destroys the module provider MP as well as the contained module. See the destructor llvm::ModuleProvider::~ModuleProvider. 37 38 -- 39 do 40 llvmdispose_module_provider(handle) 41 end 42feature {ANY} 43 struct_size: like size_t 44 do 45 not_yet_implemented 46 end 47end -- class LLVM_MODULE_PROVIDER 48 49-- Copyright (C) 2010-2017: Paolo Redaelli 50 51-- This library is free software; you can redistribute it and/or 52-- modify it under the terms of the GNU Lesser General Public License 53-- as published by the Free Software Foundation; either version 2.1 of 54-- the License, or (at your option) any later version. 55 56-- This library is distributed in the hope that it will be useful, but 57-- WITHOUT ANY WARRANTY; without even the implied warranty of 58-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 59-- Lesser General Public License for more details. 60 61-- You should have received a copy of the GNU Lesser General Public 62-- License along with this library; if not, write to the Free Software 63-- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 64-- 02110-1301 USA