Class: RLTK::CG::Target

Inherits:
Object show all
Includes:
BindingClass
Defined in:
lib/rltk/cg/target.rb

Overview

Class binding for the LLVM Triple class.

Instance Attribute Summary collapse

Attributes included from BindingClass

#ptr

Class Method Summary collapse

Instance Method Summary collapse

Methods included from BindingClass

#==

Constructor Details

#initialize(overloaded) ⇒ Target

Create an object representing a particular code generation target. You can create a target either from a string or a Triple.

Parameters:

  • overloaded (Triple, String)

    Object describing the target.



36
37
38
39
40
41
42
# File 'lib/rltk/cg/target.rb', line 36

def initialize(overloaded)
	@ptr, @triple = 
	case overloaded
	when String	then [Bindings.get_target_from_string(overloaded), Triple.new(overloaded)]
	when Triple	then [Bindings.get_target_from_triple(overloaded), overloaded]
	end
end

Instance Attribute Details

#tripleTriple (readonly)

Returns Triple object for this target.

Returns:

  • (Triple)

    Triple object for this target.



25
26
27
# File 'lib/rltk/cg/target.rb', line 25

def triple
  @triple
end

Class Method Details

.hostTarget

Returns Target object for the host architecture.

Returns:

  • (Target)

    Target object for the host architecture.



28
29
30
# File 'lib/rltk/cg/target.rb', line 28

def self.host
	@host ||= self.new(Triple.host)
end