Class: LLVM::GlobalVariable

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

Instance Attribute Summary

Attributes included from PointerIdentity

#ptr

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, #int_to_ptr, 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



1261
1262
1263
# File 'lib/llvm/core/value.rb', line 1261

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

#externally_initialized?Boolean

: -> bool

Returns:

  • (Boolean)


1257
1258
1259
# File 'lib/llvm/core/value.rb', line 1257

def externally_initialized?
  C.is_externally_initialized(self)
end

#global_constant=(flag) ⇒ Object



1247
1248
1249
1250
1251
1252
1253
1254
# File 'lib/llvm/core/value.rb', line 1247

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

: -> bool

Returns:

  • (Boolean)


1243
1244
1245
# File 'lib/llvm/core/value.rb', line 1243

def global_constant?
  C.is_global_constant(self)
end

#initializerObject



1223
1224
1225
# File 'lib/llvm/core/value.rb', line 1223

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

#initializer=(val) ⇒ Object

Raises:

  • (ArgumentError)


1227
1228
1229
1230
1231
# File 'lib/llvm/core/value.rb', line 1227

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

  C.set_initializer(self, val)
end

#thread_local=(local) ⇒ Object



1238
1239
1240
# File 'lib/llvm/core/value.rb', line 1238

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

#thread_local?Boolean

: -> bool

Returns:

  • (Boolean)


1234
1235
1236
# File 'lib/llvm/core/value.rb', line 1234

def thread_local?
  C.is_thread_local(self)
end