forked from OSchip/llvm-project
Adopting a uniform naming convention for type constructors in bindings.
llvm-svn: 42698
This commit is contained in:
parent
1046c73d12
commit
ed7beaa3fa
|
@ -74,7 +74,7 @@ CAMLprim LLVMTypeRef llvm_i64_type(value Unit) { return LLVMInt64Type(); }
|
||||||
|
|
||||||
/* int -> lltype */
|
/* int -> lltype */
|
||||||
CAMLprim LLVMTypeRef llvm_make_integer_type(value Width) {
|
CAMLprim LLVMTypeRef llvm_make_integer_type(value Width) {
|
||||||
return LLVMCreateIntType(Int_val(Width));
|
return LLVMIntType(Int_val(Width));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* lltype -> int */
|
/* lltype -> int */
|
||||||
|
@ -114,9 +114,9 @@ CAMLprim LLVMTypeRef llvm_ppc_fp128_type(value Unit) {
|
||||||
/* lltype -> lltype array -> bool -> lltype */
|
/* lltype -> lltype array -> bool -> lltype */
|
||||||
CAMLprim LLVMTypeRef llvm_make_function_type(LLVMTypeRef RetTy, value ParamTys,
|
CAMLprim LLVMTypeRef llvm_make_function_type(LLVMTypeRef RetTy, value ParamTys,
|
||||||
value IsVarArg) {
|
value IsVarArg) {
|
||||||
return LLVMCreateFunctionType(RetTy, (LLVMTypeRef *) ParamTys,
|
return LLVMFunctionType(RetTy, (LLVMTypeRef *) ParamTys,
|
||||||
Wosize_val(ParamTys),
|
Wosize_val(ParamTys),
|
||||||
Bool_val(IsVarArg));
|
Bool_val(IsVarArg));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* lltype -> bool */
|
/* lltype -> bool */
|
||||||
|
@ -140,9 +140,9 @@ CAMLprim value llvm_param_types(LLVMTypeRef FunTy) {
|
||||||
|
|
||||||
/* lltype array -> bool -> lltype */
|
/* lltype array -> bool -> lltype */
|
||||||
CAMLprim LLVMTypeRef llvm_make_struct_type(value ElementTypes, value Packed) {
|
CAMLprim LLVMTypeRef llvm_make_struct_type(value ElementTypes, value Packed) {
|
||||||
return LLVMCreateStructType((LLVMTypeRef *) ElementTypes,
|
return LLVMStructType((LLVMTypeRef *) ElementTypes,
|
||||||
Wosize_val(ElementTypes),
|
Wosize_val(ElementTypes),
|
||||||
Bool_val(Packed));
|
Bool_val(Packed));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* lltype -> lltype array */
|
/* lltype -> lltype array */
|
||||||
|
@ -161,17 +161,17 @@ CAMLprim value llvm_is_packed(LLVMTypeRef StructTy) {
|
||||||
|
|
||||||
/* lltype -> int -> lltype */
|
/* lltype -> int -> lltype */
|
||||||
CAMLprim LLVMTypeRef llvm_make_array_type(LLVMTypeRef ElementTy, value Count) {
|
CAMLprim LLVMTypeRef llvm_make_array_type(LLVMTypeRef ElementTy, value Count) {
|
||||||
return LLVMCreateArrayType(ElementTy, Int_val(Count));
|
return LLVMArrayType(ElementTy, Int_val(Count));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* lltype -> lltype */
|
/* lltype -> lltype */
|
||||||
CAMLprim LLVMTypeRef llvm_make_pointer_type(LLVMTypeRef ElementTy) {
|
CAMLprim LLVMTypeRef llvm_make_pointer_type(LLVMTypeRef ElementTy) {
|
||||||
return LLVMCreatePointerType(ElementTy);
|
return LLVMPointerType(ElementTy);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* lltype -> int -> lltype */
|
/* lltype -> int -> lltype */
|
||||||
CAMLprim LLVMTypeRef llvm_make_vector_type(LLVMTypeRef ElementTy, value Count) {
|
CAMLprim LLVMTypeRef llvm_make_vector_type(LLVMTypeRef ElementTy, value Count) {
|
||||||
return LLVMCreateVectorType(ElementTy, Int_val(Count));
|
return LLVMVectorType(ElementTy, Int_val(Count));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* lltype -> lltype */
|
/* lltype -> lltype */
|
||||||
|
@ -197,7 +197,7 @@ CAMLprim LLVMTypeRef llvm_label_type(value Unit) { return LLVMLabelType(); }
|
||||||
|
|
||||||
/* unit -> lltype */
|
/* unit -> lltype */
|
||||||
CAMLprim LLVMTypeRef llvm_make_opaque_type(value Unit) {
|
CAMLprim LLVMTypeRef llvm_make_opaque_type(value Unit) {
|
||||||
return LLVMCreateOpaqueType();
|
return LLVMOpaqueType();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -164,7 +164,7 @@ LLVMTypeRef LLVMInt8Type();
|
||||||
LLVMTypeRef LLVMInt16Type();
|
LLVMTypeRef LLVMInt16Type();
|
||||||
LLVMTypeRef LLVMInt32Type();
|
LLVMTypeRef LLVMInt32Type();
|
||||||
LLVMTypeRef LLVMInt64Type();
|
LLVMTypeRef LLVMInt64Type();
|
||||||
LLVMTypeRef LLVMCreateIntType(unsigned NumBits);
|
LLVMTypeRef LLVMIntType(unsigned NumBits);
|
||||||
unsigned LLVMGetIntTypeWidth(LLVMTypeRef IntegerTy);
|
unsigned LLVMGetIntTypeWidth(LLVMTypeRef IntegerTy);
|
||||||
|
|
||||||
/* Operations on real types */
|
/* Operations on real types */
|
||||||
|
@ -175,25 +175,25 @@ LLVMTypeRef LLVMFP128Type();
|
||||||
LLVMTypeRef LLVMPPCFP128Type();
|
LLVMTypeRef LLVMPPCFP128Type();
|
||||||
|
|
||||||
/* Operations on function types */
|
/* Operations on function types */
|
||||||
LLVMTypeRef LLVMCreateFunctionType(LLVMTypeRef ReturnType,
|
LLVMTypeRef LLVMFunctionType(LLVMTypeRef ReturnType,
|
||||||
LLVMTypeRef *ParamTypes, unsigned ParamCount,
|
LLVMTypeRef *ParamTypes, unsigned ParamCount,
|
||||||
int IsVarArg);
|
int IsVarArg);
|
||||||
int LLVMIsFunctionVarArg(LLVMTypeRef FunctionTy);
|
int LLVMIsFunctionVarArg(LLVMTypeRef FunctionTy);
|
||||||
LLVMTypeRef LLVMGetReturnType(LLVMTypeRef FunctionTy);
|
LLVMTypeRef LLVMGetReturnType(LLVMTypeRef FunctionTy);
|
||||||
unsigned LLVMCountParamTypes(LLVMTypeRef FunctionTy);
|
unsigned LLVMCountParamTypes(LLVMTypeRef FunctionTy);
|
||||||
void LLVMGetParamTypes(LLVMTypeRef FunctionTy, LLVMTypeRef *Dest);
|
void LLVMGetParamTypes(LLVMTypeRef FunctionTy, LLVMTypeRef *Dest);
|
||||||
|
|
||||||
/* Operations on struct types */
|
/* Operations on struct types */
|
||||||
LLVMTypeRef LLVMCreateStructType(LLVMTypeRef *ElementTypes,
|
LLVMTypeRef LLVMStructType(LLVMTypeRef *ElementTypes, unsigned ElementCount,
|
||||||
unsigned ElementCount, int Packed);
|
int Packed);
|
||||||
unsigned LLVMCountStructElementTypes(LLVMTypeRef StructTy);
|
unsigned LLVMCountStructElementTypes(LLVMTypeRef StructTy);
|
||||||
void LLVMGetStructElementTypes(LLVMTypeRef StructTy, LLVMTypeRef *Dest);
|
void LLVMGetStructElementTypes(LLVMTypeRef StructTy, LLVMTypeRef *Dest);
|
||||||
int LLVMIsPackedStruct(LLVMTypeRef StructTy);
|
int LLVMIsPackedStruct(LLVMTypeRef StructTy);
|
||||||
|
|
||||||
/* Operations on array, pointer, and vector types (sequence types) */
|
/* Operations on array, pointer, and vector types (sequence types) */
|
||||||
LLVMTypeRef LLVMCreateArrayType(LLVMTypeRef ElementType, unsigned ElementCount);
|
LLVMTypeRef LLVMArrayType(LLVMTypeRef ElementType, unsigned ElementCount);
|
||||||
LLVMTypeRef LLVMCreatePointerType(LLVMTypeRef ElementType);
|
LLVMTypeRef LLVMPointerType(LLVMTypeRef ElementType);
|
||||||
LLVMTypeRef LLVMCreateVectorType(LLVMTypeRef ElementType,unsigned ElementCount);
|
LLVMTypeRef LLVMVectorType(LLVMTypeRef ElementType, unsigned ElementCount);
|
||||||
|
|
||||||
LLVMTypeRef LLVMGetElementType(LLVMTypeRef Ty);
|
LLVMTypeRef LLVMGetElementType(LLVMTypeRef Ty);
|
||||||
unsigned LLVMGetArrayLength(LLVMTypeRef ArrayTy);
|
unsigned LLVMGetArrayLength(LLVMTypeRef ArrayTy);
|
||||||
|
@ -202,7 +202,7 @@ unsigned LLVMGetVectorSize(LLVMTypeRef VectorTy);
|
||||||
/* Operations on other types */
|
/* Operations on other types */
|
||||||
LLVMTypeRef LLVMVoidType();
|
LLVMTypeRef LLVMVoidType();
|
||||||
LLVMTypeRef LLVMLabelType();
|
LLVMTypeRef LLVMLabelType();
|
||||||
LLVMTypeRef LLVMCreateOpaqueType();
|
LLVMTypeRef LLVMOpaqueType();
|
||||||
|
|
||||||
|
|
||||||
/*===-- Values ------------------------------------------------------------===*/
|
/*===-- Values ------------------------------------------------------------===*/
|
||||||
|
|
|
@ -68,7 +68,7 @@ LLVMTypeRef LLVMInt16Type() { return (LLVMTypeRef) Type::Int16Ty; }
|
||||||
LLVMTypeRef LLVMInt32Type() { return (LLVMTypeRef) Type::Int32Ty; }
|
LLVMTypeRef LLVMInt32Type() { return (LLVMTypeRef) Type::Int32Ty; }
|
||||||
LLVMTypeRef LLVMInt64Type() { return (LLVMTypeRef) Type::Int64Ty; }
|
LLVMTypeRef LLVMInt64Type() { return (LLVMTypeRef) Type::Int64Ty; }
|
||||||
|
|
||||||
LLVMTypeRef LLVMCreateIntType(unsigned NumBits) {
|
LLVMTypeRef LLVMIntType(unsigned NumBits) {
|
||||||
return wrap(IntegerType::get(NumBits));
|
return wrap(IntegerType::get(NumBits));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -86,9 +86,9 @@ LLVMTypeRef LLVMPPCFP128Type() { return (LLVMTypeRef) Type::PPC_FP128Ty; }
|
||||||
|
|
||||||
/*--.. Operations on function types ........................................--*/
|
/*--.. Operations on function types ........................................--*/
|
||||||
|
|
||||||
LLVMTypeRef LLVMCreateFunctionType(LLVMTypeRef ReturnType,
|
LLVMTypeRef LLVMFunctionType(LLVMTypeRef ReturnType,
|
||||||
LLVMTypeRef *ParamTypes, unsigned ParamCount,
|
LLVMTypeRef *ParamTypes, unsigned ParamCount,
|
||||||
int IsVarArg) {
|
int IsVarArg) {
|
||||||
std::vector<const Type*> Tys;
|
std::vector<const Type*> Tys;
|
||||||
for (LLVMTypeRef *I = ParamTypes, *E = ParamTypes + ParamCount; I != E; ++I)
|
for (LLVMTypeRef *I = ParamTypes, *E = ParamTypes + ParamCount; I != E; ++I)
|
||||||
Tys.push_back(unwrap(*I));
|
Tys.push_back(unwrap(*I));
|
||||||
|
@ -117,8 +117,8 @@ void LLVMGetParamTypes(LLVMTypeRef FunctionTy, LLVMTypeRef *Dest) {
|
||||||
|
|
||||||
/*--.. Operations on struct types ..........................................--*/
|
/*--.. Operations on struct types ..........................................--*/
|
||||||
|
|
||||||
LLVMTypeRef LLVMCreateStructType(LLVMTypeRef *ElementTypes,
|
LLVMTypeRef LLVMStructType(LLVMTypeRef *ElementTypes,
|
||||||
unsigned ElementCount, int Packed) {
|
unsigned ElementCount, int Packed) {
|
||||||
std::vector<const Type*> Tys;
|
std::vector<const Type*> Tys;
|
||||||
for (LLVMTypeRef *I = ElementTypes,
|
for (LLVMTypeRef *I = ElementTypes,
|
||||||
*E = ElementTypes + ElementCount; I != E; ++I)
|
*E = ElementTypes + ElementCount; I != E; ++I)
|
||||||
|
@ -144,15 +144,15 @@ int LLVMIsPackedStruct(LLVMTypeRef StructTy) {
|
||||||
|
|
||||||
/*--.. Operations on array, pointer, and vector types (sequence types) .....--*/
|
/*--.. Operations on array, pointer, and vector types (sequence types) .....--*/
|
||||||
|
|
||||||
LLVMTypeRef LLVMCreateArrayType(LLVMTypeRef ElementType, unsigned ElementCount){
|
LLVMTypeRef LLVMArrayType(LLVMTypeRef ElementType, unsigned ElementCount){
|
||||||
return wrap(ArrayType::get(unwrap(ElementType), ElementCount));
|
return wrap(ArrayType::get(unwrap(ElementType), ElementCount));
|
||||||
}
|
}
|
||||||
|
|
||||||
LLVMTypeRef LLVMCreatePointerType(LLVMTypeRef ElementType) {
|
LLVMTypeRef LLVMPointerType(LLVMTypeRef ElementType) {
|
||||||
return wrap(PointerType::get(unwrap(ElementType)));
|
return wrap(PointerType::get(unwrap(ElementType)));
|
||||||
}
|
}
|
||||||
|
|
||||||
LLVMTypeRef LLVMCreateVectorType(LLVMTypeRef ElementType,unsigned ElementCount){
|
LLVMTypeRef LLVMVectorType(LLVMTypeRef ElementType,unsigned ElementCount){
|
||||||
return wrap(VectorType::get(unwrap(ElementType), ElementCount));
|
return wrap(VectorType::get(unwrap(ElementType), ElementCount));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -173,7 +173,7 @@ unsigned LLVMGetVectorSize(LLVMTypeRef VectorTy) {
|
||||||
LLVMTypeRef LLVMVoidType() { return (LLVMTypeRef) Type::VoidTy; }
|
LLVMTypeRef LLVMVoidType() { return (LLVMTypeRef) Type::VoidTy; }
|
||||||
LLVMTypeRef LLVMLabelType() { return (LLVMTypeRef) Type::LabelTy; }
|
LLVMTypeRef LLVMLabelType() { return (LLVMTypeRef) Type::LabelTy; }
|
||||||
|
|
||||||
LLVMTypeRef LLVMCreateOpaqueType() {
|
LLVMTypeRef LLVMOpaqueType() {
|
||||||
return wrap(llvm::OpaqueType::get());
|
return wrap(llvm::OpaqueType::get());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue