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.
-
#externally_initialized=(bool) ⇒ void
Sets the externally initialized property of a global value.
-
#externally_initialized? ⇒ Boolean
Check if this global is initialized externally.
-
#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.
-
#thread_local_mode ⇒ Symbol from _enum_thread_local_mode_
Returns the thread local model used by a global value.
-
#thread_local_mode=(mode) ⇒ void
Set the global value’s thread local mode.
-
#visibility ⇒ String
Get this value’s visibility.
-
#visibility=(vis) ⇒ void
Set this value’s visibility.
Methods inherited from Constant
#addr_space_cast, #bitcast_to, #get_element_ptr, #get_element_ptr_in_bounds
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.
1076 1077 1078 |
# File 'lib/rltk/cg/value.rb', line 1076 def initialize(ptr) @ptr = check_type(ptr, FFI::Pointer, 'ptr') end |
Instance Method Details
#alignment ⇒ Integer
Get the byte alignment of this value.
1083 1084 1085 |
# File 'lib/rltk/cg/value.rb', line 1083 def alignment Bindings.get_alignment(@ptr) end |
#alignment=(bytes) ⇒ void
This method returns an undefined value.
Set the byte alignment of this value.
1092 1093 1094 |
# File 'lib/rltk/cg/value.rb', line 1092 def alignment=(bytes) Bindings.set_alignment(@ptr, bytes) end |
#declaration? ⇒ Boolean
Check if this value is a declaration.
1099 1100 1101 |
# File 'lib/rltk/cg/value.rb', line 1099 def declaration? Bindings.is_declaration(@ptr).to_bool end |
#externally_initialized=(bool) ⇒ void
This method returns an undefined value.
Sets the externally initialized property of a global value.
1108 1109 1110 |
# File 'lib/rltk/cg/value.rb', line 1108 def externally_initialized=(bool) Bindings.set_externally_initialized(@ptr, bool.to_i) end |
#externally_initialized? ⇒ Boolean
Check if this global is initialized externally.
1115 1116 1117 |
# File 'lib/rltk/cg/value.rb', line 1115 def externally_initialized? Bindings.externally_initialized(@ptr).to_bool end |
#global_constant=(flag) ⇒ void
This method returns an undefined value.
Set this value as a global constant or not.
1131 1132 1133 |
# File 'lib/rltk/cg/value.rb', line 1131 def global_constant=(flag) Bindings.set_global_constant(@ptr, flag.to_i) end |
#global_constant? ⇒ Boolean
Check if this value is a global constant.
1122 1123 1124 |
# File 'lib/rltk/cg/value.rb', line 1122 def global_constant? Bindings.is_global_constant(@ptr).to_bool end |
#initializer ⇒ Value
Get this value’s initializer.
1138 1139 1140 |
# File 'lib/rltk/cg/value.rb', line 1138 def initializer Value.new(Bindings.get_initializer(@ptr)) end |
#initializer=(val) ⇒ void
This method returns an undefined value.
Set this value’s initializer.
1147 1148 1149 |
# File 'lib/rltk/cg/value.rb', line 1147 def initializer=(val) Bindings.set_initializer(@ptr, check_type(val, Value, 'val')) end |
#linkage ⇒ Symbol
Get this value’s linkage type.
1156 1157 1158 |
# File 'lib/rltk/cg/value.rb', line 1156 def linkage Bindings.get_linkage(@ptr) end |
#linkage=(linkage) ⇒ void
This method returns an undefined value.
Set this value’s linkage type.
1167 1168 1169 |
# File 'lib/rltk/cg/value.rb', line 1167 def linkage=(linkage) Bindings.set_linkage(@ptr, linkage) end |
#section ⇒ String
Get this value’s section string.
1174 1175 1176 |
# File 'lib/rltk/cg/value.rb', line 1174 def section Bindings.get_section(@ptr) end |
#section=(section) ⇒ void
This method returns an undefined value.
Set this value’s section string.
1183 1184 1185 |
# File 'lib/rltk/cg/value.rb', line 1183 def section=(section) Bindings.set_section(@ptr, section) end |
#thread_local_mode ⇒ Symbol from _enum_thread_local_mode_
Returns the thread local model used by a global value.
1190 1191 1192 |
# File 'lib/rltk/cg/value.rb', line 1190 def thread_local_mode Bindings.get_thread_local_mode(@ptr) end |
#thread_local_mode=(mode) ⇒ void
This method returns an undefined value.
Set the global value’s thread local mode.
1200 1201 1202 |
# File 'lib/rltk/cg/value.rb', line 1200 def thread_local_mode=(mode) Bindings.set_thread_local_mode(@ptr, mode) end |
#visibility ⇒ String
Get this value’s visibility.
1209 1210 1211 |
# File 'lib/rltk/cg/value.rb', line 1209 def visibility Bindings.get_visibility(@ptr) end |
#visibility=(vis) ⇒ void
This method returns an undefined value.
Set this value’s visibility.
1220 1221 1222 |
# File 'lib/rltk/cg/value.rb', line 1220 def visibility=(vis) Bindings.set_visibility(@ptr, vis) end |