title: llvmlite Global Variable Gets Pointerized when trying to access it with get_global
body: <p>I am writing a compiler for a programming language I am making in python, I am also using llvmlite to generate ir and object files. For some reason when I use the mod.get_global function it returns the GlobalVariable but it pointerizes it. However it is a string with type i8* and it returns i8** which is making weird results when I try to print it. It also does this with ints, 64 to 64*. I don't know what is going on and I don't know how to fix it. Help would be appreciated.</p>
  <p>Here is my shortend code with the same issue:</p>
  <pre><code>import llvmlite.ir as llvm
  
  int_type = llvm.IntType(64)
  char_type = llvm.IntType(8)
  str_type = llvm.PointerType(char_type)
  
  strid = 0
  def create_str(mod, str):
      global strid
      str += &quot;\0&quot;
      
      typ = llvm.ArrayType(char_type, len(str))
      var = llvm.GlobalVariable(mod, typ, name=f&quot;str.{strid}&quot;)
      var.global_constant = True
      var.unnamed_addr = True
      var.initializer = typ(bytearray(str.encode(&quot;utf8&quot;)))
      strid += 1
      
      return var.gep([int_type(0), int_type(0)])
  
  module = llvm.Module(name=&quot;broken&quot;)
  
  var = llvm.GlobalVariable(module, str_type, name=&quot;brokenvar&quot;)
  var.global_constant = False
  var.unnamed_addr = False
  var.initializer = create_str(module, &quot;Hello, World!&quot;)
  
  # in my program you can no longer access the var variable after this point
  
  print(module.get_global(&quot;brokenvar&quot;).type)
  </code></pre>
  <p>After running this program, instead of getting the expected i8*, i get i8**</p>