/src/wrappers/llvm/library/values/llvm_constant_fp.e

http://github.com/tybor/Liberty · Specman e · 46 lines · 19 code · 8 blank · 19 comment · 0 complexity · 554a008b7155873fe28ab23f09483fbd MD5 · raw file

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