ruby-llvm 3.0.0.beta → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,250 @@
1
+ # Generated by ffi_gen. Please do not change this file by hand.
2
+
3
+ require 'ffi'
4
+
5
+ module LLVM::C
6
+ extend FFI::Library
7
+ ffi_lib 'LLVM-3.0'
8
+
9
+ # (Not documented)
10
+ #
11
+ # @method add_aggressive_dce_pass(pm)
12
+ # @param [FFI::Pointer(PassManagerRef)] pm
13
+ # @return [nil]
14
+ # @scope class
15
+ attach_function :add_aggressive_dce_pass, :LLVMAddAggressiveDCEPass, [:pointer], :void
16
+
17
+ # See llvm::createCFGSimplificationPass function.
18
+ #
19
+ # @method add_cfg_simplification_pass(pm)
20
+ # @param [FFI::Pointer(PassManagerRef)] pm
21
+ # @return [nil]
22
+ # @scope class
23
+ attach_function :add_cfg_simplification_pass, :LLVMAddCFGSimplificationPass, [:pointer], :void
24
+
25
+ # See llvm::createDeadStoreEliminationPass function.
26
+ #
27
+ # @method add_dead_store_elimination_pass(pm)
28
+ # @param [FFI::Pointer(PassManagerRef)] pm
29
+ # @return [nil]
30
+ # @scope class
31
+ attach_function :add_dead_store_elimination_pass, :LLVMAddDeadStoreEliminationPass, [:pointer], :void
32
+
33
+ # See llvm::createGVNPass function.
34
+ #
35
+ # @method add_gvn_pass(pm)
36
+ # @param [FFI::Pointer(PassManagerRef)] pm
37
+ # @return [nil]
38
+ # @scope class
39
+ attach_function :add_gvn_pass, :LLVMAddGVNPass, [:pointer], :void
40
+
41
+ # See llvm::createIndVarSimplifyPass function.
42
+ #
43
+ # @method add_ind_var_simplify_pass(pm)
44
+ # @param [FFI::Pointer(PassManagerRef)] pm
45
+ # @return [nil]
46
+ # @scope class
47
+ attach_function :add_ind_var_simplify_pass, :LLVMAddIndVarSimplifyPass, [:pointer], :void
48
+
49
+ # See llvm::createInstructionCombiningPass function.
50
+ #
51
+ # @method add_instruction_combining_pass(pm)
52
+ # @param [FFI::Pointer(PassManagerRef)] pm
53
+ # @return [nil]
54
+ # @scope class
55
+ attach_function :add_instruction_combining_pass, :LLVMAddInstructionCombiningPass, [:pointer], :void
56
+
57
+ # See llvm::createJumpThreadingPass function.
58
+ #
59
+ # @method add_jump_threading_pass(pm)
60
+ # @param [FFI::Pointer(PassManagerRef)] pm
61
+ # @return [nil]
62
+ # @scope class
63
+ attach_function :add_jump_threading_pass, :LLVMAddJumpThreadingPass, [:pointer], :void
64
+
65
+ # See llvm::createLICMPass function.
66
+ #
67
+ # @method add_licm_pass(pm)
68
+ # @param [FFI::Pointer(PassManagerRef)] pm
69
+ # @return [nil]
70
+ # @scope class
71
+ attach_function :add_licm_pass, :LLVMAddLICMPass, [:pointer], :void
72
+
73
+ # See llvm::createLoopDeletionPass function.
74
+ #
75
+ # @method add_loop_deletion_pass(pm)
76
+ # @param [FFI::Pointer(PassManagerRef)] pm
77
+ # @return [nil]
78
+ # @scope class
79
+ attach_function :add_loop_deletion_pass, :LLVMAddLoopDeletionPass, [:pointer], :void
80
+
81
+ # See llvm::createLoopIdiomPass function
82
+ #
83
+ # @method add_loop_idiom_pass(pm)
84
+ # @param [FFI::Pointer(PassManagerRef)] pm
85
+ # @return [nil]
86
+ # @scope class
87
+ attach_function :add_loop_idiom_pass, :LLVMAddLoopIdiomPass, [:pointer], :void
88
+
89
+ # See llvm::createLoopRotatePass function.
90
+ #
91
+ # @method add_loop_rotate_pass(pm)
92
+ # @param [FFI::Pointer(PassManagerRef)] pm
93
+ # @return [nil]
94
+ # @scope class
95
+ attach_function :add_loop_rotate_pass, :LLVMAddLoopRotatePass, [:pointer], :void
96
+
97
+ # See llvm::createLoopUnrollPass function.
98
+ #
99
+ # @method add_loop_unroll_pass(pm)
100
+ # @param [FFI::Pointer(PassManagerRef)] pm
101
+ # @return [nil]
102
+ # @scope class
103
+ attach_function :add_loop_unroll_pass, :LLVMAddLoopUnrollPass, [:pointer], :void
104
+
105
+ # See llvm::createLoopUnswitchPass function.
106
+ #
107
+ # @method add_loop_unswitch_pass(pm)
108
+ # @param [FFI::Pointer(PassManagerRef)] pm
109
+ # @return [nil]
110
+ # @scope class
111
+ attach_function :add_loop_unswitch_pass, :LLVMAddLoopUnswitchPass, [:pointer], :void
112
+
113
+ # See llvm::createMemCpyOptPass function.
114
+ #
115
+ # @method add_mem_cpy_opt_pass(pm)
116
+ # @param [FFI::Pointer(PassManagerRef)] pm
117
+ # @return [nil]
118
+ # @scope class
119
+ attach_function :add_mem_cpy_opt_pass, :LLVMAddMemCpyOptPass, [:pointer], :void
120
+
121
+ # See llvm::createPromoteMemoryToRegisterPass function.
122
+ #
123
+ # @method add_promote_memory_to_register_pass(pm)
124
+ # @param [FFI::Pointer(PassManagerRef)] pm
125
+ # @return [nil]
126
+ # @scope class
127
+ attach_function :add_promote_memory_to_register_pass, :LLVMAddPromoteMemoryToRegisterPass, [:pointer], :void
128
+
129
+ # See llvm::createReassociatePass function.
130
+ #
131
+ # @method add_reassociate_pass(pm)
132
+ # @param [FFI::Pointer(PassManagerRef)] pm
133
+ # @return [nil]
134
+ # @scope class
135
+ attach_function :add_reassociate_pass, :LLVMAddReassociatePass, [:pointer], :void
136
+
137
+ # See llvm::createSCCPPass function.
138
+ #
139
+ # @method add_sccp_pass(pm)
140
+ # @param [FFI::Pointer(PassManagerRef)] pm
141
+ # @return [nil]
142
+ # @scope class
143
+ attach_function :add_sccp_pass, :LLVMAddSCCPPass, [:pointer], :void
144
+
145
+ # See llvm::createScalarReplAggregatesPass function.
146
+ #
147
+ # @method add_scalar_repl_aggregates_pass(pm)
148
+ # @param [FFI::Pointer(PassManagerRef)] pm
149
+ # @return [nil]
150
+ # @scope class
151
+ attach_function :add_scalar_repl_aggregates_pass, :LLVMAddScalarReplAggregatesPass, [:pointer], :void
152
+
153
+ # See llvm::createScalarReplAggregatesPass function.
154
+ #
155
+ # @method add_scalar_repl_aggregates_pass_ssa(pm)
156
+ # @param [FFI::Pointer(PassManagerRef)] pm
157
+ # @return [nil]
158
+ # @scope class
159
+ attach_function :add_scalar_repl_aggregates_pass_ssa, :LLVMAddScalarReplAggregatesPassSSA, [:pointer], :void
160
+
161
+ # See llvm::createScalarReplAggregatesPass function.
162
+ #
163
+ # @method add_scalar_repl_aggregates_pass_with_threshold(pm, threshold)
164
+ # @param [FFI::Pointer(PassManagerRef)] pm
165
+ # @param [Integer] threshold
166
+ # @return [nil]
167
+ # @scope class
168
+ attach_function :add_scalar_repl_aggregates_pass_with_threshold, :LLVMAddScalarReplAggregatesPassWithThreshold, [:pointer, :int], :void
169
+
170
+ # See llvm::createSimplifyLibCallsPass function.
171
+ #
172
+ # @method add_simplify_lib_calls_pass(pm)
173
+ # @param [FFI::Pointer(PassManagerRef)] pm
174
+ # @return [nil]
175
+ # @scope class
176
+ attach_function :add_simplify_lib_calls_pass, :LLVMAddSimplifyLibCallsPass, [:pointer], :void
177
+
178
+ # See llvm::createTailCallEliminationPass function.
179
+ #
180
+ # @method add_tail_call_elimination_pass(pm)
181
+ # @param [FFI::Pointer(PassManagerRef)] pm
182
+ # @return [nil]
183
+ # @scope class
184
+ attach_function :add_tail_call_elimination_pass, :LLVMAddTailCallEliminationPass, [:pointer], :void
185
+
186
+ # See llvm::createConstantPropagationPass function.
187
+ #
188
+ # @method add_constant_propagation_pass(pm)
189
+ # @param [FFI::Pointer(PassManagerRef)] pm
190
+ # @return [nil]
191
+ # @scope class
192
+ attach_function :add_constant_propagation_pass, :LLVMAddConstantPropagationPass, [:pointer], :void
193
+
194
+ # See llvm::demotePromoteMemoryToRegisterPass function.
195
+ #
196
+ # @method add_demote_memory_to_register_pass(pm)
197
+ # @param [FFI::Pointer(PassManagerRef)] pm
198
+ # @return [nil]
199
+ # @scope class
200
+ attach_function :add_demote_memory_to_register_pass, :LLVMAddDemoteMemoryToRegisterPass, [:pointer], :void
201
+
202
+ # See llvm::createVerifierPass function.
203
+ #
204
+ # @method add_verifier_pass(pm)
205
+ # @param [FFI::Pointer(PassManagerRef)] pm
206
+ # @return [nil]
207
+ # @scope class
208
+ attach_function :add_verifier_pass, :LLVMAddVerifierPass, [:pointer], :void
209
+
210
+ # See llvm::createCorrelatedValuePropagationPass function
211
+ #
212
+ # @method add_correlated_value_propagation_pass(pm)
213
+ # @param [FFI::Pointer(PassManagerRef)] pm
214
+ # @return [nil]
215
+ # @scope class
216
+ attach_function :add_correlated_value_propagation_pass, :LLVMAddCorrelatedValuePropagationPass, [:pointer], :void
217
+
218
+ # See llvm::createEarlyCSEPass function
219
+ #
220
+ # @method add_early_cse_pass(pm)
221
+ # @param [FFI::Pointer(PassManagerRef)] pm
222
+ # @return [nil]
223
+ # @scope class
224
+ attach_function :add_early_cse_pass, :LLVMAddEarlyCSEPass, [:pointer], :void
225
+
226
+ # See llvm::createLowerExpectIntrinsicPass function
227
+ #
228
+ # @method add_lower_expect_intrinsic_pass(pm)
229
+ # @param [FFI::Pointer(PassManagerRef)] pm
230
+ # @return [nil]
231
+ # @scope class
232
+ attach_function :add_lower_expect_intrinsic_pass, :LLVMAddLowerExpectIntrinsicPass, [:pointer], :void
233
+
234
+ # See llvm::createTypeBasedAliasAnalysisPass function
235
+ #
236
+ # @method add_type_based_alias_analysis_pass(pm)
237
+ # @param [FFI::Pointer(PassManagerRef)] pm
238
+ # @return [nil]
239
+ # @scope class
240
+ attach_function :add_type_based_alias_analysis_pass, :LLVMAddTypeBasedAliasAnalysisPass, [:pointer], :void
241
+
242
+ # See llvm::createBasicAliasAnalysisPass function
243
+ #
244
+ # @method add_basic_alias_analysis_pass(pm)
245
+ # @param [FFI::Pointer(PassManagerRef)] pm
246
+ # @return [nil]
247
+ # @scope class
248
+ attach_function :add_basic_alias_analysis_pass, :LLVMAddBasicAliasAnalysisPass, [:pointer], :void
249
+
250
+ end
data/lib/llvm/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module LLVM
2
2
  LLVM_VERSION = "3.0"
3
- RUBY_LLVM_VERSION = "3.0.0.beta"
3
+ RUBY_LLVM_VERSION = "3.0.0"
4
4
  end
@@ -56,6 +56,12 @@ class ConversionsTestCase < Test::Unit::TestCase
56
56
  different_type_assertion(:bit_cast, LLVM::Int8.from_i(255), LLVM::Int8, :integer, -1)
57
57
  end
58
58
 
59
+ def test_int64
60
+ integer_conversion_assertion(:zext, LLVM::Int64.from_i(2**62 + 123), LLVM::Int64, LLVM_SIGNED, 2**62 + 123)
61
+ integer_conversion_assertion(:zext, LLVM::Int64.from_i(-2**62 - 123), LLVM::Int64, LLVM_SIGNED, -2**62 - 123)
62
+ integer_conversion_assertion(:zext, LLVM::Int64.from_i(2**63 + 123), LLVM::Int64, LLVM_UNSIGNED, 2**63 + 123)
63
+ end
64
+
59
65
  def integer_conversion_assertion(operation, operand, return_type, signed, expected_result)
60
66
  result = run_conversion_operation(operation, operand, return_type)
61
67
  assert_equal expected_result, result.to_i(signed)
@@ -59,9 +59,9 @@ class EqualityTestCase < Test::Unit::TestCase
59
59
 
