public TypeRef(LLVMTypeRef* handle) { if(handle == null) throw new ArgumentNullException("handle"); m_handle = handle; }
public TypeRef(LLVMTypeRef* handle, LLVMTypeRef* pointed = null) { if(handle == null) throw new ArgumentNullException("handle"); m_handle = handle; m_pointedType = pointed; }
public TypeRef(LLVMTypeRef *handle, LLVMTypeRef *pointed = null) { if (handle == null) { throw new ArgumentNullException("handle"); } m_handle = handle; m_pointedType = pointed; }
/// <summary> /// Create a function with arguments and a return type. /// </summary> /// <param name="module"></param> /// <param name="name"></param> /// <param name="returnType"></param> /// <param name="paramTypes"></param> public Function(Module module, string name, TypeRef returnType, TypeRef[] paramTypes) { m_name = name; m_returnType = returnType; m_paramTypes = paramTypes; IntPtr[] paramArray = LLVMHelper.MarshallPointerArray(paramTypes); m_funcType = Native.FunctionType(returnType.Handle, paramArray, (uint)paramArray.Length, 0); m_handle = Native.AddFunction(module.Handle, name, m_funcType); }
public Function(string name, LLVMValueRef* handle) { m_name = name; m_handle = handle; m_funcType = Native.GetElementType(Native.TypeOf(handle)); m_returnType = new TypeRef(Native.GetReturnType(m_funcType)); uint paramCount = Native.CountParamTypes(m_funcType); m_paramTypes = new TypeRef[paramCount]; if(paramCount > 0) { IntPtr[] types = new IntPtr[paramCount]; Native.GetParamTypes(m_funcType, types); for(int i = 0; i < paramCount; ++i) { m_paramTypes[i] = new TypeRef((LLVMTypeRef*)types[i]); } } }
public Function(string name, LLVMValueRef *handle) { m_name = name; m_handle = handle; m_funcType = Native.GetElementType(Native.TypeOf(handle)); m_returnType = new TypeRef(Native.GetReturnType(m_funcType)); uint paramCount = Native.CountParamTypes(m_funcType); m_paramTypes = new TypeRef[paramCount]; if (paramCount > 0) { IntPtr[] types = new IntPtr[paramCount]; Native.GetParamTypes(m_funcType, types); for (int i = 0; i < paramCount; ++i) { m_paramTypes[i] = new TypeRef((LLVMTypeRef *)types[i]); } } }
public string GetLLVMType() { LLVMTypeRef *type = Native.TypeOf(this.Handle); return(Native.GetTypeKind(type).ToString()); }
public static String GetType(Value val) { LLVMTypeRef *type = Native.TypeOf(val.Handle); return(Native.GetTypeKind(type).ToString()); }