Browse files

Many more instructions.

  • Loading branch information...
1 parent 0edb3bf commit 4abbabb4ffb3600b74a1b3b36822dbe969ec4003 @clemahieu clemahieu committed Jul 4, 2010
View
4 eiffel_llvm.ecf
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-6-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-6-0 http://www.eiffel.com/developers/xml/configuration-1-6-0.xsd" name="eiffel_llvm" uuid="2EEC0A09-FC0F-493E-B2F9-78DAC4DF495C" library_target="eiffel_llvm">
<target name="eiffel_llvm">
- <root class="APPLICATION" feature="make"/>
+ <root all_classes="true"/>
<option warning="true" syntax="provisional">
<assertions precondition="true" postcondition="true" check="true" invariant="true" loop="true" supplier_precondition="true"/>
</option>
@@ -83,9 +83,9 @@
<cluster name="eiffel_llvm" location=".\" recursive="true">
<file_rule>
<exclude>/EIFGENs$</exclude>
- <exclude>/testing</exclude>
<exclude>/CVS$</exclude>
<exclude>/.svn$</exclude>
+ <exclude>/testing</exclude>
<exclude>/.git$</exclude>
</file_rule>
</cluster>
View
50 instructions/bit_cast_inst.e
@@ -0,0 +1,50 @@
+note
+ description: "Summary description for {BITCAST_INST}."
+ author: ""
+ date: "$Date$"
+ revision: "$Revision$"
+
+class
+ BIT_CAST_INST
+
+inherit
+ CAST_INST
+
+create
+
+ make,
+ make_name
+
+feature {NONE}
+
+ make (s: VALUE; ty: VALUE)
+ do
+ item := make_external (s.item, ty.item)
+ end
+
+ make_name (s: VALUE; ty: VALUE; name: TWINE)
+ do
+ item := make_name_external (s.item, ty.item, name.item)
+ end
+
+feature {NONE} -- Externals
+
+ make_external (s: POINTER; ty: POINTER): POINTER
+ external
+ "C++ inline use %"llvm/Instructions.h%""
+ alias
+ "[
+ return new llvm::BitCastInst ((llvm::Value *)$s, (llvm::Value *)$ty);
+ ]"
+ end
+
+ make_name_external (s: POINTER; ty: POINTER; name: POINTER): POINTER
+ external
+ "C++ inline use %"llvm/Instructions.h%""
+ alias
+ "[
+ return new llvm::BitCastInst ((llvm::Value *)$s, (llvm::Value *)$ty, *((llvm::Twine *)$name));
+ ]"
+ end
+
+end
View
13 instructions/cast_inst.e
@@ -0,0 +1,13 @@
+note
+ description: "Summary description for {CAST_INST}."
+ author: ""
+ date: "$Date$"
+ revision: "$Revision$"
+
+class
+ CAST_INST
+
+inherit
+ UNARY_INSTRUCTION
+
+end
View
13 instructions/cmp_inst.e
@@ -0,0 +1,13 @@
+note
+ description: "Summary description for {CMP_INST}."
+ author: ""
+ date: "$Date$"
+ revision: "$Revision$"
+
+class
+ CMP_INST
+
+inherit
+ INSTRUCTION
+
+end
View
87 instructions/extract_value_inst.e
@@ -0,0 +1,87 @@
+note
+ description: "Summary description for {EXTRACT_VALUE_INST}."
+ author: ""
+ date: "$Date$"
+ revision: "$Revision$"
+
+class
+ EXTRACT_VALUE_INST
+
+inherit
+ UNARY_INSTRUCTION
+
+create
+
+ make,
+ make_name,
+ make_list,
+ make_list_name
+
+feature {NONE}
+
+ make (agg: VALUE; idx: NATURAL_32)
+ do
+ item := make_external (agg.item, idx)
+ end
+
+ make_name (agg: VALUE; idx: NATURAL_32; name: TWINE)
+ do
+ item := make_name_external (agg.item, idx, name.item)
+ end
+
+ make_list (agg: VALUE; idx: LIST [NATURAL_32])
+ local
+ idx_vector: UNSIGNED_VECTOR
+ do
+ create idx_vector.make
+ across idx as idx_item loop idx_vector.push_back (idx_item.item) end
+ item := make_list_external (agg.item, idx_vector.item)
+ end
+
+ make_list_name (agg: VALUE; idx: LIST [NATURAL_32]; name: TWINE)
+ local
+ idx_vector: UNSIGNED_VECTOR
+ do
+ create idx_vector.make
+ across idx as idx_item loop idx_vector.push_back (idx_item.item) end
+ item := make_list_name_external (agg.item, idx_vector.item, name.item)
+ end
+
+feature {NONE} -- Externals
+
+ make_external (agg: POINTER; idx: NATURAL_32): POINTER
+ external
+ "C++ inline use %"llvm/Instructions.h%""
+ alias
+ "[
+ return llvm::ExtractValueInst::Create ((llvm::Value *)$agg, $idx);
+ ]"
+ end
+
+ make_name_external (agg: POINTER; idx: NATURAL_32; name: POINTER): POINTER
+ external
+ "C++ inline use %"llvm/Instructions.h%""
+ alias
+ "[
+ return llvm::ExtractValueInst::Create ((llvm::Value *)$agg, $idx, *((llvm::Twine *)$name));
+ ]"
+ end
+
+ make_list_external (agg: POINTER; idx: POINTER): POINTER
+ external
+ "C++ inline use %"llvm/Instructions.h%""
+ alias
+ "[
+ return llvm::ExtractValueInst::Create ((llvm::Value *)$agg, ((std::vector <unsigned> *)$idx)->begin (), ((std::vector <unsigned> *)$idx)->end ());
+ ]"
+ end
+
+ make_list_name_external (agg: POINTER; idx: POINTER; name: POINTER): POINTER
+ external
+ "C++ inline use %"llvm/Instructions.h%""
+ alias
+ "[
+ return llvm::ExtractValueInst::Create ((llvm::Value *)$agg, ((std::vector <unsigned> *)$idx)->begin (), ((std::vector <unsigned> *)$idx)->end (), *((llvm::Twine *)$name));
+ ]"
+ end
+end
View
50 instructions/fcmp_inst.e
@@ -0,0 +1,50 @@
+note
+ description: "Summary description for {FCMP_INST}."
+ author: ""
+ date: "$Date$"
+ revision: "$Revision$"
+
+class
+ FCMP_INST
+
+inherit
+ CMP_INST
+
+create
+
+ make,
+ make_name
+
+feature {NONE}
+
+ make (pred: INTEGER_32; lhs: VALUE; rhs: VALUE)
+ do
+ item := make_external (pred, lhs.item, rhs.item)
+ end
+
+ make_name (pred: INTEGER_32; lhs: VALUE; rhs: VALUE; name: TWINE)
+ do
+ item := make_name_external (pred, lhs.item, rhs.item, name.item)
+ end
+
+feature {NONE} -- External
+
+ make_external (pred: INTEGER_32; lhs: POINTER; rhs: POINTER): POINTER
+ external
+ "C++ inline use %"llvm/Instructions.h%""
+ alias
+ "[
+ return new llvm::FCmpInst ((llvm::CmpInst::Predicate)$pred, (llvm::Value *)$lhs, (llvm::Value *)$rhs);
+ ]"
+ end
+
+ make_name_external (pred: INTEGER_32; lhs: POINTER; rhs: POINTER; name: POINTER): POINTER
+ external
+ "C++ inline use %"llvm/Instructions.h%""
+ alias
+ "[
+ return new llvm::FCmpInst ((llvm::CmpInst::Predicate)$pred, (llvm::Value *)$lhs, (llvm::Value *)$rhs, *((llvm:Twine *)$name));
+ ]"
+ end
+
+end
View
50 instructions/fp_ext_inst.e
@@ -0,0 +1,50 @@
+note
+ description: "Summary description for {FP_EXT_INST}."
+ author: ""
+ date: "$Date$"
+ revision: "$Revision$"
+
+class
+ FP_EXT_INST
+
+inherit
+ CAST_INST
+
+create
+
+ make,
+ make_name
+
+feature {NONE}
+
+ make (s: VALUE; ty: VALUE)
+ do
+ item := make_external (s.item, ty.item)
+ end
+
+ make_name (s: VALUE; ty: VALUE; name: TWINE)
+ do
+ item := make_name_external (s.item, ty.item, name.item)
+ end
+
+feature {NONE} -- Externals
+
+ make_external (s: POINTER; ty: POINTER): POINTER
+ external
+ "C++ inline use %"llvm/Instructions.h%""
+ alias
+ "[
+ return new llvm::FPExtInst ((llvm::Value *)$s, (llvm::Value *)$ty);
+ ]"
+ end
+
+ make_name_external (s: POINTER; ty: POINTER; name: POINTER): POINTER
+ external
+ "C++ inline use %"llvm/Instructions.h%""
+ alias
+ "[
+ return new llvm::FPExtInst ((llvm::Value *)$s, (llvm::Value *)$ty, *((llvm::Twine *)$name));
+ ]"
+ end
+
+end
View
50 instructions/fp_to_si_inst.e
@@ -0,0 +1,50 @@
+note
+ description: "Summary description for {FP_TO_SI_INST}."
+ author: ""
+ date: "$Date$"
+ revision: "$Revision$"
+
+class
+ FP_TO_SI_INST
+
+inherit
+ CAST_INST
+
+create
+
+ make,
+ make_name
+
+feature {NONE}
+
+ make (s: VALUE; ty: VALUE)
+ do
+ item := make_external (s.item, ty.item)
+ end
+
+ make_name (s: VALUE; ty: VALUE; name: TWINE)
+ do
+ item := make_name_external (s.item, ty.item, name.item)
+ end
+
+feature {NONE} -- Externals
+
+ make_external (s: POINTER; ty: POINTER): POINTER
+ external
+ "C++ inline use %"llvm/Instructions.h%""
+ alias
+ "[
+ return new llvm::FPToSIInst ((llvm::Value *)$s, (llvm::Value *)$ty);
+ ]"
+ end
+
+ make_name_external (s: POINTER; ty: POINTER; name: POINTER): POINTER
+ external
+ "C++ inline use %"llvm/Instructions.h%""
+ alias
+ "[
+ return new llvm::FPToSIInst ((llvm::Value *)$s, (llvm::Value *)$ty, *((llvm::Twine *)$name));
+ ]"
+ end
+
+end
View
50 instructions/fp_to_ui_inst.e
@@ -0,0 +1,50 @@
+note
+ description: "Summary description for {FP_TO_UI_INST}."
+ author: ""
+ date: "$Date$"
+ revision: "$Revision$"
+
+class
+ FP_TO_UI_INST
+
+inherit
+ CAST_INST
+
+create
+
+ make,
+ make_name
+
+feature {NONE}
+
+ make (s: VALUE; ty: VALUE)
+ do
+ item := make_external (s.item, ty.item)
+ end
+
+ make_name (s: VALUE; ty: VALUE; name: TWINE)
+ do
+ item := make_name_external (s.item, ty.item, name.item)
+ end
+
+feature {NONE} -- Externals
+
+ make_external (s: POINTER; ty: POINTER): POINTER
+ external
+ "C++ inline use %"llvm/Instructions.h%""
+ alias
+ "[
+ return new llvm::FPToUIInst ((llvm::Value *)$s, (llvm::Value *)$ty);
+ ]"
+ end
+
+ make_name_external (s: POINTER; ty: POINTER; name: POINTER): POINTER
+ external
+ "C++ inline use %"llvm/Instructions.h%""
+ alias
+ "[
+ return new llvm::FPToUIInst ((llvm::Value *)$s, (llvm::Value *)$ty, *((llvm::Twine *)$name));
+ ]"
+ end
+
+end
View
50 instructions/fp_trunc_inst.e
@@ -0,0 +1,50 @@
+note
+ description: "Summary description for {FP_TRUNC_INST}."
+ author: ""
+ date: "$Date$"
+ revision: "$Revision$"
+
+class
+ FP_TRUNC_INST
+
+inherit
+ CAST_INST
+
+create
+
+ make,
+ make_name
+
+feature {NONE}
+
+ make (s: VALUE; ty: VALUE)
+ do
+ item := make_external (s.item, ty.item)
+ end
+
+ make_name (s: VALUE; ty: VALUE; name: TWINE)
+ do
+ item := make_name_external (s.item, ty.item, name.item)
+ end
+
+feature {NONE} -- Externals
+
+ make_external (s: POINTER; ty: POINTER): POINTER
+ external
+ "C++ inline use %"llvm/Instructions.h%""
+ alias
+ "[
+ return new llvm::FPTruncInst ((llvm::Value *)$s, (llvm::Value *)$ty);
+ ]"
+ end
+
+ make_name_external (s: POINTER; ty: POINTER; name: POINTER): POINTER
+ external
+ "C++ inline use %"llvm/Instructions.h%""
+ alias
+ "[
+ return new llvm::FPTruncInst ((llvm::Value *)$s, (llvm::Value *)$ty, *((llvm::Twine *)$name));
+ ]"
+ end
+
+end
View
49 instructions/icmp_inst.e
@@ -0,0 +1,49 @@
+note
+ description: "Summary description for {ICMP_INST}."
+ author: ""
+ date: "$Date$"
+ revision: "$Revision$"
+
+class
+ ICMP_INST
+
+inherit
+ CMP_INST
+
+create
+
+ make,
+ make_name
+
+feature {NONE}
+
+ make (pred: INTEGER_32; lhs: VALUE; rhs: VALUE)
+ do
+ item := make_external (pred, lhs.item, rhs.item)
+ end
+
+ make_name (pred: INTEGER_32; lhs: VALUE; rhs: VALUE; name: TWINE)
+ do
+ item := make_name_external (pred, lhs.item, rhs.item, name.item)
+ end
+
+feature {NONE} -- External
+
+ make_external (pred: INTEGER_32; lhs: POINTER; rhs: POINTER): POINTER
+ external
+ "C++ inline use %"llvm/Instructions.h%""
+ alias
+ "[
+ return new llvm::ICmpInst ((llvm::CmpInst::Predicate)$pred, (llvm::Value *)$lhs, (llvm::Value *)$rhs);
+ ]"
+ end
+
+ make_name_external (pred: INTEGER_32; lhs: POINTER; rhs: POINTER; name: POINTER): POINTER
+ external
+ "C++ inline use %"llvm/Instructions.h%""
+ alias
+ "[
+ return new llvm::ICmpInst ((llvm::CmpInst::Predicate)$pred, (llvm::Value *)$lhs, (llvm::Value *)$rhs, *((llvm:Twine *)$name));
+ ]"
+ end
+end
View
87 instructions/insert_value_inst.e
@@ -0,0 +1,87 @@
+note
+ description: "Summary description for {INSERT_VALUE_INST}."
+ author: ""
+ date: "$Date$"
+ revision: "$Revision$"
+
+class
+ INSERT_VALUE_INST
+
+inherit
+ INSTRUCTION
+
+create
+
+ make,
+ make_name,
+ make_list,
+ make_list_name
+
+feature {NONE}
+
+ make (agg: VALUE; val: VALUE; idx: NATURAL_32)
+ do
+ item := make_external (agg.item, val.item, idx)
+ end
+
+ make_name (agg: VALUE; val: VALUE; idx: NATURAL_32; name: TWINE)
+ do
+ item := make_name_external (agg.item, val.item, idx, name.item)
+ end
+
+ make_list (agg: VALUE; idx: LIST [NATURAL_32]; val: VALUE)
+ local
+ idx_vector: UNSIGNED_VECTOR
+ do
+ create idx_vector.make
+ across idx as idx_item loop idx_vector.push_back (idx_item.item) end
+ item := make_list_external (agg.item, val.item, idx_vector.item)
+ end
+
+ make_list_name (agg: VALUE; idx: LIST [NATURAL_32]; val: VALUE; name: TWINE)
+ local
+ idx_vector: UNSIGNED_VECTOR
+ do
+ create idx_vector.make
+ across idx as idx_item loop idx_vector.push_back (idx_item.item) end
+ item := make_list_name_external (agg.item, val.item, idx_vector.item, name.item)
+ end
+
+feature {NONE} -- Externals
+
+ make_external (agg: POINTER; val: POINTER; idx: NATURAL_32): POINTER
+ external
+ "C++ inline use %"llvm/Instructions.h%""
+ alias
+ "[
+ return llvm::InsertValueInst::Create ((llvm::Value *)$agg, (llvm::Value *)$val, $idx);
+ ]"
+ end
+
+ make_name_external (agg: POINTER; val: POINTER; idx: NATURAL_32; name: POINTER): POINTER
+ external
+ "C++ inline use %"llvm/Instructions.h%""
+ alias
+ "[
+ return llvm::InsertValueInst::Create ((llvm::Value *)$agg, (llvm::Value *)$val, $idx, *((llvm::Twine *)$name));
+ ]"
+ end
+
+ make_list_external (agg: POINTER; val: POINTER; idx: POINTER): POINTER
+ external
+ "C++ inline use %"llvm/Instructions.h%""
+ alias
+ "[
+ return llvm::InsertValueInst::Create ((llvm::Value *)$agg, (llvm::Value *)$val, ((std::vector <unsigned> *)$idx)->begin (), ((std::vector <unsigned> *)$idx)->end ());
+ ]"
+ end
+
+ make_list_name_external (agg: POINTER; val: POINTER; idx: POINTER; name: POINTER): POINTER
+ external
+ "C++ inline use %"llvm/Instructions.h%""
+ alias
+ "[
+ return llvm::InsertValueInst::Create ((llvm::Value *)$agg, (llvm::Value *)$val, ((std::vector <unsigned> *)$idx)->begin (), ((std::vector <unsigned> *)$idx)->end (), *((llvm::Twine *)$name));
+ ]"
+ end
+end
View
50 instructions/int_to_ptr_inst.e
@@ -0,0 +1,50 @@
+note
+ description: "Summary description for {INT_TO_PTR_INST}."
+ author: ""
+ date: "$Date$"
+ revision: "$Revision$"
+
+class
+ INT_TO_PTR_INST
+
+inherit
+ CAST_INST
+
+create
+
+ make,
+ make_name
+
+feature {NONE}
+
+ make (s: VALUE; ty: VALUE)
+ do
+ item := make_external (s.item, ty.item)
+ end
+
+ make_name (s: VALUE; ty: VALUE; name: TWINE)
+ do
+ item := make_name_external (s.item, ty.item, name.item)
+ end
+
+feature {NONE} -- Externals
+
+ make_external (s: POINTER; ty: POINTER): POINTER
+ external
+ "C++ inline use %"llvm/Instructions.h%""
+ alias
+ "[
+ return new llvm::IntToPtrInst ((llvm::Value *)$s, (llvm::Value *)$ty);
+ ]"
+ end
+
+ make_name_external (s: POINTER; ty: POINTER; name: POINTER): POINTER
+ external
+ "C++ inline use %"llvm/Instructions.h%""
+ alias
+ "[
+ return new llvm::IntToPtrInst ((llvm::Value *)$s, (llvm::Value *)$ty, *((llvm::Twine *)$name));
+ ]"
+ end
+
+end
View
27 instructions/intrinsic_inst.e
@@ -0,0 +1,27 @@
+note
+ description: "Summary description for {INTRINSIC_INST}."
+ author: ""
+ date: "$Date$"
+ revision: "$Revision$"
+
+class
+ INTRINSIC_INST
+
+inherit
+ CALL_INST
+ rename
+ make_external as make_external_call
+ end
+
+feature {NONE} -- Externals
+
+ make_external (m: POINTER; id: NATURAL_32; tys: POINTER; num_tys: NATURAL_32): POINTER
+ external
+ "C++ inline use %"llvm/IntrinsicInst.h%""
+ alias
+ "[
+ return llvm::Intrinsic::getDeclaration ((llvm::Module *)$m, $id, $tys, $num_tys)
+ ]"
+ end
+
+end
View
13 instructions/mem_intrinsic.e
@@ -0,0 +1,13 @@
+note
+ description: "Summary description for {MEM_INTRINSIC}."
+ author: ""
+ date: "$Date$"
+ revision: "$Revision$"
+
+class
+ MEM_INTRINSIC
+
+inherit
+ INTRINSIC_INST
+
+end
View
50 instructions/ptr_to_int_inst.e
@@ -0,0 +1,50 @@
+note
+ description: "Summary description for {PTR_TO_INT_INST}."
+ author: ""
+ date: "$Date$"
+ revision: "$Revision$"
+
+class
+ PTR_TO_INT_INST
+
+inherit
+ CAST_INST
+
+create
+
+ make,
+ make_name
+
+feature {NONE}
+
+ make (s: VALUE; ty: VALUE)
+ do
+ item := make_external (s.item, ty.item)
+ end
+
+ make_name (s: VALUE; ty: VALUE; name: TWINE)
+ do
+ item := make_name_external (s.item, ty.item, name.item)
+ end
+
+feature {NONE} -- Externals
+
+ make_external (s: POINTER; ty: POINTER): POINTER
+ external
+ "C++ inline use %"llvm/Instructions.h%""
+ alias
+ "[
+ return new llvm::PtrToIntInst ((llvm::Value *)$s, (llvm::Value *)$ty);
+ ]"
+ end
+
+ make_name_external (s: POINTER; ty: POINTER; name: POINTER): POINTER
+ external
+ "C++ inline use %"llvm/Instructions.h%""
+ alias
+ "[
+ return new llvm::PtrToIntInst ((llvm::Value *)$s, (llvm::Value *)$ty, *((llvm::Twine *)$name));
+ ]"
+ end
+
+end
View
50 instructions/s_ext_inst.e
@@ -0,0 +1,50 @@
+note
+ description: "Summary description for {S_EXT_INST}."
+ author: ""
+ date: "$Date$"
+ revision: "$Revision$"
+
+class
+ S_EXT_INST
+
+inherit
+ CAST_INST
+
+create
+
+ make,
+ make_name
+
+feature {NONE}
+
+ make (s: VALUE; ty: VALUE)
+ do
+ item := make_external (s.item, ty.item)
+ end
+
+ make_name (s: VALUE; ty: VALUE; name: TWINE)
+ do
+ item := make_name_external (s.item, ty.item, name.item)
+ end
+
+feature {NONE} -- Externals
+
+ make_external (s: POINTER; ty: POINTER): POINTER
+ external
+ "C++ inline use %"llvm/Instructions.h%""
+ alias
+ "[
+ return new llvm::SExtInst ((llvm::Value *)$s, (llvm::Value *)$ty);
+ ]"
+ end
+
+ make_name_external (s: POINTER; ty: POINTER; name: POINTER): POINTER
+ external
+ "C++ inline use %"llvm/Instructions.h%""
+ alias
+ "[
+ return new llvm::SExtInst ((llvm::Value *)$s, (llvm::Value *)$ty, *((llvm::Twine *)$name));
+ ]"
+ end
+
+end
View
50 instructions/select_inst.e
@@ -0,0 +1,50 @@
+note
+ description: "Summary description for {SELECT_INST}."
+ author: ""
+ date: "$Date$"
+ revision: "$Revision$"
+
+class
+ SELECT_INST
+
+inherit
+ INSTRUCTION
+
+create
+
+ make,
+ make_name
+
+feature {NONE}
+
+ make (c: VALUE; s1: VALUE; s2: VALUE)
+ do
+ item := make_external (c.item, s1.item, s2.item)
+ end
+
+ make_name (c: VALUE; s1: VALUE; s2: VALUE; name: TWINE)
+ do
+ item := make_name_external (c.item, s1.item, s2.item, name.item)
+ end
+
+feature {NONE} -- External
+
+ make_external (c: POINTER; s1: POINTER; s2: POINTER): POINTER
+ external
+ "C++ inline use %"llvm/Instructions.h%""
+ alias
+ "[
+ return new llvm::SelectInst ((llvm::Value *)$c, (llvm::Value *)$s1, (llvm::Value *)$s2);
+ ]"
+ end
+
+ make_name_external (c: POINTER; s1: POINTER; s2: POINTER; name: POINTER): POINTER
+ external
+ "C++ inline use %"llvm/Instructions.h%""
+ alias
+ "[
+ return new llvm::SelectInst ((llvm::Value *)$c, (llvm::Value *)$s1, (llvm::Value *)$s2, *((llvm:Twine *)$name));
+ ]"
+ end
+
+end
View
50 instructions/si_to_fp_inst.e
@@ -0,0 +1,50 @@
+note
+ description: "Summary description for {SI_TO_FP_INST}."
+ author: ""
+ date: "$Date$"
+ revision: "$Revision$"
+
+class
+ SI_TO_FP_INST
+
+inherit
+ CAST_INST
+
+create
+
+ make,
+ make_name
+
+feature {NONE}
+
+ make (s: VALUE; ty: VALUE)
+ do
+ item := make_external (s.item, ty.item)
+ end
+
+ make_name (s: VALUE; ty: VALUE; name: TWINE)
+ do
+ item := make_name_external (s.item, ty.item, name.item)
+ end
+
+feature {NONE} -- Externals
+
+ make_external (s: POINTER; ty: POINTER): POINTER
+ external
+ "C++ inline use %"llvm/Instructions.h%""
+ alias
+ "[
+ return new llvm::SIToFPInst ((llvm::Value *)$s, (llvm::Value *)$ty);
+ ]"
+ end
+
+ make_name_external (s: POINTER; ty: POINTER; name: POINTER): POINTER
+ external
+ "C++ inline use %"llvm/Instructions.h%""
+ alias
+ "[
+ return new llvm::SIToFPInst ((llvm::Value *)$s, (llvm::Value *)$ty, *((llvm::Twine *)$name));
+ ]"
+ end
+
+end
View
65 instructions/store_inst.e
@@ -0,0 +1,65 @@
+note
+ description: "Summary description for {STORE_INST}."
+ author: ""
+ date: "$Date$"
+ revision: "$Revision$"
+
+class
+ STORE_INST
+
+inherit
+ INSTRUCTION
+
+create
+
+ make_from_pointer,
+ make,
+ make_volatile,
+ make_volatile_align
+
+feature {NONE}
+
+ make (val: VALUE; ptr: VALUE)
+ do
+ item := make_external (val.item, ptr.item)
+ end
+
+ make_volatile (val: VALUE; ptr: VALUE; volatile: BOOLEAN)
+ do
+ item := make_volatile_external (val.item, ptr.item, volatile)
+ end
+
+ make_volatile_align (val: VALUE; ptr: VALUE; volatile: BOOLEAN; align: NATURAL_32)
+ do
+ item := make_volatile_align_external (val.item, ptr.item, volatile, align)
+ end
+
+feature {NONE} -- Externals
+
+ make_external (val: POINTER; ptr: POINTER): POINTER
+ external
+ "C++ inline use %"llvm/Instructions.h%""
+ alias
+ "[
+ return new llvm::StoreInst ((llvm::Value *)$val, (llvm::Value *)$ptr);
+ ]"
+ end
+
+ make_volatile_external (val: POINTER; ptr: POINTER; volatile: BOOLEAN): POINTER
+ external
+ "C++ inline use %"llvm/Instructions.h%""
+ alias
+ "[
+ return new llvm::StoreInst ((llvm::Value *)$val, (llvm::Value *)$ptr, $volatile);
+ ]"
+ end
+
+ make_volatile_align_external (val: POINTER; ptr: POINTER; volatile: BOOLEAN; align: NATURAL_32): POINTER
+ external
+ "C++ inline use %"llvm/Instructions.h%""
+ alias
+ "[
+ return new llvm::StoreInst ((llvm::Value *)$val, (llvm::Value *)$ptr, $volatile, $align);
+ ]"
+ end
+end
View
49 instructions/trunc_inst.e
@@ -0,0 +1,49 @@
+note
+ description: "Summary description for {TRUNC_INST}."
+ author: ""
+ date: "$Date$"
+ revision: "$Revision$"
+
+class
+ TRUNC_INST
+
+inherit
+ CAST_INST
+
+create
+
+ make,
+ make_name
+
+feature {NONE}
+
+ make (s: VALUE; ty: VALUE)
+ do
+ item := make_external (s.item, ty.item)
+ end
+
+ make_name (s: VALUE; ty: VALUE; name: TWINE)
+ do
+ item := make_name_external (s.item, ty.item, name.item)
+ end
+
+feature {NONE} -- Externals
+
+ make_external (s: POINTER; ty: POINTER): POINTER
+ external
+ "C++ inline use %"llvm/Instructions.h%""
+ alias
+ "[
+ return new llvm::TruncInst ((llvm::Value *)$s, (llvm::Value *)$ty);
+ ]"
+ end
+
+ make_name_external (s: POINTER; ty: POINTER; name: POINTER): POINTER
+ external
+ "C++ inline use %"llvm/Instructions.h%""
+ alias
+ "[
+ return new llvm::TruncInst ((llvm::Value *)$s, (llvm::Value *)$ty, *((llvm::Twine *)$name));
+ ]"
+ end
+end
View
50 instructions/ui_to_fp_inst.e
@@ -0,0 +1,50 @@
+note
+ description: "Summary description for {UI_TO_FP_INST}."
+ author: ""
+ date: "$Date$"
+ revision: "$Revision$"
+
+class
+ UI_TO_FP_INST
+
+inherit
+ CAST_INST
+
+create
+
+ make,
+ make_name
+
+feature {NONE}
+
+ make (s: VALUE; ty: VALUE)
+ do
+ item := make_external (s.item, ty.item)
+ end
+
+ make_name (s: VALUE; ty: VALUE; name: TWINE)
+ do
+ item := make_name_external (s.item, ty.item, name.item)
+ end
+
+feature {NONE} -- Externals
+
+ make_external (s: POINTER; ty: POINTER): POINTER
+ external
+ "C++ inline use %"llvm/Instructions.h%""
+ alias
+ "[
+ return new llvm::UIToFPInst ((llvm::Value *)$s, (llvm::Value *)$ty);
+ ]"
+ end
+
+ make_name_external (s: POINTER; ty: POINTER; name: POINTER): POINTER
+ external
+ "C++ inline use %"llvm/Instructions.h%""
+ alias
+ "[
+ return new llvm::UIToFPInst ((llvm::Value *)$s, (llvm::Value *)$ty, *((llvm::Twine *)$name));
+ ]"
+ end
+
+end
View
50 instructions/z_ext_inst.e
@@ -0,0 +1,50 @@
+note
+ description: "Summary description for {Z_EXT_INST}."
+ author: ""
+ date: "$Date$"
+ revision: "$Revision$"
+
+class
+ Z_EXT_INST
+
+inherit
+ CAST_INST
+
+create
+
+ make,
+ make_name
+
+feature {NONE}
+
+ make (s: VALUE; ty: VALUE)
+ do
+ item := make_external (s.item, ty.item)
+ end
+
+ make_name (s: VALUE; ty: VALUE; name: TWINE)
+ do
+ item := make_name_external (s.item, ty.item, name.item)
+ end
+
+feature {NONE} -- Externals
+
+ make_external (s: POINTER; ty: POINTER): POINTER
+ external
+ "C++ inline use %"llvm/Instructions.h%""
+ alias
+ "[
+ return new llvm::ZExtInst ((llvm::Value *)$s, (llvm::Value *)$ty);
+ ]"
+ end
+
+ make_name_external (s: POINTER; ty: POINTER; name: POINTER): POINTER
+ external
+ "C++ inline use %"llvm/Instructions.h%""
+ alias
+ "[
+ return new llvm::ZExtInst ((llvm::Value *)$s, (llvm::Value *)$ty, *((llvm::Twine *)$name));
+ ]"
+ end
+
+end
View
45 intrinsics/mem_cpy_inst.e
@@ -0,0 +1,45 @@
+note
+ description: "Summary description for {MEM_CPY_INST}."
+ author: ""
+ date: "$Date$"
+ revision: "$Revision$"
+
+class
+ MEM_CPY_INST
+
+inherit
+ MEM_TRANSFER_INST
+ rename
+ make as make_call
+ end
+
+create
+
+ make
+
+feature {NONE}
+
+ make (ctx: LLVM_CONTEXT; m: MODULE)
+ local
+ overload_array: SPECIAL [POINTER]
+ array_pointer: POINTER
+ do
+ create overload_array.make_empty (3)
+ overload_array.extend ((create {POINTER_TYPE}.make (create {INTEGER_TYPE}.make (ctx, 8))).item)
+ overload_array.extend ((create {POINTER_TYPE}.make (create {INTEGER_TYPE}.make (ctx, 8))).item)
+ overload_array.extend ((create {INTEGER_TYPE}.make (ctx, 32)).item)
+ array_pointer := overload_array.base_address
+ item := make_external (m.item, memcpy_id, $array_pointer, 3)
+ end
+
+feature {NONE} -- Externals
+
+ memcpy_id: NATURAL_32
+ external
+ "C++ inline use %"llvm/IntrinsicInst.h%""
+ alias
+ "[
+ return llvm::Intrinsic::ID.memcpy
+ ]"
+ end
+end
View
13 intrinsics/mem_transfer_inst.e
@@ -0,0 +1,13 @@
+note
+ description: "Summary description for {MEM_TRANSFER_INST}."
+ author: ""
+ date: "$Date$"
+ revision: "$Revision$"
+
+class
+ MEM_TRANSFER_INST
+
+inherit
+ MEM_INTRINSIC
+
+end
View
45 predicate_l.e
@@ -0,0 +1,45 @@
+note
+ description: "Summary description for {PREDICATE_L}."
+ author: ""
+ date: "$Date$"
+ revision: "$Revision$"
+
+frozen expanded class
+ PREDICATE_L
+
+feature
+
+ fcmp_false: INTEGER_32 = 0
+ fcmp_oeq: INTEGER_32 = 1
+ fcmp_ogt: INTEGER_32 = 2
+ fcmp_oge: INTEGER_32 = 3
+ fcmp_olt: INTEGER_32 = 4
+ fcmp_ole: INTEGER_32 = 5
+ fcmp_one: INTEGER_32 = 6
+ fcmp_ord: INTEGER_32 = 7
+ fcmp_uno: INTEGER_32 = 8
+ fcmp_ueq: INTEGER_32 = 9
+ fcmp_ugt: INTEGER_32 = 10
+ fcmp_uge: INTEGER_32 = 11
+ fcmp_ult: INTEGER_32 = 12
+ fcmp_ule: INTEGER_32 = 13
+ fcmp_une: INTEGER_32 = 14
+ fcmp_true: INTEGER_32 = 15
+ first_fcmp_predicate: INTEGER_32 = 0
+ last_fcmp_predicate: INTEGER_32 = 15
+ bad_fcmp_predicate: INTEGER_32 = 16
+ icmp_eq: INTEGER_32 = 32
+ icmp_ne: INTEGER_32 = 33
+ icmp_ugt: INTEGER_32 = 34
+ icmp_uge: INTEGER_32 = 35
+ icmp_ult: INTEGER_32 = 36
+ icmp_ule: INTEGER_32 = 37
+ icmp_sgt: INTEGER_32 = 38
+ icmp_sge: INTEGER_32 = 39
+ icmp_slt: INTEGER_32 = 40
+ icmp_sle: INTEGER_32 = 41
+ first_icmp_predicate: INTEGER_32 = 32
+ last_icmp_predicate: INTEGER_32 = 41
+ bad_icmp_predicate: INTEGER_32 = 42
+
+end
View
51 unsigned_vector.e
@@ -0,0 +1,51 @@
+note
+ description: "Summary description for {UNSIGNED_VECTOR}."
+ author: ""
+ date: "$Date$"
+ revision: "$Revision$"
+
+class
+ UNSIGNED_VECTOR
+
+create
+
+ make
+
+feature {NONE}
+
+ make
+ do
+ item := make_external
+ end
+
+feature
+
+ push_back (v: NATURAL_32)
+ do
+ push_back_external (item, v)
+ end
+
+feature
+
+ item: POINTER
+
+feature {NONE} -- Externals
+
+ push_back_external (item_a: POINTER; v: NATURAL_32)
+ external
+ "C++ inline use <vector>"
+ alias
+ "[
+ ((std::vector <unsigned> *)$item_a)->push_back ($v);
+ ]"
+ end
+
+ make_external: POINTER
+ external
+ "C++ inline use <vector>"
+ alias
+ "[
+ return new std::vector <unsigned>;
+ ]"
+ end
+end

0 comments on commit 4abbabb

Please sign in to comment.