60
60
  def test_type
61
61
  type1 = LLVM::Float.type
62
- type2 = LLVM::Type.from_ptr(type1.to_ptr)
62
+ type2 = LLVM::Type.from_ptr(type1.to_ptr, nil)
63
63
  type3 = LLVM::Double.type
64
- type4 = MyType.from_ptr(type1.to_ptr)
64
+ type4 = MyType.from_ptr(type1.to_ptr, :mytype)
65
65
 
66
66
  assert_equalities :equal => [type1, type2, type4],
67
67
  :not_equal => [type1, type3],
data/test/struct_test.rb CHANGED
@@ -11,14 +11,23 @@ class StructTestCase < Test::Unit::TestCase
11
11
 
12
12
  def test_simple_struct
13
13
  struct = LLVM::Struct(LLVM::Int, LLVM::Float)
14
- assert_instance_of LLVM::Type, struct
14
+ assert_instance_of LLVM::StructType, struct
15
+ assert_equal 2, struct.element_types.size
16
+ assert_equal LLVM::Int.type, struct.element_types[0]
17
+ assert_equal LLVM::Float.type, struct.element_types[1]
15
18
  end
16
19
 
17
20
  def test_named_struct
18
21
  struct = LLVM::Struct(LLVM::Int, LLVM::Float, "struct100")
