Class: JIT::Constant
- Inherits:
-
Object
- Object
- JIT::Constant
- Defined in:
- lib/libjit/constant.rb
Class Method Summary (collapse)
-
+ (Object) create(function, val, *type)
Creates a new constant.
Class Method Details
+ (Object) create(function, val, *type)
Creates a new constant.
9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/libjit/constant.rb', line 9 def self.create(function, val, *type) raise ArgumentError.new "function can't be nil" if function.nil? type = Type.create *type if type.bool? BoolConstant.new(function, val, type) elsif type.floating_point? FloatConstant.new(function, val, type) else IntConstant.new(function, val, type) end end |