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



1167
1168
1169
# File 'lib/llvm/core/value.rb', line 1167

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

#externally_initialized?Boolean

Returns:

  • (Boolean)


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

def externally_initialized?
  C.is_externally_initialized(self)
end

#global_constant=(flag) ⇒ Object



1154
1155
1156
1157
1158
1159
1160
1161
# File 'lib/llvm/core/value.rb', line 1154

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)


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

def global_constant?
  C.is_global_constant(self)
end

#initializerObject



1132
1133
1134
# File 'lib/llvm/core/value.rb', line 1132

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

#initializer=(val) ⇒ Object

Raises:

  • (ArgumentError)


1136
1137
1138
1139
1140
# File 'lib/llvm/core/value.rb', line 1136

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

  C.set_initializer(self, val)
end

#thread_local=(local) ⇒ Object



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

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

#thread_local?Boolean

Returns:

  • (Boolean)


1142
1143
1144
# File 'lib/llvm/core/value.rb', line 1142

def thread_local?
  C.is_thread_local(self)
end