19
- assert_instance_of LLVM::Type, struct
22
+ assert_instance_of LLVM::StructType, struct
20
23
  assert_equal "struct100", struct.name
21
24
  end
25
+
26
+ def test_deferred_element_type_setting
27
+ struct = LLVM::Struct("struct200")
28
+ struct.element_types = [LLVM::Int, LLVM::Float]
29
+ assert_equal 2, struct.element_types.size
30
+ end
22
31
 
23
32
  def test_unpacked_constant_struct_from_size
24
33
  struct = LLVM::ConstantStruct.const(2, LLVM_UNPACKED) { |i| LLVM::Int(i) }
metadata CHANGED
@@ -1,70 +1,97 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: ruby-llvm
3
- version: !ruby/object:Gem::Version
4
- version: 3.0.0.beta
5
- prerelease: 6
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 3
7
+ - 0
8
+ - 0
9
+ version: 3.0.0
6
10
  platform: ruby
7
- authors:
11
+ authors:
8
12
  - Jeremy Voorhis
9
13
  autorequire:
10
14
  bindir: bin
11
15
  cert_chain: []
12
- date: 2012-02-04 00:00:00.000000000 Z
13
- dependencies:
14
- - !ruby/object:Gem::Dependency
16
+
17
+ date: 2012-03-02 00:00:00 -08:00
18
+ default_executable:
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
15
21
  name: ffi
