Class: LLVM::GlobalVariable

Inherits:
GlobalValue show all
Defined in:
lib/llvm/core/value.rb

Instance Method Summary collapse

Methods inherited from GlobalValue

#alignment, #alignment=, #declaration?, #dll_storage_class, #dll_storage_class=, #linkage, #linkage=, #section, #section=, #unnamed_addr=, #unnamed_addr?, #visibility, #visibility=

Methods inherited from Constant

#bitcast_to, #gep, null, null_ptr, poison, #ptr_to_int, undef

Methods inherited from User

#operands

Methods inherited from Value

#add_attribute, #allocated_type, #allocated_type?, #constant?, #dump, from_ptr, from_ptr_kind, #gep_source_element_type, #gep_source_element_type?, #global_parent, #kind, #name, #name=, #null?, #poison?, #remove_attribute, to_ptr, #to_s, type, #type, #undef?

Methods included from PointerIdentity

#==, #eql?, #hash, #to_ptr

Instance Method Details

#externally_initialized=(boolean) ⇒ Object



1180
1181
1182
# File 'lib/llvm/core/value.rb', line 1180

def externally_initialized=(boolean)
  C.set_externally_initialized(self, boolean)
end

#externally_initialized?Boolean

Returns:

  • (Boolean)


1176
1177
1178
# File 'lib/llvm/core/value.rb', line 1176

def externally_initialized?
  C.is_externally_initialized(self)
end

#global_constant=(flag) ⇒ Object



1167
1168
1169
1170
1171
1172
1173
1174
# File 'lib/llvm/core/value.rb', line 1167

def global_constant=(flag)
  if flag.kind_of?(Integer)
    warn 'Warning: Passing Integer value to LLVM::GlobalValue#global_constant=(Boolean) is deprecated.'
    flag = !flag.zero?
  end

  C.set_global_constant(self, flag ? 1 : 0)
end

#global_constant?Boolean

Returns:

  • (Boolean)


1163
1164
1165
# File 'lib/llvm/core/value.rb', line 1163

def global_constant?
  C.is_global_constant(self)
end

#initializerObject



1145
1146
1147
# File 'lib/llvm/core/value.rb', line 1145

def initializer
  Value.from_ptr(C.get_initializer(self))
end

#initializer=(val) ⇒ Object

Raises:

  • (ArgumentError)


1149
1150
1151
1152
1153
# File 'lib/llvm/core/value.rb', line 1149

def initializer=(val)
  raise ArgumentError unless val.is_a? Constant

  C.set_initializer(self, val)
end

#thread_local=(local) ⇒ Object



1159
1160
1161
# File 'lib/llvm/core/value.rb', line 1159

def thread_local=(local)
  C.set_thread_local(self, local ? 1 : 0)
end

#thread_local?Boolean

Returns:

  • (Boolean)


1155
1156
1157
# File 'lib/llvm/core/value.rb', line 1155

def thread_local?
  C.is_thread_local(self)
end