From 81a788176ecf158432af2b208b0a85321e5ec74a Mon Sep 17 00:00:00 2001 From: Gordon Henriksen Date: Sat, 6 Oct 2007 16:05:20 +0000 Subject: [PATCH] Adopting a uniform naming convention for type constructors in bindings. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42698 91177308-0d34-0410-b5e6-96231b3b80d8 --- bindings/ocaml/llvm/llvm_ocaml.c | 22 +++++++++++----------- include/llvm-c/Core.h | 20 ++++++++++---------- lib/VMCore/Core.cpp | 20 ++++++++++---------- 3 files changed, 31 insertions(+), 31 deletions(-) diff --git a/bindings/ocaml/llvm/llvm_ocaml.c b/bindings/ocaml/llvm/llvm_ocaml.c index 6460930eb50..0005bee9b75 100644 --- a/bindings/ocaml/llvm/llvm_ocaml.c +++ b/bindings/ocaml/llvm/llvm_ocaml.c @@ -74,7 +74,7 @@ CAMLprim LLVMTypeRef llvm_i64_type(value Unit) { return LLVMInt64Type(); } /* int -> lltype */ CAMLprim LLVMTypeRef llvm_make_integer_type(value Width) { - return LLVMCreateIntType(Int_val(Width)); + return LLVMIntType(Int_val(Width)); } /* lltype -> int */ @@ -114,9 +114,9 @@ CAMLprim LLVMTypeRef llvm_ppc_fp128_type(value Unit) { /* lltype -> lltype array -> bool -> lltype */ CAMLprim LLVMTypeRef llvm_make_function_type(LLVMTypeRef RetTy, value ParamTys, value IsVarArg) { - return LLVMCreateFunctionType(RetTy, (LLVMTypeRef *) ParamTys, - Wosize_val(ParamTys), - Bool_val(IsVarArg)); + return LLVMFunctionType(RetTy, (LLVMTypeRef *) ParamTys, + Wosize_val(ParamTys), + Bool_val(IsVarArg)); } /* lltype -> bool */ @@ -140,9 +140,9 @@ CAMLprim value llvm_param_types(LLVMTypeRef FunTy) { /* lltype array -> bool -> lltype */ CAMLprim LLVMTypeRef llvm_make_struct_type(value ElementTypes, value Packed) { - return LLVMCreateStructType((LLVMTypeRef *) ElementTypes, - Wosize_val(ElementTypes), - Bool_val(Packed)); + return LLVMStructType((LLVMTypeRef *) ElementTypes, + Wosize_val(ElementTypes), + Bool_val(Packed)); } /* lltype -> lltype array */ @@ -161,17 +161,17 @@ CAMLprim value llvm_is_packed(LLVMTypeRef StructTy) { /* lltype -> int -> lltype */ CAMLprim LLVMTypeRef llvm_make_array_type(LLVMTypeRef ElementTy, value Count) { - return LLVMCreateArrayType(ElementTy, Int_val(Count)); + return LLVMArrayType(ElementTy, Int_val(Count)); } /* lltype -> lltype */ CAMLprim LLVMTypeRef llvm_make_pointer_type(LLVMTypeRef ElementTy) { - return LLVMCreatePointerType(ElementTy); + return LLVMPointerType(ElementTy); } /* lltype -> int -> lltype */ CAMLprim LLVMTypeRef llvm_make_vector_type(LLVMTypeRef ElementTy, value Count) { - return LLVMCreateVectorType(ElementTy, Int_val(Count)); + return LLVMVectorType(ElementTy, Int_val(Count)); } /* lltype -> lltype */ @@ -197,7 +197,7 @@ CAMLprim LLVMTypeRef llvm_label_type(value Unit) { return LLVMLabelType(); } /* unit -> lltype */ CAMLprim LLVMTypeRef llvm_make_opaque_type(value Unit) { - return LLVMCreateOpaqueType(); + return LLVMOpaqueType(); } diff --git a/include/llvm-c/Core.h b/include/llvm-c/Core.h index f197d256eb6..d839e0c9cf5 100644 --- a/include/llvm-c/Core.h +++ b/include/llvm-c/Core.h @@ -164,7 +164,7 @@ LLVMTypeRef LLVMInt8Type(); LLVMTypeRef LLVMInt16Type(); LLVMTypeRef LLVMInt32Type(); LLVMTypeRef LLVMInt64Type(); -LLVMTypeRef LLVMCreateIntType(unsigned NumBits); +LLVMTypeRef LLVMIntType(unsigned NumBits); unsigned LLVMGetIntTypeWidth(LLVMTypeRef IntegerTy); /* Operations on real types */ @@ -175,25 +175,25 @@ LLVMTypeRef LLVMFP128Type(); LLVMTypeRef LLVMPPCFP128Type(); /* Operations on function types */ -LLVMTypeRef LLVMCreateFunctionType(LLVMTypeRef ReturnType, - LLVMTypeRef *ParamTypes, unsigned ParamCount, - int IsVarArg); +LLVMTypeRef LLVMFunctionType(LLVMTypeRef ReturnType, + LLVMTypeRef *ParamTypes, unsigned ParamCount, + int IsVarArg); int LLVMIsFunctionVarArg(LLVMTypeRef FunctionTy); LLVMTypeRef LLVMGetReturnType(LLVMTypeRef FunctionTy); unsigned LLVMCountParamTypes(LLVMTypeRef FunctionTy); void LLVMGetParamTypes(LLVMTypeRef FunctionTy, LLVMTypeRef *Dest); /* Operations on struct types */ -LLVMTypeRef LLVMCreateStructType(LLVMTypeRef *ElementTypes, - unsigned ElementCount, int Packed); +LLVMTypeRef LLVMStructType(LLVMTypeRef *ElementTypes, unsigned ElementCount, + int Packed); unsigned LLVMCountStructElementTypes(LLVMTypeRef StructTy); void LLVMGetStructElementTypes(LLVMTypeRef StructTy, LLVMTypeRef *Dest); int LLVMIsPackedStruct(LLVMTypeRef StructTy); /* Operations on array, pointer, and vector types (sequence types) */ -LLVMTypeRef LLVMCreateArrayType(LLVMTypeRef ElementType, unsigned ElementCount); -LLVMTypeRef LLVMCreatePointerType(LLVMTypeRef ElementType); -LLVMTypeRef LLVMCreateVectorType(LLVMTypeRef ElementType,unsigned ElementCount); +LLVMTypeRef LLVMArrayType(LLVMTypeRef ElementType, unsigned ElementCount); +LLVMTypeRef LLVMPointerType(LLVMTypeRef ElementType); +LLVMTypeRef LLVMVectorType(LLVMTypeRef ElementType, unsigned ElementCount); LLVMTypeRef LLVMGetElementType(LLVMTypeRef Ty); unsigned LLVMGetArrayLength(LLVMTypeRef ArrayTy); @@ -202,7 +202,7 @@ unsigned LLVMGetVectorSize(LLVMTypeRef VectorTy); /* Operations on other types */ LLVMTypeRef LLVMVoidType(); LLVMTypeRef LLVMLabelType(); -LLVMTypeRef LLVMCreateOpaqueType(); +LLVMTypeRef LLVMOpaqueType(); /*===-- Values ------------------------------------------------------------===*/ diff --git a/lib/VMCore/Core.cpp b/lib/VMCore/Core.cpp index 1bb8c1784fb..10b226cc7c2 100644 --- a/lib/VMCore/Core.cpp +++ b/lib/VMCore/Core.cpp @@ -68,7 +68,7 @@ LLVMTypeRef LLVMInt16Type() { return (LLVMTypeRef) Type::Int16Ty; } LLVMTypeRef LLVMInt32Type() { return (LLVMTypeRef) Type::Int32Ty; } LLVMTypeRef LLVMInt64Type() { return (LLVMTypeRef) Type::Int64Ty; } -LLVMTypeRef LLVMCreateIntType(unsigned NumBits) { +LLVMTypeRef LLVMIntType(unsigned NumBits) { return wrap(IntegerType::get(NumBits)); } @@ -86,9 +86,9 @@ LLVMTypeRef LLVMPPCFP128Type() { return (LLVMTypeRef) Type::PPC_FP128Ty; } /*--.. Operations on function types ........................................--*/ -LLVMTypeRef LLVMCreateFunctionType(LLVMTypeRef ReturnType, - LLVMTypeRef *ParamTypes, unsigned ParamCount, - int IsVarArg) { +LLVMTypeRef LLVMFunctionType(LLVMTypeRef ReturnType, + LLVMTypeRef *ParamTypes, unsigned ParamCount, + int IsVarArg) { std::vector Tys; for (LLVMTypeRef *I = ParamTypes, *E = ParamTypes + ParamCount; I != E; ++I) Tys.push_back(unwrap(*I)); @@ -117,8 +117,8 @@ void LLVMGetParamTypes(LLVMTypeRef FunctionTy, LLVMTypeRef *Dest) { /*--.. Operations on struct types ..........................................--*/ -LLVMTypeRef LLVMCreateStructType(LLVMTypeRef *ElementTypes, - unsigned ElementCount, int Packed) { +LLVMTypeRef LLVMStructType(LLVMTypeRef *ElementTypes, + unsigned ElementCount, int Packed) { std::vector Tys; for (LLVMTypeRef *I = ElementTypes, *E = ElementTypes + ElementCount; I != E; ++I) @@ -144,15 +144,15 @@ int LLVMIsPackedStruct(LLVMTypeRef StructTy) { /*--.. 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)); } -LLVMTypeRef LLVMCreatePointerType(LLVMTypeRef ElementType) { +LLVMTypeRef LLVMPointerType(LLVMTypeRef 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)); } @@ -173,7 +173,7 @@ unsigned LLVMGetVectorSize(LLVMTypeRef VectorTy) { LLVMTypeRef LLVMVoidType() { return (LLVMTypeRef) Type::VoidTy; } LLVMTypeRef LLVMLabelType() { return (LLVMTypeRef) Type::LabelTy; } -LLVMTypeRef LLVMCreateOpaqueType() { +LLVMTypeRef LLVMOpaqueType() { return wrap(llvm::OpaqueType::get()); } -- 2.34.1