16
- requirement: &70123470125560 !ruby/object:Gem::Requirement
17
- none: false
18
- requirements:
19
- - - ! '>='
20
- - !ruby/object:Gem::Version
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - ">="
26
+ - !ruby/object:Gem::Version
27
+ segments:
28
+ - 1
29
+ - 0
30
+ - 0
21
31
  version: 1.0.0
22
32
  type: :runtime
33
+ version_requirements: *id001
34
+ - !ruby/object:Gem::Dependency
35
+ name: ffi_gen
23
36
  prerelease: false
24
- version_requirements: *70123470125560
25
- - !ruby/object:Gem::Dependency
26
- name: rake
27
- requirement: &70123470125140 !ruby/object:Gem::Requirement
28
- none: false
29
- requirements:
30
- - - ! '>='
31
- - !ruby/object:Gem::Version
32
- version: '0'
37
+ requirement: &id002 !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - ">="
40
+ - !ruby/object:Gem::Version
41
+ segments:
42
+ - 0
43
+ version: "0"
33
44
  type: :development
45
+ version_requirements: *id002
46
+ - !ruby/object:Gem::Dependency
47
+ name: rake
34
48
  prerelease: false
35
- version_requirements: *70123470125140
36
- - !ruby/object:Gem::Dependency
37
- name: rcov
38
- requirement: &70123470124680 !ruby/object:Gem::Requirement
39
- none: false
40
- requirements:
41
- - - ! '>='
42
- - !ruby/object:Gem::Version
43
- version: '0'
49
+ requirement: &id003 !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ segments:
54
+ - 0
55
+ version: "0"
44
56
  type: :development
57
+ version_requirements: *id003
58
+ - !ruby/object:Gem::Dependency
59
+ name: rcov
45
60
  prerelease: false
46
- version_requirements: *70123470124680
47
- - !ruby/object:Gem::Dependency
48
- name: yard
49
- requirement: &70123470124260 !ruby/object:Gem::Requirement
50
- none: false
51
- requirements:
52
- - - ! '>='
53
- - !ruby/object:Gem::Version
54
- version: '0'
61
+ requirement: &id004 !ruby/object:Gem::Requirement
62
+ requirements:
63
+ - - ">="
64
+ - !ruby/object:Gem::Version
65
+ segments:
66
+ - 0
67
+ version: "0"
55
68
  type: :development
69
+ version_requirements: *id004
70
+ - !ruby/object:Gem::Dependency
71
+ name: yard
56
72
  prerelease: false
57
- version_requirements: *70123470124260
73
+ requirement: &id005 !ruby/object:Gem::Requirement
74
+ requirements:
75
+ - - ">="
76
+ - !ruby/object:Gem::Version
77
+ segments:
78
+ - 0
79
+ version: "0"
80
+ type: :development
81
+ version_requirements: *id005
58
82
  description: LLVM bindings for Ruby
59
83
  email: jvoorhis@gmail.com
60
84
  executables: []
61
- extensions:
85
+
86
+ extensions:
62
87
  - ext/ruby-llvm-support/Rakefile
63
- extra_rdoc_files:
88
+ extra_rdoc_files:
64
89
  - README.rdoc
65
- files:
90
+ files:
66
91
  - lib/llvm/analysis.rb
