   ///
   /// - returns: A value representing the address of a subelement of the given
   ///   struct value.
+  @available(*, deprecated, message: "Use buildStructGEP(type:ptr:index:name) instead")
   public func buildStructGEP(_ ptr: IRValue, index: Int, name: String = "") -> IRValue {
     return LLVMBuildStructGEP(llvm, ptr.asLLVM(), UInt32(index), name)
   }
 
   /// Build a GEP (Get Element Pointer) instruction suitable for indexing into
-  /// a struct. This uses LLVMBuildStructGEP2 from cllvm
+  /// a struct of a given type.
   ///
   /// - parameter ptr: The base address for the index calculation.
-  /// - parameter type: The type of the struct to index into. If nil is specified, the
-  ///   type property of the pointer is used.
+  /// - parameter type: The type of the struct to index into.
   /// - parameter index: The offset from the base for the index calculation.
   /// - parameter name: The name for the newly inserted instruction.
   ///
   /// - returns: A value representing the address of a subelement of the given
   ///   struct value.
-  public func buildStructGEP2(_ ptr: IRValue, type: IRType? = nil, index: Int, name: String = "") -> IRValue {
-    let structType = type ?? ptr.type
-    return LLVMBuildStructGEP2(llvm, structType.asLLVM(), ptr.asLLVM(), UInt32(index), name)
+  public func buildStructGEP(_ ptr: IRValue, type: IRType, index: Int, name: String = "") -> IRValue {
+    return LLVMBuildStructGEP2(llvm, type.asLLVM(), ptr.asLLVM(), UInt32(index), name)
   }
   
   /// Build an ExtractValue instruction to retrieve an indexed value from a

    }
  }

  /// Build a GEP (Get Element Pointer) instruction suitable for indexing into
  /// a struct.
  ///

  ///
  /// - returns: A value representing the address of a subelement of the given
  ///   aggregate data structure value.
  @available(*, deprecated, message: "Use buildInBoundsGEP(type:ptr:indices:name) instead")
  public func buildInBoundsGEP(_ ptr: IRValue, indices: [IRValue], name: String = "") -> IRValue {
    var vals = indices.map { $0.asLLVM() as Optional }
    return vals.withUnsafeMutableBufferPointer { buf in
      return LLVMBuildInBoundsGEP(llvm, ptr.asLLVM(), buf.baseAddress, UInt32(buf.count), name)
    }
  }
  
  /// Build a `GEP` (Get Element Pointer) instruction with a resultant value
  /// that is undefined if the address is outside the actual underlying
  /// allocated object and not the address one-past-the-end.
  ///
  /// The `GEP` instruction is often the source of confusion.  LLVM [provides a
  /// document](http://llvm.org/docs/GetElementPtr.html) to answer questions
  /// around its semantics and correct usage.
  ///
  /// - parameter ptr: The base address for the index calculation.
  /// - parameter type: The type used to calculate pointer offsets.
  /// - parameter indices: A list of indices that indicate which of the elements
  ///   of the aggregate object are indexed.
  /// - parameter name: The name for the newly inserted instruction.
  ///
  /// - returns: A value representing the address of a subelement of the given
  ///   aggregate data structure value.
  public func buildInBoundsGEP(_ ptr: IRValue, type: IRType, indices: [IRValue], name: String = "") -> IRValue {
    var vals = indices.map { $0.asLLVM() as Optional }
    return vals.withUnsafeMutableBufferPointer { buf in
      return LLVMBuildInBoundsGEP2(llvm, type.asLLVM(), ptr.asLLVM(), buf.baseAddress, UInt32(buf.count), name)
    }
  }

  /// Build a GEP (Get Element Pointer) instruction.
  ///
  /// The `GEP` instruction is often the source of confusion.  LLVM [provides a
  /// document](http://llvm.org/docs/GetElementPtr.html) to answer questions
  /// around its semantics and correct usage.
  ///
  /// - parameter ptr: The base address for the index calculation.
  /// - parameter indices: A list of indices that indicate which of the elements
  ///   of the aggregate object are indexed.
  /// - parameter name: The name for the newly inserted instruction.
  ///
  /// - returns: A value representing the address of a subelement of the given
  ///   aggregate data structure value.
  @available(*, deprecated, message: "Use buildGEP(type:ptr:indices:name) instead")
  public func buildGEP(_ ptr: IRValue, indices: [IRValue], name: String = "") -> IRValue {
    var vals = indices.map { $0.asLLVM() as Optional }
    return vals.withUnsafeMutableBufferPointer { buf in
