Class: RLTK::CG::GlobalValue
- Defined in:
- lib/rltk/cg/value.rb
Overview
This class represents global constants, variables, and functions.
Direct Known Subclasses
Instance Attribute Summary
Attributes included from BindingClass
Instance Method Summary collapse
-
#alignment ⇒ Integer
Get the byte alignment of this value.
-
#alignment=(bytes) ⇒ void
Set the byte alignment of this value.
-
#declaration? ⇒ Boolean
Check if this value is a declaration.
-
#global_constant=(flag) ⇒ void
Set this value as a global constant or not.
-
#global_constant? ⇒ Boolean
Check if this value is a global constant.
-
#initialize(ptr) ⇒ GlobalValue
constructor
Global values can only be instantiated using a pointer, and as such should not be created directly by library users.
-
#initializer ⇒ Value
Get this value’s initializer.
-
#initializer=(val) ⇒ void
Set this value’s initializer.
-
#linkage ⇒ Symbol
Get this value’s linkage type.
-
#linkage=(linkage) ⇒ void
Set this value’s linkage type.
-
#section ⇒ String
Get this value’s section string.
-
#section=(section) ⇒ void
Set this value’s section string.
-
#visibility ⇒ String
Get this value’s visibility.
-
#visibility=(vis) ⇒ void
Set this value’s visibility.
Methods inherited from Constant
#bitcast_to, #get_element_ptr, #get_element_ptr_in_bounds
Methods included from AbstractClass
Methods inherited from User
Methods inherited from Value
#==, #attributes, #bitcast, #constant?, #dump, #hash, #name, #name=, #null?, #print, #trunc, #trunc_or_bitcast, #type, #undefined?, #zextend, #zextend_or_bitcast
Methods included from BindingClass
Constructor Details
#initialize(ptr) ⇒ GlobalValue
Global values can only be instantiated using a pointer, and as such should not be created directly by library users.
1066 1067 1068 |
# File 'lib/rltk/cg/value.rb', line 1066 def initialize(ptr) @ptr = check_type(ptr, FFI::Pointer, 'ptr') end |
Instance Method Details
#alignment ⇒ Integer
Get the byte alignment of this value.
1073 1074 1075 |
# File 'lib/rltk/cg/value.rb', line 1073 def alignment Bindings.get_alignment(@ptr) end |
#alignment=(bytes) ⇒ void
This method returns an undefined value.
Set the byte alignment of this value.
1082 1083 1084 |
# File 'lib/rltk/cg/value.rb', line 1082 def alignment=(bytes) Bindings.set_alignment(@ptr, bytes) end |
#declaration? ⇒ Boolean
Check if this value is a declaration.
1089 1090 1091 |
# File 'lib/rltk/cg/value.rb', line 1089 def declaration? Bindings.is_declaration(@ptr).to_bool end |
#global_constant=(flag) ⇒ void
This method returns an undefined value.
Set this value as a global constant or not.
1105 1106 1107 |
# File 'lib/rltk/cg/value.rb', line 1105 def global_constant=(flag) Bindings.set_global_constant(@ptr, flag.to_i) end |
#global_constant? ⇒ Boolean
Check if this value is a global constant.
1096 1097 1098 |
# File 'lib/rltk/cg/value.rb', line 1096 def global_constant? Bindings.is_global_constant(@ptr).to_bool end |
#initializer ⇒ Value
Get this value’s initializer.
1112 1113 1114 |
# File 'lib/rltk/cg/value.rb', line 1112 def initializer Value.new(Bindings.get_initializer(@ptr)) end |
#initializer=(val) ⇒ void
This method returns an undefined value.
Set this value’s initializer.
1121 1122 1123 |
# File 'lib/rltk/cg/value.rb', line 1121 def initializer=(val) Bindings.set_initializer(@ptr, check_type(val, Value, 'val')) end |
#linkage ⇒ Symbol
Get this value’s linkage type.
1130 1131 1132 |
# File 'lib/rltk/cg/value.rb', line 1130 def linkage Bindings.get_linkage(@ptr) end |
#linkage=(linkage) ⇒ void
This method returns an undefined value.
Set this value’s linkage type.
1141 1142 1143 |
# File 'lib/rltk/cg/value.rb', line 1141 def linkage=(linkage) Bindings.set_linkage(@ptr, linkage) end |
#section ⇒ String
Get this value’s section string.
1148 1149 1150 |
# File 'lib/rltk/cg/value.rb', line 1148 def section Bindings.get_section(@ptr) end |
#section=(section) ⇒ void
This method returns an undefined value.
Set this value’s section string.
1157 1158 1159 |
# File 'lib/rltk/cg/value.rb', line 1157 def section=(section) Bindings.set_section(@ptr, section) end |
#visibility ⇒ String
Get this value’s visibility.
1166 1167 1168 |
# File 'lib/rltk/cg/value.rb', line 1166 def visibility Bindings.get_visibility(@ptr) end |
#visibility=(vis) ⇒ void
This method returns an undefined value.
Set this value’s visibility.
1177 1178 1179 |
# File 'lib/rltk/cg/value.rb', line 1177 def visibility=(vis) Bindings.set_visibility(@ptr, vis) end |