92
+ - lib/llvm/analysis_ffi.rb
67
93
  - lib/llvm/core/bitcode.rb
94
+ - lib/llvm/core/bitcode_ffi.rb
68
95
  - lib/llvm/core/builder.rb
69
96
  - lib/llvm/core/context.rb
70
97
  - lib/llvm/core/module.rb
@@ -72,64 +99,52 @@ files:
72
99
  - lib/llvm/core/type.rb
73
100
  - lib/llvm/core/value.rb
74
101
  - lib/llvm/core.rb
102
+ - lib/llvm/core_ffi.rb
75
103
  - lib/llvm/execution_engine.rb
104
+ - lib/llvm/execution_engine_ffi.rb
76
105
  - lib/llvm/support.rb
77
106
  - lib/llvm/target.rb
107
+ - lib/llvm/target_ffi.rb
78
108
  - lib/llvm/transforms/ipo.rb
109
+ - lib/llvm/transforms/ipo_ffi.rb
79
110
  - lib/llvm/transforms/scalar.rb
111
+ - lib/llvm/transforms/scalar_ffi.rb
80
112
  - lib/llvm/version.rb
81
113
  - lib/llvm.rb
82
114
  - ext/ruby-llvm-support/Rakefile
83
115
  - ext/ruby-llvm-support/support.cpp
84
116
  - README.rdoc
85
- - test/array_test.rb
86
- - test/basic_block_test.rb
87
- - test/basic_test.rb
88
- - test/binary_operations_test.rb
89
- - test/bitcode_test.rb
90
- - test/branch_test.rb
91
- - test/call_test.rb
92
- - test/comparisons_test.rb
93
- - test/conversions_test.rb
94
- - test/double_test.rb
95
- - test/equality_test.rb
96
- - test/generic_value_test.rb
97
- - test/instruction_test.rb
98
- - test/ipo_test.rb
99
- - test/memory_access_test.rb
100
- - test/module_test.rb
101
- - test/parameter_collection_test.rb
102
- - test/phi_test.rb
103
- - test/select_test.rb
104
- - test/struct_test.rb
105
- - test/test_helper.rb
106
- - test/type_test.rb
107
- - test/vector_test.rb
117
+ has_rdoc: true
108
118
  homepage: http://github.com/jvoorhis/ruby-llvm
109
119
  licenses: []
120
+
110
121
  post_install_message:
111
122
  rdoc_options: []
112
- require_paths:
123
+
124
+ require_paths:
113
125
  - lib
114
- required_ruby_version: !ruby/object:Gem::Requirement
115
- none: false
116
- requirements:
117
- - - ! '>='
118
- - !ruby/object:Gem::Version
119
- version: '0'
120
- required_rubygems_version: !ruby/object:Gem::Requirement
121
- none: false
122
- requirements:
123
- - - ! '>'
124
- - !ruby/object:Gem::Version
125
- version: 1.3.1
126
+ required_ruby_version: !ruby/object:Gem::Requirement
127
+ requirements:
128
+ - - ">="
129
+ - !ruby/object:Gem::Version
130
+ segments:
131
+ - 0
132
+ version: "0"
133
+ required_rubygems_version: !ruby/object:Gem::Requirement
134
+ requirements:
135
+ - - ">="
136
+ - !ruby/object:Gem::Version
137
+ segments:
138
+ - 0
139
+ version: "0"
126
140
  requirements: []
141
+
127
142
  rubyforge_project:
128
- rubygems_version: 1.8.11
143
+ rubygems_version: 1.3.6
129
144
  signing_key:
130
145
  specification_version: 3
131
146
  summary: LLVM bindings for Ruby
132
- test_files:
147
+ test_files:
133
148
  - test/array_test.rb
134
149
  - test/basic_block_test.rb
135
150
  - test/basic_test.rb
@@ -153,4 +168,3 @@ test_files:
153
168
  - test/test_helper.rb
154
169
  - test/type_test.rb
155
170
  - test/vector_test.rb
156
- has_rdoc: true