/src/wrappers/llvm/library/values/llvm_constant_fp.e
Specman e | 46 lines | 19 code | 8 blank | 19 comment | 0 complexity | 554a008b7155873fe28ab23f09483fbd MD5 | raw file
1class LLVM_CONSTANT_FP 2 -- A constant floating point. 3 4inherit LLVM_CONSTANT 5 6insert CORE_EXTERNALS 7 8create {ANY} from_real, from_string 9create {WRAPPER, WRAPPER_HANDLER} from_external_pointer 10 11feature {ANY} -- Creation 12 from_real (a_type: LLVM_REAL_TYPE; a_value: REAL_64) 13 -- Create a floating point constant of `a_type' with `a_value' 14 require a_type/=Void 15 do 16 handle := llvmconst_real(a_type.handle,a_value) 17 end 18 19 from_string (a_type: LLVM_REAL_TYPE; a_text: ABSTRACT_STRING) 20 -- Create a floating point constant of `a_type' parsing `a_text' 21 22 -- TODO: "llvmconst_real_of_string_and_size" may be better suited to Eiffel 23 require 24 a_type/=Void 25 a_text/=Void 26 do 27 handle := llvmconst_real_of_string(a_type.handle, a_text.to_external) 28 end 29end -- class LLVM_CONSTANT_FP 30-- Copyright (C) 2009-2017: Paolo Redaelli 31 32-- This file is part of LLVM wrappers for Liberty Eiffel. 33-- 34-- This library is free software: you can redistribute it and/or modify 35-- it under the terms of the GNU Lesser General Public License as published by 36-- the Free Software Foundation, version 3 of the License. 37-- 38-- Liberty Eiffel is distributed in the hope that it will be useful, 39-- but WITHOUT ANY WARRANTY; without even the implied warranty of 40-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 41-- GNU General Public License for more details. 42-- 43-- You should have received a copy of the GNU General Public License 44-- along with Liberty Eiffel. If not, see <http://www.gnu.org/licenses/>. 45-- 46