Class: LLVM::TargetMachine
- Inherits:
-
Object
- Object
- LLVM::TargetMachine
- Includes:
- PointerIdentity
- Defined in:
- lib/llvm/target.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#cpu ⇒ Object
Returns the CPU used for creating this target machine.
-
#dispose ⇒ Object
Destroys this instance of TargetMachine.
-
#emit(mod, filename, codegen = :assembly) ⇒ Object
Emits an asm or object file for the given module.
-
#features ⇒ Object
Returns the feature string used for creating this target machine.
-
#target ⇒ Target
Returns the corresponding Target.
-
#triple ⇒ Object
Returns the triple used for creating this target machine.
Methods included from PointerIdentity
Class Method Details
.from_ptr(ptr) ⇒ Object
171 172 173 174 175 |
# File 'lib/llvm/target.rb', line 171 def self.from_ptr(ptr) target = allocate target.instance_variable_set :@ptr, ptr target end |
Instance Method Details
#cpu ⇒ Object
Returns the CPU used for creating this target machine.
198 199 200 |
# File 'lib/llvm/target.rb', line 198 def cpu C.get_target_machine_cpu(self) end |
#dispose ⇒ Object
Destroys this instance of TargetMachine.
178 179 180 181 182 183 |
# File 'lib/llvm/target.rb', line 178 def dispose return if @ptr.nil? C.dispose_target_machine(self) @ptr = nil end |
#emit(mod, filename, codegen = :assembly) ⇒ Object
Emits an asm or object file for the given module.
210 211 212 213 214 |
# File 'lib/llvm/target.rb', line 210 def emit(mod, filename, codegen = :assembly) LLVM.with_error_output do |err| C.target_machine_emit_to_file(self, mod, filename.to_s, codegen, err) end end |
#features ⇒ Object
Returns the feature string used for creating this target machine.
203 204 205 |
# File 'lib/llvm/target.rb', line 203 def features C.get_target_machine_feature_string(self) end |
#target ⇒ Target
Returns the corresponding Target.
188 189 190 |
# File 'lib/llvm/target.rb', line 188 def target Target.from_ptr(C.get_target_machine_target(self)) end |
#triple ⇒ Object
Returns the triple used for creating this target machine.
193 194 195 |
# File 'lib/llvm/target.rb', line 193 def triple C.get_target_machine_triple(self) end |