extern {
/* Create and destroy contexts. */
#[fast_ffi]
- pub unsafe fn LLVMContextCreate() -> ContextRef;
+ pub fn LLVMContextCreate() -> ContextRef;
#[fast_ffi]
- pub unsafe fn LLVMContextDispose(C: ContextRef);
+ pub fn LLVMContextDispose(C: ContextRef);
#[fast_ffi]
- pub unsafe fn LLVMGetMDKindIDInContext(C: ContextRef,
- Name: *c_char,
- SLen: c_uint)
+ pub fn LLVMGetMDKindIDInContext(C: ContextRef,
+ Name: *c_char,
+ SLen: c_uint)
-> c_uint;
/* Create and destroy modules. */
#[fast_ffi]
- pub unsafe fn LLVMModuleCreateWithNameInContext(ModuleID: *c_char,
- C: ContextRef)
+ pub fn LLVMModuleCreateWithNameInContext(ModuleID: *c_char,
+ C: ContextRef)
-> ModuleRef;
#[fast_ffi]
- pub unsafe fn LLVMGetModuleContext(M: ModuleRef) -> ContextRef;
+ pub fn LLVMGetModuleContext(M: ModuleRef) -> ContextRef;
#[fast_ffi]
- pub unsafe fn LLVMDisposeModule(M: ModuleRef);
+ pub fn LLVMDisposeModule(M: ModuleRef);
/** Data layout. See Module::getDataLayout. */
#[fast_ffi]
- pub unsafe fn LLVMGetDataLayout(M: ModuleRef) -> *c_char;
+ pub fn LLVMGetDataLayout(M: ModuleRef) -> *c_char;
#[fast_ffi]
- pub unsafe fn LLVMSetDataLayout(M: ModuleRef, Triple: *c_char);
+ pub fn LLVMSetDataLayout(M: ModuleRef, Triple: *c_char);
/** Target triple. See Module::getTargetTriple. */
#[fast_ffi]
- pub unsafe fn LLVMGetTarget(M: ModuleRef) -> *c_char;
+ pub fn LLVMGetTarget(M: ModuleRef) -> *c_char;
#[fast_ffi]
- pub unsafe fn LLVMSetTarget(M: ModuleRef, Triple: *c_char);
+ pub fn LLVMSetTarget(M: ModuleRef, Triple: *c_char);
/** See Module::dump. */
#[fast_ffi]
- pub unsafe fn LLVMDumpModule(M: ModuleRef);
+ pub fn LLVMDumpModule(M: ModuleRef);
/** See Module::setModuleInlineAsm. */
#[fast_ffi]
- pub unsafe fn LLVMSetModuleInlineAsm(M: ModuleRef, Asm: *c_char);
+ pub fn LLVMSetModuleInlineAsm(M: ModuleRef, Asm: *c_char);
/** See llvm::LLVMTypeKind::getTypeID. */
- pub unsafe fn LLVMGetTypeKind(Ty: TypeRef) -> TypeKind;
+ pub fn LLVMGetTypeKind(Ty: TypeRef) -> TypeKind;
/** See llvm::LLVMType::getContext. */
#[fast_ffi]
- pub unsafe fn LLVMGetTypeContext(Ty: TypeRef) -> ContextRef;
+ pub fn LLVMGetTypeContext(Ty: TypeRef) -> ContextRef;
/* Operations on integer types */
#[fast_ffi]
- pub unsafe fn LLVMInt1TypeInContext(C: ContextRef) -> TypeRef;
+ pub fn LLVMInt1TypeInContext(C: ContextRef) -> TypeRef;
#[fast_ffi]
- pub unsafe fn LLVMInt8TypeInContext(C: ContextRef) -> TypeRef;
+ pub fn LLVMInt8TypeInContext(C: ContextRef) -> TypeRef;
#[fast_ffi]
- pub unsafe fn LLVMInt16TypeInContext(C: ContextRef) -> TypeRef;
+ pub fn LLVMInt16TypeInContext(C: ContextRef) -> TypeRef;
#[fast_ffi]
- pub unsafe fn LLVMInt32TypeInContext(C: ContextRef) -> TypeRef;
+ pub fn LLVMInt32TypeInContext(C: ContextRef) -> TypeRef;
#[fast_ffi]
- pub unsafe fn LLVMInt64TypeInContext(C: ContextRef) -> TypeRef;
+ pub fn LLVMInt64TypeInContext(C: ContextRef) -> TypeRef;
#[fast_ffi]
- pub unsafe fn LLVMIntTypeInContext(C: ContextRef,
- NumBits: c_uint) -> TypeRef;
+ pub fn LLVMIntTypeInContext(C: ContextRef, NumBits: c_uint)
+ -> TypeRef;
#[fast_ffi]
- pub unsafe fn LLVMGetIntTypeWidth(IntegerTy: TypeRef) -> c_uint;
+ pub fn LLVMGetIntTypeWidth(IntegerTy: TypeRef) -> c_uint;
/* Operations on real types */
#[fast_ffi]
- pub unsafe fn LLVMFloatTypeInContext(C: ContextRef) -> TypeRef;
+ pub fn LLVMFloatTypeInContext(C: ContextRef) -> TypeRef;
#[fast_ffi]
- pub unsafe fn LLVMDoubleTypeInContext(C: ContextRef) -> TypeRef;
+ pub fn LLVMDoubleTypeInContext(C: ContextRef) -> TypeRef;
#[fast_ffi]
- pub unsafe fn LLVMX86FP80TypeInContext(C: ContextRef) -> TypeRef;
+ pub fn LLVMX86FP80TypeInContext(C: ContextRef) -> TypeRef;
#[fast_ffi]
- pub unsafe fn LLVMFP128TypeInContext(C: ContextRef) -> TypeRef;
+ pub fn LLVMFP128TypeInContext(C: ContextRef) -> TypeRef;
#[fast_ffi]
- pub unsafe fn LLVMPPCFP128TypeInContext(C: ContextRef) -> TypeRef;
+ pub fn LLVMPPCFP128TypeInContext(C: ContextRef) -> TypeRef;
/* Operations on function types */
#[fast_ffi]
- pub unsafe fn LLVMFunctionType(ReturnType: TypeRef,
- ParamTypes: *TypeRef,
- ParamCount: c_uint,
- IsVarArg: Bool)
- -> TypeRef;
+ pub fn LLVMFunctionType(ReturnType: TypeRef,
+ ParamTypes: *TypeRef,
+ ParamCount: c_uint,
+ IsVarArg: Bool)
+ -> TypeRef;
#[fast_ffi]
- pub unsafe fn LLVMIsFunctionVarArg(FunctionTy: TypeRef) -> Bool;
+ pub fn LLVMIsFunctionVarArg(FunctionTy: TypeRef) -> Bool;
#[fast_ffi]
- pub unsafe fn LLVMGetReturnType(FunctionTy: TypeRef) -> TypeRef;
+ pub fn LLVMGetReturnType(FunctionTy: TypeRef) -> TypeRef;
#[fast_ffi]
- pub unsafe fn LLVMCountParamTypes(FunctionTy: TypeRef) -> c_uint;
+ pub fn LLVMCountParamTypes(FunctionTy: TypeRef) -> c_uint;
#[fast_ffi]
- pub unsafe fn LLVMGetParamTypes(FunctionTy: TypeRef, Dest: *TypeRef);
+ pub fn LLVMGetParamTypes(FunctionTy: TypeRef, Dest: *TypeRef);
/* Operations on struct types */
#[fast_ffi]
- pub unsafe fn LLVMStructTypeInContext(C: ContextRef,
- ElementTypes: *TypeRef,
- ElementCount: c_uint,
- Packed: Bool) -> TypeRef;
+ pub fn LLVMStructTypeInContext(C: ContextRef,
+ ElementTypes: *TypeRef,
+ ElementCount: c_uint,
+ Packed: Bool)
+ -> TypeRef;
#[fast_ffi]
- pub unsafe fn LLVMCountStructElementTypes(StructTy: TypeRef)
- -> c_uint;
+ pub fn LLVMCountStructElementTypes(StructTy: TypeRef) -> c_uint;
#[fast_ffi]
- pub unsafe fn LLVMGetStructElementTypes(StructTy: TypeRef,
- Dest: *mut TypeRef);
+ pub fn LLVMGetStructElementTypes(StructTy: TypeRef,
+ Dest: *mut TypeRef);
#[fast_ffi]
- pub unsafe fn LLVMIsPackedStruct(StructTy: TypeRef) -> Bool;
+ pub fn LLVMIsPackedStruct(StructTy: TypeRef) -> Bool;
/* Operations on array, pointer, and vector types (sequence types) */
#[fast_ffi]
- pub unsafe fn LLVMArrayType(ElementType: TypeRef,
- ElementCount: c_uint) -> TypeRef;
+ pub fn LLVMArrayType(ElementType: TypeRef, ElementCount: c_uint)
+ -> TypeRef;
#[fast_ffi]
- pub unsafe fn LLVMPointerType(ElementType: TypeRef,
- AddressSpace: c_uint) -> TypeRef;
+ pub fn LLVMPointerType(ElementType: TypeRef, AddressSpace: c_uint)
+ -> TypeRef;
#[fast_ffi]
- pub unsafe fn LLVMVectorType(ElementType: TypeRef,
- ElementCount: c_uint) -> TypeRef;
+ pub fn LLVMVectorType(ElementType: TypeRef, ElementCount: c_uint)
+ -> TypeRef;
#[fast_ffi]
- pub unsafe fn LLVMGetElementType(Ty: TypeRef) -> TypeRef;
+ pub fn LLVMGetElementType(Ty: TypeRef) -> TypeRef;
#[fast_ffi]
- pub unsafe fn LLVMGetArrayLength(ArrayTy: TypeRef) -> c_uint;
+ pub fn LLVMGetArrayLength(ArrayTy: TypeRef) -> c_uint;
#[fast_ffi]
- pub unsafe fn LLVMGetPointerAddressSpace(PointerTy: TypeRef)
- -> c_uint;
+ pub fn LLVMGetPointerAddressSpace(PointerTy: TypeRef) -> c_uint;
#[fast_ffi]
- pub unsafe fn LLVMGetPointerToGlobal(EE: ExecutionEngineRef,
- V: ValueRef)
- -> *();
+ pub fn LLVMGetPointerToGlobal(EE: ExecutionEngineRef, V: ValueRef)
+ -> *();
#[fast_ffi]
- pub unsafe fn LLVMGetVectorSize(VectorTy: TypeRef) -> c_uint;
+ pub fn LLVMGetVectorSize(VectorTy: TypeRef) -> c_uint;
/* Operations on other types */
#[fast_ffi]
- pub unsafe fn LLVMVoidTypeInContext(C: ContextRef) -> TypeRef;
+ pub fn LLVMVoidTypeInContext(C: ContextRef) -> TypeRef;
#[fast_ffi]
- pub unsafe fn LLVMLabelTypeInContext(C: ContextRef) -> TypeRef;
+ pub fn LLVMLabelTypeInContext(C: ContextRef) -> TypeRef;
#[fast_ffi]
- pub unsafe fn LLVMMetadataTypeInContext(C: ContextRef) -> TypeRef;
+ pub fn LLVMMetadataTypeInContext(C: ContextRef) -> TypeRef;
/* Operations on all values */
#[fast_ffi]
- pub unsafe fn LLVMTypeOf(Val: ValueRef) -> TypeRef;
+ pub fn LLVMTypeOf(Val: ValueRef) -> TypeRef;
#[fast_ffi]
- pub unsafe fn LLVMGetValueName(Val: ValueRef) -> *c_char;
+ pub fn LLVMGetValueName(Val: ValueRef) -> *c_char;
#[fast_ffi]
- pub unsafe fn LLVMSetValueName(Val: ValueRef, Name: *c_char);
+ pub fn LLVMSetValueName(Val: ValueRef, Name: *c_char);
#[fast_ffi]
- pub unsafe fn LLVMDumpValue(Val: ValueRef);
+ pub fn LLVMDumpValue(Val: ValueRef);
#[fast_ffi]
- pub unsafe fn LLVMReplaceAllUsesWith(OldVal: ValueRef,
- NewVal: ValueRef);
+ pub fn LLVMReplaceAllUsesWith(OldVal: ValueRef, NewVal: ValueRef);
#[fast_ffi]
- pub unsafe fn LLVMHasMetadata(Val: ValueRef) -> c_int;
+ pub fn LLVMHasMetadata(Val: ValueRef) -> c_int;
#[fast_ffi]
- pub unsafe fn LLVMGetMetadata(Val: ValueRef, KindID: c_uint)
- -> ValueRef;
+ pub fn LLVMGetMetadata(Val: ValueRef, KindID: c_uint) -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMSetMetadata(Val: ValueRef,
- KindID: c_uint,
- Node: ValueRef);
+ pub fn LLVMSetMetadata(Val: ValueRef, KindID: c_uint, Node: ValueRef);
/* Operations on Uses */
#[fast_ffi]
- pub unsafe fn LLVMGetFirstUse(Val: ValueRef) -> UseRef;
+ pub fn LLVMGetFirstUse(Val: ValueRef) -> UseRef;
#[fast_ffi]
- pub unsafe fn LLVMGetNextUse(U: UseRef) -> UseRef;
+ pub fn LLVMGetNextUse(U: UseRef) -> UseRef;
#[fast_ffi]
- pub unsafe fn LLVMGetUser(U: UseRef) -> ValueRef;
+ pub fn LLVMGetUser(U: UseRef) -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMGetUsedValue(U: UseRef) -> ValueRef;
+ pub fn LLVMGetUsedValue(U: UseRef) -> ValueRef;
/* Operations on Users */
#[fast_ffi]
- pub unsafe fn LLVMGetNumOperands(Val: ValueRef) -> c_int;
+ pub fn LLVMGetNumOperands(Val: ValueRef) -> c_int;
#[fast_ffi]
- pub unsafe fn LLVMGetOperand(Val: ValueRef, Index: c_uint)
- -> ValueRef;
+ pub fn LLVMGetOperand(Val: ValueRef, Index: c_uint) -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMSetOperand(Val: ValueRef,
- Index: c_uint,
- Op: ValueRef);
+ pub fn LLVMSetOperand(Val: ValueRef, Index: c_uint, Op: ValueRef);
/* Operations on constants of any type */
#[fast_ffi]
- pub unsafe fn LLVMConstNull(Ty: TypeRef) -> ValueRef;
+ pub fn LLVMConstNull(Ty: TypeRef) -> ValueRef;
/* all zeroes */
#[fast_ffi]
- pub unsafe fn LLVMConstAllOnes(Ty: TypeRef) -> ValueRef;
+ pub fn LLVMConstAllOnes(Ty: TypeRef) -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMConstICmp(Pred: c_ushort, V1: ValueRef, V2: ValueRef) -> ValueRef;
+ pub fn LLVMConstICmp(Pred: c_ushort, V1: ValueRef, V2: ValueRef)
+ -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMConstFCmp(Pred: c_ushort, V1: ValueRef, V2: ValueRef) -> ValueRef;
+ pub fn LLVMConstFCmp(Pred: c_ushort, V1: ValueRef, V2: ValueRef)
+ -> ValueRef;
/* only for int/vector */
#[fast_ffi]
- pub unsafe fn LLVMGetUndef(Ty: TypeRef) -> ValueRef;
+ pub fn LLVMGetUndef(Ty: TypeRef) -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMIsConstant(Val: ValueRef) -> Bool;
+ pub fn LLVMIsConstant(Val: ValueRef) -> Bool;
#[fast_ffi]
- pub unsafe fn LLVMIsNull(Val: ValueRef) -> Bool;
+ pub fn LLVMIsNull(Val: ValueRef) -> Bool;
#[fast_ffi]
- pub unsafe fn LLVMIsUndef(Val: ValueRef) -> Bool;
+ pub fn LLVMIsUndef(Val: ValueRef) -> Bool;
#[fast_ffi]
- pub unsafe fn LLVMConstPointerNull(Ty: TypeRef) -> ValueRef;
+ pub fn LLVMConstPointerNull(Ty: TypeRef) -> ValueRef;
/* Operations on metadata */
#[fast_ffi]
- pub unsafe fn LLVMMDStringInContext(C: ContextRef,
- Str: *c_char,
- SLen: c_uint)
+ pub fn LLVMMDStringInContext(C: ContextRef,
+ Str: *c_char,
+ SLen: c_uint)
-> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMMDNodeInContext(C: ContextRef,
- Vals: *ValueRef,
- Count: c_uint)
+ pub fn LLVMMDNodeInContext(C: ContextRef,
+ Vals: *ValueRef,
+ Count: c_uint)
-> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMAddNamedMetadataOperand(M: ModuleRef, Str: *c_char,
- Val: ValueRef);
+ pub fn LLVMAddNamedMetadataOperand(M: ModuleRef,
+ Str: *c_char,
+ Val: ValueRef);
/* Operations on scalar constants */
#[fast_ffi]
- pub unsafe fn LLVMConstInt(IntTy: TypeRef,
- N: c_ulonglong,
- SignExtend: Bool)
+ pub fn LLVMConstInt(IntTy: TypeRef, N: c_ulonglong, SignExtend: Bool)
-> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMConstIntOfString(IntTy: TypeRef,
- Text: *c_char,
- Radix: u8)
+ pub fn LLVMConstIntOfString(IntTy: TypeRef, Text: *c_char, Radix: u8)
-> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMConstIntOfStringAndSize(IntTy: TypeRef,
- Text: *c_char,
- SLen: c_uint,
- Radix: u8)
- -> ValueRef;
+ pub fn LLVMConstIntOfStringAndSize(IntTy: TypeRef,
+ Text: *c_char,
+ SLen: c_uint,
+ Radix: u8)
+ -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMConstReal(RealTy: TypeRef, N: f64) -> ValueRef;
+ pub fn LLVMConstReal(RealTy: TypeRef, N: f64) -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMConstRealOfString(RealTy: TypeRef,
- Text: *c_char)
+ pub fn LLVMConstRealOfString(RealTy: TypeRef, Text: *c_char)
-> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMConstRealOfStringAndSize(RealTy: TypeRef,
- Text: *c_char,
- SLen: c_uint)
- -> ValueRef;
+ pub fn LLVMConstRealOfStringAndSize(RealTy: TypeRef,
+ Text: *c_char,
+ SLen: c_uint)
+ -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMConstIntGetZExtValue(ConstantVal: ValueRef)
- -> c_ulonglong;
+ pub fn LLVMConstIntGetZExtValue(ConstantVal: ValueRef) -> c_ulonglong;
#[fast_ffi]
- pub unsafe fn LLVMConstIntGetSExtValue(ConstantVal: ValueRef)
- -> c_longlong;
+ pub fn LLVMConstIntGetSExtValue(ConstantVal: ValueRef) -> c_longlong;
/* Operations on composite constants */
#[fast_ffi]
- pub unsafe fn LLVMConstStringInContext(C: ContextRef,
- Str: *c_char,
- Length: c_uint,
- DontNullTerminate: Bool)
+ pub fn LLVMConstStringInContext(C: ContextRef,
+ Str: *c_char,
+ Length: c_uint,
+ DontNullTerminate: Bool)
-> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMConstStructInContext(C: ContextRef,
- ConstantVals: *ValueRef,
- Count: c_uint,
- Packed: Bool) -> ValueRef;
+ pub fn LLVMConstStructInContext(C: ContextRef,
+ ConstantVals: *ValueRef,
+ Count: c_uint,
+ Packed: Bool)
+ -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMConstArray(ElementTy: TypeRef,
- ConstantVals: *ValueRef,
- Length: c_uint)
- -> ValueRef;
+ pub fn LLVMConstArray(ElementTy: TypeRef,
+ ConstantVals: *ValueRef,
+ Length: c_uint)
+ -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMConstVector(ScalarConstantVals: *ValueRef,
- Size: c_uint) -> ValueRef;
+ pub fn LLVMConstVector(ScalarConstantVals: *ValueRef, Size: c_uint)
+ -> ValueRef;
/* Constant expressions */
#[fast_ffi]
- pub unsafe fn LLVMAlignOf(Ty: TypeRef) -> ValueRef;
+ pub fn LLVMAlignOf(Ty: TypeRef) -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMSizeOf(Ty: TypeRef) -> ValueRef;
+ pub fn LLVMSizeOf(Ty: TypeRef) -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMConstNeg(ConstantVal: ValueRef) -> ValueRef;
+ pub fn LLVMConstNeg(ConstantVal: ValueRef) -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMConstNSWNeg(ConstantVal: ValueRef) -> ValueRef;
+ pub fn LLVMConstNSWNeg(ConstantVal: ValueRef) -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMConstNUWNeg(ConstantVal: ValueRef) -> ValueRef;
+ pub fn LLVMConstNUWNeg(ConstantVal: ValueRef) -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMConstFNeg(ConstantVal: ValueRef) -> ValueRef;
+ pub fn LLVMConstFNeg(ConstantVal: ValueRef) -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMConstNot(ConstantVal: ValueRef) -> ValueRef;
+ pub fn LLVMConstNot(ConstantVal: ValueRef) -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMConstAdd(LHSConstant: ValueRef,
- RHSConstant: ValueRef)
- -> ValueRef;
+ pub fn LLVMConstAdd(LHSConstant: ValueRef, RHSConstant: ValueRef)
+ -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMConstNSWAdd(LHSConstant: ValueRef,
- RHSConstant: ValueRef)
+ pub fn LLVMConstNSWAdd(LHSConstant: ValueRef, RHSConstant: ValueRef)
-> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMConstNUWAdd(LHSConstant: ValueRef,
- RHSConstant: ValueRef)
+ pub fn LLVMConstNUWAdd(LHSConstant: ValueRef, RHSConstant: ValueRef)
-> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMConstFAdd(LHSConstant: ValueRef,
- RHSConstant: ValueRef)
+ pub fn LLVMConstFAdd(LHSConstant: ValueRef, RHSConstant: ValueRef)
-> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMConstSub(LHSConstant: ValueRef,
- RHSConstant: ValueRef)
- -> ValueRef;
+ pub fn LLVMConstSub(LHSConstant: ValueRef, RHSConstant: ValueRef)
+ -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMConstNSWSub(LHSConstant: ValueRef,
- RHSConstant: ValueRef)
- -> ValueRef;
+ pub fn LLVMConstNSWSub(LHSConstant: ValueRef, RHSConstant: ValueRef)
+ -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMConstNUWSub(LHSConstant: ValueRef,
- RHSConstant: ValueRef)
- -> ValueRef;
+ pub fn LLVMConstNUWSub(LHSConstant: ValueRef, RHSConstant: ValueRef)
+ -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMConstFSub(LHSConstant: ValueRef,
- RHSConstant: ValueRef)
- -> ValueRef;
+ pub fn LLVMConstFSub(LHSConstant: ValueRef, RHSConstant: ValueRef)
+ -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMConstMul(LHSConstant: ValueRef,
- RHSConstant: ValueRef)
+ pub fn LLVMConstMul(LHSConstant: ValueRef, RHSConstant: ValueRef)
-> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMConstNSWMul(LHSConstant: ValueRef,
- RHSConstant: ValueRef)
+ pub fn LLVMConstNSWMul(LHSConstant: ValueRef, RHSConstant: ValueRef)
-> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMConstNUWMul(LHSConstant: ValueRef,
- RHSConstant: ValueRef)
+ pub fn LLVMConstNUWMul(LHSConstant: ValueRef, RHSConstant: ValueRef)
-> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMConstFMul(LHSConstant: ValueRef,
- RHSConstant: ValueRef)
+ pub fn LLVMConstFMul(LHSConstant: ValueRef, RHSConstant: ValueRef)
-> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMConstUDiv(LHSConstant: ValueRef,
- RHSConstant: ValueRef)
+ pub fn LLVMConstUDiv(LHSConstant: ValueRef, RHSConstant: ValueRef)
-> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMConstSDiv(LHSConstant: ValueRef,
- RHSConstant: ValueRef)
+ pub fn LLVMConstSDiv(LHSConstant: ValueRef, RHSConstant: ValueRef)
-> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMConstExactSDiv(LHSConstant: ValueRef,
- RHSConstant: ValueRef)
+ pub fn LLVMConstExactSDiv(LHSConstant: ValueRef,
+ RHSConstant: ValueRef)
-> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMConstFDiv(LHSConstant: ValueRef,
- RHSConstant: ValueRef)
+ pub fn LLVMConstFDiv(LHSConstant: ValueRef, RHSConstant: ValueRef)
-> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMConstURem(LHSConstant: ValueRef,
- RHSConstant: ValueRef)
+ pub fn LLVMConstURem(LHSConstant: ValueRef, RHSConstant: ValueRef)
-> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMConstSRem(LHSConstant: ValueRef,
- RHSConstant: ValueRef)
+ pub fn LLVMConstSRem(LHSConstant: ValueRef, RHSConstant: ValueRef)
-> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMConstFRem(LHSConstant: ValueRef,
- RHSConstant: ValueRef)
+ pub fn LLVMConstFRem(LHSConstant: ValueRef, RHSConstant: ValueRef)
-> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMConstAnd(LHSConstant: ValueRef,
- RHSConstant: ValueRef)
+ pub fn LLVMConstAnd(LHSConstant: ValueRef, RHSConstant: ValueRef)
-> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMConstOr(LHSConstant: ValueRef,
- RHSConstant: ValueRef)
+ pub fn LLVMConstOr(LHSConstant: ValueRef, RHSConstant: ValueRef)
-> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMConstXor(LHSConstant: ValueRef,
- RHSConstant: ValueRef)
+ pub fn LLVMConstXor(LHSConstant: ValueRef, RHSConstant: ValueRef)
-> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMConstShl(LHSConstant: ValueRef,
- RHSConstant: ValueRef)
+ pub fn LLVMConstShl(LHSConstant: ValueRef, RHSConstant: ValueRef)
-> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMConstLShr(LHSConstant: ValueRef,
- RHSConstant: ValueRef) -> ValueRef;
+ pub fn LLVMConstLShr(LHSConstant: ValueRef, RHSConstant: ValueRef)
+ -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMConstAShr(LHSConstant: ValueRef,
- RHSConstant: ValueRef) -> ValueRef;
+ pub fn LLVMConstAShr(LHSConstant: ValueRef, RHSConstant: ValueRef)
+ -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMConstGEP(ConstantVal: ValueRef,
- ConstantIndices: *ValueRef,
- NumIndices: c_uint) -> ValueRef;
+ pub fn LLVMConstGEP(ConstantVal: ValueRef,
+ ConstantIndices: *ValueRef,
+ NumIndices: c_uint)
+ -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMConstInBoundsGEP(ConstantVal: ValueRef,
- ConstantIndices: *ValueRef,
- NumIndices: c_uint)
+ pub fn LLVMConstInBoundsGEP(ConstantVal: ValueRef,
+ ConstantIndices: *ValueRef,
+ NumIndices: c_uint)
-> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMConstTrunc(ConstantVal: ValueRef,
- ToType: TypeRef)
+ pub fn LLVMConstTrunc(ConstantVal: ValueRef, ToType: TypeRef)
-> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMConstSExt(ConstantVal: ValueRef,
- ToType: TypeRef)
+ pub fn LLVMConstSExt(ConstantVal: ValueRef, ToType: TypeRef)
-> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMConstZExt(ConstantVal: ValueRef,
- ToType: TypeRef)
+ pub fn LLVMConstZExt(ConstantVal: ValueRef, ToType: TypeRef)
-> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMConstFPTrunc(ConstantVal: ValueRef,
- ToType: TypeRef)
+ pub fn LLVMConstFPTrunc(ConstantVal: ValueRef, ToType: TypeRef)
-> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMConstFPExt(ConstantVal: ValueRef,
- ToType: TypeRef)
+ pub fn LLVMConstFPExt(ConstantVal: ValueRef, ToType: TypeRef)
-> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMConstUIToFP(ConstantVal: ValueRef,
- ToType: TypeRef)
+ pub fn LLVMConstUIToFP(ConstantVal: ValueRef, ToType: TypeRef)
-> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMConstSIToFP(ConstantVal: ValueRef,
- ToType: TypeRef)
+ pub fn LLVMConstSIToFP(ConstantVal: ValueRef, ToType: TypeRef)
-> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMConstFPToUI(ConstantVal: ValueRef,
- ToType: TypeRef)
+ pub fn LLVMConstFPToUI(ConstantVal: ValueRef, ToType: TypeRef)
-> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMConstFPToSI(ConstantVal: ValueRef,
- ToType: TypeRef)
+ pub fn LLVMConstFPToSI(ConstantVal: ValueRef, ToType: TypeRef)
-> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMConstPtrToInt(ConstantVal: ValueRef,
- ToType: TypeRef)
+ pub fn LLVMConstPtrToInt(ConstantVal: ValueRef, ToType: TypeRef)
-> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMConstIntToPtr(ConstantVal: ValueRef,
- ToType: TypeRef)
+ pub fn LLVMConstIntToPtr(ConstantVal: ValueRef, ToType: TypeRef)
-> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMConstBitCast(ConstantVal: ValueRef,
- ToType: TypeRef)
+ pub fn LLVMConstBitCast(ConstantVal: ValueRef, ToType: TypeRef)
-> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMConstZExtOrBitCast(ConstantVal: ValueRef,
- ToType: TypeRef)
+ pub fn LLVMConstZExtOrBitCast(ConstantVal: ValueRef, ToType: TypeRef)
-> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMConstSExtOrBitCast(ConstantVal: ValueRef,
- ToType: TypeRef)
+ pub fn LLVMConstSExtOrBitCast(ConstantVal: ValueRef, ToType: TypeRef)
-> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMConstTruncOrBitCast(ConstantVal: ValueRef,
- ToType: TypeRef)
+ pub fn LLVMConstTruncOrBitCast(ConstantVal: ValueRef, ToType: TypeRef)
-> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMConstPointerCast(ConstantVal: ValueRef,
- ToType: TypeRef)
+ pub fn LLVMConstPointerCast(ConstantVal: ValueRef, ToType: TypeRef)
-> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMConstIntCast(ConstantVal: ValueRef,
- ToType: TypeRef,
- isSigned: Bool)
- -> ValueRef;
+ pub fn LLVMConstIntCast(ConstantVal: ValueRef,
+ ToType: TypeRef,
+ isSigned: Bool)
+ -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMConstFPCast(ConstantVal: ValueRef,
- ToType: TypeRef)
+ pub fn LLVMConstFPCast(ConstantVal: ValueRef, ToType: TypeRef)
-> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMConstSelect(ConstantCondition: ValueRef,
- ConstantIfTrue: ValueRef,
- ConstantIfFalse: ValueRef)
- -> ValueRef;
+ pub fn LLVMConstSelect(ConstantCondition: ValueRef,
+ ConstantIfTrue: ValueRef,
+ ConstantIfFalse: ValueRef)
+ -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMConstExtractElement(VectorConstant: ValueRef,
- IndexConstant: ValueRef) -> ValueRef;
+ pub fn LLVMConstExtractElement(VectorConstant: ValueRef,
+ IndexConstant: ValueRef)
+ -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMConstInsertElement(VectorConstant: ValueRef,
- ElementValueConstant: ValueRef,
- IndexConstant: ValueRef) -> ValueRef;
+ pub fn LLVMConstInsertElement(VectorConstant: ValueRef,
+ ElementValueConstant: ValueRef,
+ IndexConstant: ValueRef)
+ -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMConstShuffleVector(VectorAConstant: ValueRef,
- VectorBConstant: ValueRef,
- MaskConstant: ValueRef) -> ValueRef;
+ pub fn LLVMConstShuffleVector(VectorAConstant: ValueRef,
+ VectorBConstant: ValueRef,
+ MaskConstant: ValueRef)
+ -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMConstExtractValue(AggConstant: ValueRef,
- IdxList: *c_uint,
- NumIdx: c_uint) -> ValueRef;
+ pub fn LLVMConstExtractValue(AggConstant: ValueRef,
+ IdxList: *c_uint,
+ NumIdx: c_uint)
+ -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMConstInsertValue(AggConstant: ValueRef,
- ElementValueConstant: ValueRef,
- IdxList: *c_uint,
- NumIdx: c_uint)
- -> ValueRef;
+ pub fn LLVMConstInsertValue(AggConstant: ValueRef,
+ ElementValueConstant: ValueRef,
+ IdxList: *c_uint,
+ NumIdx: c_uint)
+ -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMConstInlineAsm(Ty: TypeRef, AsmString: *c_char,
- Constraints: *c_char, HasSideEffects: Bool,
- IsAlignStack: Bool) -> ValueRef;
+ pub fn LLVMConstInlineAsm(Ty: TypeRef,
+ AsmString: *c_char,
+ Constraints: *c_char,
+ HasSideEffects: Bool,
+ IsAlignStack: Bool)
+ -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMBlockAddress(F: ValueRef, BB: BasicBlockRef)
- -> ValueRef;
+ pub fn LLVMBlockAddress(F: ValueRef, BB: BasicBlockRef) -> ValueRef;
/* Operations on global variables, functions, and aliases (globals) */
#[fast_ffi]
- pub unsafe fn LLVMGetGlobalParent(Global: ValueRef) -> ModuleRef;
+ pub fn LLVMGetGlobalParent(Global: ValueRef) -> ModuleRef;
#[fast_ffi]
- pub unsafe fn LLVMIsDeclaration(Global: ValueRef) -> Bool;
+ pub fn LLVMIsDeclaration(Global: ValueRef) -> Bool;
#[fast_ffi]
- pub unsafe fn LLVMGetLinkage(Global: ValueRef) -> c_uint;
+ pub fn LLVMGetLinkage(Global: ValueRef) -> c_uint;
#[fast_ffi]
- pub unsafe fn LLVMSetLinkage(Global: ValueRef, Link: c_uint);
+ pub fn LLVMSetLinkage(Global: ValueRef, Link: c_uint);
#[fast_ffi]
- pub unsafe fn LLVMGetSection(Global: ValueRef) -> *c_char;
+ pub fn LLVMGetSection(Global: ValueRef) -> *c_char;
#[fast_ffi]
- pub unsafe fn LLVMSetSection(Global: ValueRef, Section: *c_char);
+ pub fn LLVMSetSection(Global: ValueRef, Section: *c_char);
#[fast_ffi]
- pub unsafe fn LLVMGetVisibility(Global: ValueRef) -> c_uint;
+ pub fn LLVMGetVisibility(Global: ValueRef) -> c_uint;
#[fast_ffi]
- pub unsafe fn LLVMSetVisibility(Global: ValueRef, Viz: c_uint);
+ pub fn LLVMSetVisibility(Global: ValueRef, Viz: c_uint);
#[fast_ffi]
- pub unsafe fn LLVMGetAlignment(Global: ValueRef) -> c_uint;
+ pub fn LLVMGetAlignment(Global: ValueRef) -> c_uint;
#[fast_ffi]
- pub unsafe fn LLVMSetAlignment(Global: ValueRef, Bytes: c_uint);
+ pub fn LLVMSetAlignment(Global: ValueRef, Bytes: c_uint);
/* Operations on global variables */
#[fast_ffi]
- pub unsafe fn LLVMAddGlobal(M: ModuleRef,
- Ty: TypeRef,
- Name: *c_char)
+ pub fn LLVMAddGlobal(M: ModuleRef, Ty: TypeRef, Name: *c_char)
-> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMAddGlobalInAddressSpace(M: ModuleRef,
- Ty: TypeRef,
- Name: *c_char,
- AddressSpace: c_uint)
+ pub fn LLVMAddGlobalInAddressSpace(M: ModuleRef,
+ Ty: TypeRef,
+ Name: *c_char,
+ AddressSpace: c_uint)
-> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMGetNamedGlobal(M: ModuleRef, Name: *c_char)
- -> ValueRef;
+ pub fn LLVMGetNamedGlobal(M: ModuleRef, Name: *c_char) -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMGetFirstGlobal(M: ModuleRef) -> ValueRef;
+ pub fn LLVMGetFirstGlobal(M: ModuleRef) -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMGetLastGlobal(M: ModuleRef) -> ValueRef;
+ pub fn LLVMGetLastGlobal(M: ModuleRef) -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMGetNextGlobal(GlobalVar: ValueRef) -> ValueRef;
+ pub fn LLVMGetNextGlobal(GlobalVar: ValueRef) -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMGetPreviousGlobal(GlobalVar: ValueRef) -> ValueRef;
+ pub fn LLVMGetPreviousGlobal(GlobalVar: ValueRef) -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMDeleteGlobal(GlobalVar: ValueRef);
+ pub fn LLVMDeleteGlobal(GlobalVar: ValueRef);
#[fast_ffi]
- pub unsafe fn LLVMGetInitializer(GlobalVar: ValueRef) -> ValueRef;
+ pub fn LLVMGetInitializer(GlobalVar: ValueRef) -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMSetInitializer(GlobalVar: ValueRef,
+ pub fn LLVMSetInitializer(GlobalVar: ValueRef,
ConstantVal: ValueRef);
#[fast_ffi]
- pub unsafe fn LLVMIsThreadLocal(GlobalVar: ValueRef) -> Bool;
+ pub fn LLVMIsThreadLocal(GlobalVar: ValueRef) -> Bool;
#[fast_ffi]
- pub unsafe fn LLVMSetThreadLocal(GlobalVar: ValueRef,
- IsThreadLocal: Bool);
+ pub fn LLVMSetThreadLocal(GlobalVar: ValueRef, IsThreadLocal: Bool);
#[fast_ffi]
- pub unsafe fn LLVMIsGlobalConstant(GlobalVar: ValueRef) -> Bool;
+ pub fn LLVMIsGlobalConstant(GlobalVar: ValueRef) -> Bool;
#[fast_ffi]
- pub unsafe fn LLVMSetGlobalConstant(GlobalVar: ValueRef,
- IsConstant: Bool);
+ pub fn LLVMSetGlobalConstant(GlobalVar: ValueRef, IsConstant: Bool);
/* Operations on aliases */
#[fast_ffi]
- pub unsafe fn LLVMAddAlias(M: ModuleRef,
- Ty: TypeRef,
- Aliasee: ValueRef,
- Name: *c_char)
- -> ValueRef;
+ pub fn LLVMAddAlias(M: ModuleRef,
+ Ty: TypeRef,
+ Aliasee: ValueRef,
+ Name: *c_char)
+ -> ValueRef;
/* Operations on functions */
#[fast_ffi]
- pub unsafe fn LLVMAddFunction(M: ModuleRef,
- Name: *c_char,
- FunctionTy: TypeRef)
+ pub fn LLVMAddFunction(M: ModuleRef,
+ Name: *c_char,
+ FunctionTy: TypeRef)
-> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMGetNamedFunction(M: ModuleRef,
- Name: *c_char) -> ValueRef;
+ pub fn LLVMGetNamedFunction(M: ModuleRef, Name: *c_char) -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMGetFirstFunction(M: ModuleRef) -> ValueRef;
+ pub fn LLVMGetFirstFunction(M: ModuleRef) -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMGetLastFunction(M: ModuleRef) -> ValueRef;
+ pub fn LLVMGetLastFunction(M: ModuleRef) -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMGetNextFunction(Fn: ValueRef) -> ValueRef;
+ pub fn LLVMGetNextFunction(Fn: ValueRef) -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMGetPreviousFunction(Fn: ValueRef) -> ValueRef;
+ pub fn LLVMGetPreviousFunction(Fn: ValueRef) -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMDeleteFunction(Fn: ValueRef);
+ pub fn LLVMDeleteFunction(Fn: ValueRef);
#[fast_ffi]
- pub unsafe fn LLVMGetOrInsertFunction(M: ModuleRef, Name: *c_char,
- FunctionTy: TypeRef) -> ValueRef;
+ pub fn LLVMGetOrInsertFunction(M: ModuleRef,
+ Name: *c_char,
+ FunctionTy: TypeRef)
+ -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMGetIntrinsicID(Fn: ValueRef) -> c_uint;
+ pub fn LLVMGetIntrinsicID(Fn: ValueRef) -> c_uint;
#[fast_ffi]
- pub unsafe fn LLVMGetFunctionCallConv(Fn: ValueRef) -> c_uint;
+ pub fn LLVMGetFunctionCallConv(Fn: ValueRef) -> c_uint;
#[fast_ffi]
- pub unsafe fn LLVMSetFunctionCallConv(Fn: ValueRef, CC: c_uint);
+ pub fn LLVMSetFunctionCallConv(Fn: ValueRef, CC: c_uint);
#[fast_ffi]
- pub unsafe fn LLVMGetGC(Fn: ValueRef) -> *c_char;
+ pub fn LLVMGetGC(Fn: ValueRef) -> *c_char;
#[fast_ffi]
- pub unsafe fn LLVMSetGC(Fn: ValueRef, Name: *c_char);
+ pub fn LLVMSetGC(Fn: ValueRef, Name: *c_char);
#[fast_ffi]
- pub unsafe fn LLVMAddFunctionAttr(Fn: ValueRef,
- PA: c_uint,
- HighPA: c_uint);
+ pub fn LLVMAddFunctionAttr(Fn: ValueRef, PA: c_uint, HighPA: c_uint);
#[fast_ffi]
- pub unsafe fn LLVMGetFunctionAttr(Fn: ValueRef) -> c_ulonglong;
+ pub fn LLVMGetFunctionAttr(Fn: ValueRef) -> c_ulonglong;
#[fast_ffi]
- pub unsafe fn LLVMRemoveFunctionAttr(Fn: ValueRef,
- PA: c_ulonglong,
- HighPA: c_ulonglong);
+ pub fn LLVMRemoveFunctionAttr(Fn: ValueRef,
+ PA: c_ulonglong,
+ HighPA: c_ulonglong);
/* Operations on parameters */
#[fast_ffi]
- pub unsafe fn LLVMCountParams(Fn: ValueRef) -> c_uint;
+ pub fn LLVMCountParams(Fn: ValueRef) -> c_uint;
#[fast_ffi]
- pub unsafe fn LLVMGetParams(Fn: ValueRef, Params: *ValueRef);
+ pub fn LLVMGetParams(Fn: ValueRef, Params: *ValueRef);
#[fast_ffi]
- pub unsafe fn LLVMGetParam(Fn: ValueRef, Index: c_uint) -> ValueRef;
+ pub fn LLVMGetParam(Fn: ValueRef, Index: c_uint) -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMGetParamParent(Inst: ValueRef) -> ValueRef;
+ pub fn LLVMGetParamParent(Inst: ValueRef) -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMGetFirstParam(Fn: ValueRef) -> ValueRef;
+ pub fn LLVMGetFirstParam(Fn: ValueRef) -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMGetLastParam(Fn: ValueRef) -> ValueRef;
+ pub fn LLVMGetLastParam(Fn: ValueRef) -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMGetNextParam(Arg: ValueRef) -> ValueRef;
+ pub fn LLVMGetNextParam(Arg: ValueRef) -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMGetPreviousParam(Arg: ValueRef) -> ValueRef;
+ pub fn LLVMGetPreviousParam(Arg: ValueRef) -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMAddAttribute(Arg: ValueRef, PA: c_uint);
+ pub fn LLVMAddAttribute(Arg: ValueRef, PA: c_uint);
#[fast_ffi]
- pub unsafe fn LLVMRemoveAttribute(Arg: ValueRef, PA: c_uint);
+ pub fn LLVMRemoveAttribute(Arg: ValueRef, PA: c_uint);
#[fast_ffi]
- pub unsafe fn LLVMGetAttribute(Arg: ValueRef) -> c_uint;
+ pub fn LLVMGetAttribute(Arg: ValueRef) -> c_uint;
#[fast_ffi]
- pub unsafe fn LLVMSetParamAlignment(Arg: ValueRef, align: c_uint);
+ pub fn LLVMSetParamAlignment(Arg: ValueRef, align: c_uint);
/* Operations on basic blocks */
#[fast_ffi]
- pub unsafe fn LLVMBasicBlockAsValue(BB: BasicBlockRef) -> ValueRef;
+ pub fn LLVMBasicBlockAsValue(BB: BasicBlockRef) -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMValueIsBasicBlock(Val: ValueRef) -> Bool;
+ pub fn LLVMValueIsBasicBlock(Val: ValueRef) -> Bool;
#[fast_ffi]
- pub unsafe fn LLVMValueAsBasicBlock(Val: ValueRef) -> BasicBlockRef;
+ pub fn LLVMValueAsBasicBlock(Val: ValueRef) -> BasicBlockRef;
#[fast_ffi]
- pub unsafe fn LLVMGetBasicBlockParent(BB: BasicBlockRef) -> ValueRef;
+ pub fn LLVMGetBasicBlockParent(BB: BasicBlockRef) -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMCountBasicBlocks(Fn: ValueRef) -> c_uint;
+ pub fn LLVMCountBasicBlocks(Fn: ValueRef) -> c_uint;
#[fast_ffi]
- pub unsafe fn LLVMGetBasicBlocks(Fn: ValueRef,
- BasicBlocks: *ValueRef);
+ pub fn LLVMGetBasicBlocks(Fn: ValueRef, BasicBlocks: *ValueRef);
#[fast_ffi]
- pub unsafe fn LLVMGetFirstBasicBlock(Fn: ValueRef) -> BasicBlockRef;
+ pub fn LLVMGetFirstBasicBlock(Fn: ValueRef) -> BasicBlockRef;
#[fast_ffi]
- pub unsafe fn LLVMGetLastBasicBlock(Fn: ValueRef) -> BasicBlockRef;
+ pub fn LLVMGetLastBasicBlock(Fn: ValueRef) -> BasicBlockRef;
#[fast_ffi]
- pub unsafe fn LLVMGetNextBasicBlock(BB: BasicBlockRef)
- -> BasicBlockRef;
+ pub fn LLVMGetNextBasicBlock(BB: BasicBlockRef) -> BasicBlockRef;
#[fast_ffi]
- pub unsafe fn LLVMGetPreviousBasicBlock(BB: BasicBlockRef)
- -> BasicBlockRef;
+ pub fn LLVMGetPreviousBasicBlock(BB: BasicBlockRef) -> BasicBlockRef;
#[fast_ffi]
- pub unsafe fn LLVMGetEntryBasicBlock(Fn: ValueRef) -> BasicBlockRef;
+ pub fn LLVMGetEntryBasicBlock(Fn: ValueRef) -> BasicBlockRef;
#[fast_ffi]
- pub unsafe fn LLVMAppendBasicBlockInContext(C: ContextRef,
- Fn: ValueRef,
- Name: *c_char)
- -> BasicBlockRef;
+ pub fn LLVMAppendBasicBlockInContext(C: ContextRef,
+ Fn: ValueRef,
+ Name: *c_char)
+ -> BasicBlockRef;
#[fast_ffi]
- pub unsafe fn LLVMInsertBasicBlockInContext(C: ContextRef,
- BB: BasicBlockRef,
- Name: *c_char)
- -> BasicBlockRef;
+ pub fn LLVMInsertBasicBlockInContext(C: ContextRef,
+ BB: BasicBlockRef,
+ Name: *c_char)
+ -> BasicBlockRef;
#[fast_ffi]
- pub unsafe fn LLVMDeleteBasicBlock(BB: BasicBlockRef);
+ pub fn LLVMDeleteBasicBlock(BB: BasicBlockRef);
#[fast_ffi]
- pub unsafe fn LLVMMoveBasicBlockAfter(BB: BasicBlockRef, MoveAfter: BasicBlockRef);
+ pub fn LLVMMoveBasicBlockAfter(BB: BasicBlockRef,
+ MoveAfter: BasicBlockRef);
#[fast_ffi]
- pub unsafe fn LLVMMoveBasicBlockBefore(BB: BasicBlockRef, MoveBefore: BasicBlockRef);
+ pub fn LLVMMoveBasicBlockBefore(BB: BasicBlockRef,
+ MoveBefore: BasicBlockRef);
/* Operations on instructions */
#[fast_ffi]
- pub unsafe fn LLVMGetInstructionParent(Inst: ValueRef)
- -> BasicBlockRef;
+ pub fn LLVMGetInstructionParent(Inst: ValueRef) -> BasicBlockRef;
#[fast_ffi]
- pub unsafe fn LLVMGetFirstInstruction(BB: BasicBlockRef) -> ValueRef;
+ pub fn LLVMGetFirstInstruction(BB: BasicBlockRef) -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMGetLastInstruction(BB: BasicBlockRef) -> ValueRef;
+ pub fn LLVMGetLastInstruction(BB: BasicBlockRef) -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMGetNextInstruction(Inst: ValueRef) -> ValueRef;
+ pub fn LLVMGetNextInstruction(Inst: ValueRef) -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMGetPreviousInstruction(Inst: ValueRef) -> ValueRef;
+ pub fn LLVMGetPreviousInstruction(Inst: ValueRef) -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMInstructionEraseFromParent(Inst: ValueRef);
+ pub fn LLVMInstructionEraseFromParent(Inst: ValueRef);
/* Operations on call sites */
#[fast_ffi]
- pub unsafe fn LLVMSetInstructionCallConv(Instr: ValueRef, CC: c_uint);
+ pub fn LLVMSetInstructionCallConv(Instr: ValueRef, CC: c_uint);
#[fast_ffi]
- pub unsafe fn LLVMGetInstructionCallConv(Instr: ValueRef) -> c_uint;
+ pub fn LLVMGetInstructionCallConv(Instr: ValueRef) -> c_uint;
#[fast_ffi]
- pub unsafe fn LLVMAddInstrAttribute(Instr: ValueRef,
- index: c_uint,
- IA: c_uint);
+ pub fn LLVMAddInstrAttribute(Instr: ValueRef,
+ index: c_uint,
+ IA: c_uint);
#[fast_ffi]
- pub unsafe fn LLVMRemoveInstrAttribute(Instr: ValueRef,
- index: c_uint,
- IA: c_uint);
+ pub fn LLVMRemoveInstrAttribute(Instr: ValueRef,
+ index: c_uint,
+ IA: c_uint);
#[fast_ffi]
- pub unsafe fn LLVMSetInstrParamAlignment(Instr: ValueRef,
- index: c_uint,
- align: c_uint);
+ pub fn LLVMSetInstrParamAlignment(Instr: ValueRef,
+ index: c_uint,
+ align: c_uint);
/* Operations on call instructions (only) */
#[fast_ffi]
- pub unsafe fn LLVMIsTailCall(CallInst: ValueRef) -> Bool;
+ pub fn LLVMIsTailCall(CallInst: ValueRef) -> Bool;
#[fast_ffi]
- pub unsafe fn LLVMSetTailCall(CallInst: ValueRef, IsTailCall: Bool);
+ pub fn LLVMSetTailCall(CallInst: ValueRef, IsTailCall: Bool);
/* Operations on phi nodes */
#[fast_ffi]
- pub unsafe fn LLVMAddIncoming(PhiNode: ValueRef,
- IncomingValues: *ValueRef,
- IncomingBlocks: *BasicBlockRef,
- Count: c_uint);
+ pub fn LLVMAddIncoming(PhiNode: ValueRef,
+ IncomingValues: *ValueRef,
+ IncomingBlocks: *BasicBlockRef,
+ Count: c_uint);
#[fast_ffi]
- pub unsafe fn LLVMCountIncoming(PhiNode: ValueRef) -> c_uint;
+ pub fn LLVMCountIncoming(PhiNode: ValueRef) -> c_uint;
#[fast_ffi]
- pub unsafe fn LLVMGetIncomingValue(PhiNode: ValueRef,
- Index: c_uint)
+ pub fn LLVMGetIncomingValue(PhiNode: ValueRef, Index: c_uint)
-> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMGetIncomingBlock(PhiNode: ValueRef,
- Index: c_uint) -> BasicBlockRef;
+ pub fn LLVMGetIncomingBlock(PhiNode: ValueRef, Index: c_uint)
+ -> BasicBlockRef;
/* Instruction builders */
#[fast_ffi]
- pub unsafe fn LLVMCreateBuilderInContext(C: ContextRef) -> BuilderRef;
+ pub fn LLVMCreateBuilderInContext(C: ContextRef) -> BuilderRef;
#[fast_ffi]
- pub unsafe fn LLVMPositionBuilder(Builder: BuilderRef,
- Block: BasicBlockRef,
- Instr: ValueRef);
+ pub fn LLVMPositionBuilder(Builder: BuilderRef,
+ Block: BasicBlockRef,
+ Instr: ValueRef);
#[fast_ffi]
- pub unsafe fn LLVMPositionBuilderBefore(Builder: BuilderRef,
- Instr: ValueRef);
+ pub fn LLVMPositionBuilderBefore(Builder: BuilderRef,
+ Instr: ValueRef);
#[fast_ffi]
- pub unsafe fn LLVMPositionBuilderAtEnd(Builder: BuilderRef,
- Block: BasicBlockRef);
+ pub fn LLVMPositionBuilderAtEnd(Builder: BuilderRef,
+ Block: BasicBlockRef);
#[fast_ffi]
- pub unsafe fn LLVMGetInsertBlock(Builder: BuilderRef)
- -> BasicBlockRef;
+ pub fn LLVMGetInsertBlock(Builder: BuilderRef) -> BasicBlockRef;
#[fast_ffi]
- pub unsafe fn LLVMClearInsertionPosition(Builder: BuilderRef);
+ pub fn LLVMClearInsertionPosition(Builder: BuilderRef);
#[fast_ffi]
- pub unsafe fn LLVMInsertIntoBuilder(Builder: BuilderRef,
- Instr: ValueRef);
+ pub fn LLVMInsertIntoBuilder(Builder: BuilderRef, Instr: ValueRef);
#[fast_ffi]
- pub unsafe fn LLVMInsertIntoBuilderWithName(Builder: BuilderRef,
- Instr: ValueRef,
- Name: *c_char);
+ pub fn LLVMInsertIntoBuilderWithName(Builder: BuilderRef,
+ Instr: ValueRef,
+ Name: *c_char);
#[fast_ffi]
- pub unsafe fn LLVMDisposeBuilder(Builder: BuilderRef);
+ pub fn LLVMDisposeBuilder(Builder: BuilderRef);
#[fast_ffi]
- pub unsafe fn LLVMDisposeExecutionEngine(EE: ExecutionEngineRef);
+ pub fn LLVMDisposeExecutionEngine(EE: ExecutionEngineRef);
/* Metadata */
#[fast_ffi]
- pub unsafe fn LLVMSetCurrentDebugLocation(Builder: BuilderRef,
- L: ValueRef);
+ pub fn LLVMSetCurrentDebugLocation(Builder: BuilderRef, L: ValueRef);
#[fast_ffi]
- pub unsafe fn LLVMGetCurrentDebugLocation(Builder: BuilderRef)
- -> ValueRef;
+ pub fn LLVMGetCurrentDebugLocation(Builder: BuilderRef) -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMSetInstDebugLocation(Builder: BuilderRef,
- Inst: ValueRef);
+ pub fn LLVMSetInstDebugLocation(Builder: BuilderRef, Inst: ValueRef);
/* Terminators */
#[fast_ffi]
- pub unsafe fn LLVMBuildRetVoid(B: BuilderRef) -> ValueRef;
+ pub fn LLVMBuildRetVoid(B: BuilderRef) -> ValueRef;
+ #[fast_ffi]
+ pub fn LLVMBuildRet(B: BuilderRef, V: ValueRef) -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMBuildRet(B: BuilderRef, V: ValueRef) -> ValueRef;
+ pub fn LLVMBuildAggregateRet(B: BuilderRef,
+ RetVals: *ValueRef,
+ N: c_uint)
+ -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMBuildAggregateRet(B: BuilderRef, RetVals: *ValueRef,
- N: c_uint) -> ValueRef;
+ pub fn LLVMBuildBr(B: BuilderRef, Dest: BasicBlockRef) -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMBuildBr(B: BuilderRef, Dest: BasicBlockRef)
+ pub fn LLVMBuildCondBr(B: BuilderRef,
+ If: ValueRef,
+ Then: BasicBlockRef,
+ Else: BasicBlockRef)
-> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMBuildCondBr(B: BuilderRef,
- If: ValueRef,
- Then: BasicBlockRef,
- Else: BasicBlockRef)
+ pub fn LLVMBuildSwitch(B: BuilderRef,
+ V: ValueRef,
+ Else: BasicBlockRef,
+ NumCases: c_uint)
-> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMBuildSwitch(B: BuilderRef, V: ValueRef,
- Else: BasicBlockRef, NumCases: c_uint)
+ pub fn LLVMBuildIndirectBr(B: BuilderRef,
+ Addr: ValueRef,
+ NumDests: c_uint)
-> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMBuildIndirectBr(B: BuilderRef, Addr: ValueRef,
- NumDests: c_uint) -> ValueRef;
- #[fast_ffi]
- pub unsafe fn LLVMBuildInvoke(B: BuilderRef,
- Fn: ValueRef,
- Args: *ValueRef,
- NumArgs: c_uint,
- Then: BasicBlockRef,
- Catch: BasicBlockRef,
- Name: *c_char) -> ValueRef;
- #[fast_ffi]
- pub unsafe fn LLVMBuildLandingPad(B: BuilderRef,
- Ty: TypeRef,
- PersFn: ValueRef,
- NumClauses: c_uint,
- Name: *c_char)
- -> ValueRef;
+ pub fn LLVMBuildInvoke(B: BuilderRef,
+ Fn: ValueRef,
+ Args: *ValueRef,
+ NumArgs: c_uint,
+ Then: BasicBlockRef,
+ Catch: BasicBlockRef,
+ Name: *c_char)
+ -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMBuildResume(B: BuilderRef, Exn: ValueRef)
+ pub fn LLVMBuildLandingPad(B: BuilderRef,
+ Ty: TypeRef,
+ PersFn: ValueRef,
+ NumClauses: c_uint,
+ Name: *c_char)
-> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMBuildUnreachable(B: BuilderRef) -> ValueRef;
+ pub fn LLVMBuildResume(B: BuilderRef, Exn: ValueRef) -> ValueRef;
+ #[fast_ffi]
+ pub fn LLVMBuildUnreachable(B: BuilderRef) -> ValueRef;
/* Add a case to the switch instruction */
#[fast_ffi]
- pub unsafe fn LLVMAddCase(Switch: ValueRef,
- OnVal: ValueRef,
- Dest: BasicBlockRef);
+ pub fn LLVMAddCase(Switch: ValueRef,
+ OnVal: ValueRef,
+ Dest: BasicBlockRef);
/* Add a destination to the indirectbr instruction */
#[fast_ffi]
- pub unsafe fn LLVMAddDestination(IndirectBr: ValueRef,
- Dest: BasicBlockRef);
+ pub fn LLVMAddDestination(IndirectBr: ValueRef, Dest: BasicBlockRef);
/* Add a clause to the landing pad instruction */
#[fast_ffi]
- pub unsafe fn LLVMAddClause(LandingPad: ValueRef,
- ClauseVal: ValueRef);
+ pub fn LLVMAddClause(LandingPad: ValueRef, ClauseVal: ValueRef);
/* Set the cleanup on a landing pad instruction */
#[fast_ffi]
- pub unsafe fn LLVMSetCleanup(LandingPad: ValueRef, Val: Bool);
+ pub fn LLVMSetCleanup(LandingPad: ValueRef, Val: Bool);
/* Arithmetic */
#[fast_ffi]
- pub unsafe fn LLVMBuildAdd(B: BuilderRef,
- LHS: ValueRef,
- RHS: ValueRef,
- Name: *c_char)
- -> ValueRef;
+ pub fn LLVMBuildAdd(B: BuilderRef,
+ LHS: ValueRef,
+ RHS: ValueRef,
+ Name: *c_char)
+ -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMBuildNSWAdd(B: BuilderRef,
- LHS: ValueRef,
- RHS: ValueRef,
- Name: *c_char)
- -> ValueRef;
+ pub fn LLVMBuildNSWAdd(B: BuilderRef,
+ LHS: ValueRef,
+ RHS: ValueRef,
+ Name: *c_char)
+ -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMBuildNUWAdd(B: BuilderRef,
- LHS: ValueRef,
- RHS: ValueRef,
- Name: *c_char)
- -> ValueRef;
+ pub fn LLVMBuildNUWAdd(B: BuilderRef,
+ LHS: ValueRef,
+ RHS: ValueRef,
+ Name: *c_char)
+ -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMBuildFAdd(B: BuilderRef,
- LHS: ValueRef,
- RHS: ValueRef,
- Name: *c_char)
- -> ValueRef;
+ pub fn LLVMBuildFAdd(B: BuilderRef,
+ LHS: ValueRef,
+ RHS: ValueRef,
+ Name: *c_char)
+ -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMBuildSub(B: BuilderRef,
- LHS: ValueRef,
- RHS: ValueRef,
- Name: *c_char)
- -> ValueRef;
+ pub fn LLVMBuildSub(B: BuilderRef,
+ LHS: ValueRef,
+ RHS: ValueRef,
+ Name: *c_char)
+ -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMBuildNSWSub(B: BuilderRef,
- LHS: ValueRef,
- RHS: ValueRef,
- Name: *c_char)
- -> ValueRef;
+ pub fn LLVMBuildNSWSub(B: BuilderRef,
+ LHS: ValueRef,
+ RHS: ValueRef,
+ Name: *c_char)
+ -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMBuildNUWSub(B: BuilderRef,
- LHS: ValueRef,
- RHS: ValueRef,
- Name: *c_char)
- -> ValueRef;
+ pub fn LLVMBuildNUWSub(B: BuilderRef,
+ LHS: ValueRef,
+ RHS: ValueRef,
+ Name: *c_char)
+ -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMBuildFSub(B: BuilderRef,
- LHS: ValueRef,
- RHS: ValueRef,
- Name: *c_char)
- -> ValueRef;
+ pub fn LLVMBuildFSub(B: BuilderRef,
+ LHS: ValueRef,
+ RHS: ValueRef,
+ Name: *c_char)
+ -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMBuildMul(B: BuilderRef,
- LHS: ValueRef,
- RHS: ValueRef,
- Name: *c_char)
- -> ValueRef;
+ pub fn LLVMBuildMul(B: BuilderRef,
+ LHS: ValueRef,
+ RHS: ValueRef,
+ Name: *c_char)
+ -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMBuildNSWMul(B: BuilderRef,
- LHS: ValueRef,
- RHS: ValueRef,
- Name: *c_char)
- -> ValueRef;
+ pub fn LLVMBuildNSWMul(B: BuilderRef,
+ LHS: ValueRef,
+ RHS: ValueRef,
+ Name: *c_char)
+ -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMBuildNUWMul(B: BuilderRef,
- LHS: ValueRef,
- RHS: ValueRef,
- Name: *c_char)
- -> ValueRef;
+ pub fn LLVMBuildNUWMul(B: BuilderRef,
+ LHS: ValueRef,
+ RHS: ValueRef,
+ Name: *c_char)
+ -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMBuildFMul(B: BuilderRef,
- LHS: ValueRef,
- RHS: ValueRef,
- Name: *c_char)
- -> ValueRef;
+ pub fn LLVMBuildFMul(B: BuilderRef,
+ LHS: ValueRef,
+ RHS: ValueRef,
+ Name: *c_char)
+ -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMBuildUDiv(B: BuilderRef,
- LHS: ValueRef,
- RHS: ValueRef,
- Name: *c_char)
- -> ValueRef;
+ pub fn LLVMBuildUDiv(B: BuilderRef,
+ LHS: ValueRef,
+ RHS: ValueRef,
+ Name: *c_char)
+ -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMBuildSDiv(B: BuilderRef,
- LHS: ValueRef,
- RHS: ValueRef,
- Name: *c_char)
- -> ValueRef;
+ pub fn LLVMBuildSDiv(B: BuilderRef,
+ LHS: ValueRef,
+ RHS: ValueRef,
+ Name: *c_char)
+ -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMBuildExactSDiv(B: BuilderRef,
- LHS: ValueRef,
- RHS: ValueRef,
- Name: *c_char)
- -> ValueRef;
+ pub fn LLVMBuildExactSDiv(B: BuilderRef,
+ LHS: ValueRef,
+ RHS: ValueRef,
+ Name: *c_char)
+ -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMBuildFDiv(B: BuilderRef,
- LHS: ValueRef,
- RHS: ValueRef,
- Name: *c_char)
- -> ValueRef;
+ pub fn LLVMBuildFDiv(B: BuilderRef,
+ LHS: ValueRef,
+ RHS: ValueRef,
+ Name: *c_char)
+ -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMBuildURem(B: BuilderRef,
- LHS: ValueRef,
- RHS: ValueRef,
- Name: *c_char)
- -> ValueRef;
+ pub fn LLVMBuildURem(B: BuilderRef,
+ LHS: ValueRef,
+ RHS: ValueRef,
+ Name: *c_char)
+ -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMBuildSRem(B: BuilderRef,
- LHS: ValueRef,
- RHS: ValueRef,
- Name: *c_char)
- -> ValueRef;
+ pub fn LLVMBuildSRem(B: BuilderRef,
+ LHS: ValueRef,
+ RHS: ValueRef,
+ Name: *c_char)
+ -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMBuildFRem(B: BuilderRef,
- LHS: ValueRef,
- RHS: ValueRef,
- Name: *c_char)
- -> ValueRef;
+ pub fn LLVMBuildFRem(B: BuilderRef,
+ LHS: ValueRef,
+ RHS: ValueRef,
+ Name: *c_char)
+ -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMBuildShl(B: BuilderRef,
- LHS: ValueRef,
- RHS: ValueRef,
- Name: *c_char)
- -> ValueRef;
+ pub fn LLVMBuildShl(B: BuilderRef,
+ LHS: ValueRef,
+ RHS: ValueRef,
+ Name: *c_char)
+ -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMBuildLShr(B: BuilderRef,
- LHS: ValueRef,
- RHS: ValueRef,
- Name: *c_char)
- -> ValueRef;
+ pub fn LLVMBuildLShr(B: BuilderRef,
+ LHS: ValueRef,
+ RHS: ValueRef,
+ Name: *c_char)
+ -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMBuildAShr(B: BuilderRef,
- LHS: ValueRef,
- RHS: ValueRef,
- Name: *c_char)
- -> ValueRef;
+ pub fn LLVMBuildAShr(B: BuilderRef,
+ LHS: ValueRef,
+ RHS: ValueRef,
+ Name: *c_char)
+ -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMBuildAnd(B: BuilderRef,
- LHS: ValueRef,
- RHS: ValueRef,
- Name: *c_char)
- -> ValueRef;
+ pub fn LLVMBuildAnd(B: BuilderRef,
+ LHS: ValueRef,
+ RHS: ValueRef,
+ Name: *c_char)
+ -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMBuildOr(B: BuilderRef,
- LHS: ValueRef,
- RHS: ValueRef,
- Name: *c_char)
- -> ValueRef;
+ pub fn LLVMBuildOr(B: BuilderRef,
+ LHS: ValueRef,
+ RHS: ValueRef,
+ Name: *c_char)
+ -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMBuildXor(B: BuilderRef,
- LHS: ValueRef,
- RHS: ValueRef,
- Name: *c_char)
- -> ValueRef;
+ pub fn LLVMBuildXor(B: BuilderRef,
+ LHS: ValueRef,
+ RHS: ValueRef,
+ Name: *c_char)
+ -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMBuildBinOp(B: BuilderRef,
- Op: Opcode,
- LHS: ValueRef,
- RHS: ValueRef,
- Name: *c_char)
+ pub fn LLVMBuildBinOp(B: BuilderRef,
+ Op: Opcode,
+ LHS: ValueRef,
+ RHS: ValueRef,
+ Name: *c_char)
-> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMBuildNeg(B: BuilderRef,
- V: ValueRef,
- Name: *c_char)
+ pub fn LLVMBuildNeg(B: BuilderRef, V: ValueRef, Name: *c_char)
-> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMBuildNSWNeg(B: BuilderRef,
- V: ValueRef,
- Name: *c_char)
+ pub fn LLVMBuildNSWNeg(B: BuilderRef, V: ValueRef, Name: *c_char)
-> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMBuildNUWNeg(B: BuilderRef,
- V: ValueRef,
- Name: *c_char)
+ pub fn LLVMBuildNUWNeg(B: BuilderRef, V: ValueRef, Name: *c_char)
-> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMBuildFNeg(B: BuilderRef,
- V: ValueRef,
- Name: *c_char)
+ pub fn LLVMBuildFNeg(B: BuilderRef, V: ValueRef, Name: *c_char)
-> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMBuildNot(B: BuilderRef,
- V: ValueRef,
- Name: *c_char)
+ pub fn LLVMBuildNot(B: BuilderRef, V: ValueRef, Name: *c_char)
-> ValueRef;
/* Memory */
#[fast_ffi]
- pub unsafe fn LLVMBuildMalloc(B: BuilderRef,
- Ty: TypeRef,
- Name: *c_char)
- -> ValueRef;
+ pub fn LLVMBuildMalloc(B: BuilderRef, Ty: TypeRef, Name: *c_char)
+ -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMBuildArrayMalloc(B: BuilderRef,
- Ty: TypeRef,
- Val: ValueRef,
- Name: *c_char) -> ValueRef;
+ pub fn LLVMBuildArrayMalloc(B: BuilderRef,
+ Ty: TypeRef,
+ Val: ValueRef,
+ Name: *c_char)
+ -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMBuildAlloca(B: BuilderRef,
- Ty: TypeRef,
- Name: *c_char)
+ pub fn LLVMBuildAlloca(B: BuilderRef, Ty: TypeRef, Name: *c_char)
-> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMBuildArrayAlloca(B: BuilderRef,
- Ty: TypeRef,
- Val: ValueRef,
- Name: *c_char) -> ValueRef;
+ pub fn LLVMBuildArrayAlloca(B: BuilderRef,
+ Ty: TypeRef,
+ Val: ValueRef,
+ Name: *c_char)
+ -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMBuildFree(B: BuilderRef,
- PointerVal: ValueRef) -> ValueRef;
+ pub fn LLVMBuildFree(B: BuilderRef, PointerVal: ValueRef) -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMBuildLoad(B: BuilderRef,
- PointerVal: ValueRef,
- Name: *c_char)
- -> ValueRef;
+ pub fn LLVMBuildLoad(B: BuilderRef,
+ PointerVal: ValueRef,
+ Name: *c_char)
+ -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMBuildStore(B: BuilderRef,
- Val: ValueRef,
- Ptr: ValueRef)
- -> ValueRef;
+ pub fn LLVMBuildStore(B: BuilderRef, Val: ValueRef, Ptr: ValueRef)
+ -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMBuildGEP(B: BuilderRef,
- Pointer: ValueRef,
- Indices: *ValueRef,
- NumIndices: c_uint,
- Name: *c_char)
+ pub fn LLVMBuildGEP(B: BuilderRef,
+ Pointer: ValueRef,
+ Indices: *ValueRef,
+ NumIndices: c_uint,
+ Name: *c_char)
-> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMBuildInBoundsGEP(B: BuilderRef, Pointer: ValueRef,
- Indices: *ValueRef, NumIndices: c_uint,
- Name: *c_char)
- -> ValueRef;
+ pub fn LLVMBuildInBoundsGEP(B: BuilderRef,
+ Pointer: ValueRef,
+ Indices: *ValueRef,
+ NumIndices: c_uint,
+ Name: *c_char)
+ -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMBuildStructGEP(B: BuilderRef,
- Pointer: ValueRef,
- Idx: c_uint,
- Name: *c_char)
+ pub fn LLVMBuildStructGEP(B: BuilderRef,
+ Pointer: ValueRef,
+ Idx: c_uint,
+ Name: *c_char)
-> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMBuildGlobalString(B: BuilderRef,
- Str: *c_char,
- Name: *c_char)
+ pub fn LLVMBuildGlobalString(B: BuilderRef,
+ Str: *c_char,
+ Name: *c_char)
-> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMBuildGlobalStringPtr(B: BuilderRef,
- Str: *c_char,
- Name: *c_char)
+ pub fn LLVMBuildGlobalStringPtr(B: BuilderRef,
+ Str: *c_char,
+ Name: *c_char)
-> ValueRef;
/* Casts */
#[fast_ffi]
- pub unsafe fn LLVMBuildTrunc(B: BuilderRef,
- Val: ValueRef,
- DestTy: TypeRef,
- Name: *c_char) -> ValueRef;
+ pub fn LLVMBuildTrunc(B: BuilderRef,
+ Val: ValueRef,
+ DestTy: TypeRef,
+ Name: *c_char)
+ -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMBuildZExt(B: BuilderRef,
- Val: ValueRef,
- DestTy: TypeRef,
- Name: *c_char)
- -> ValueRef;
+ pub fn LLVMBuildZExt(B: BuilderRef,
+ Val: ValueRef,
+ DestTy: TypeRef,
+ Name: *c_char)
+ -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMBuildSExt(B: BuilderRef,
- Val: ValueRef,
- DestTy: TypeRef,
- Name: *c_char)
- -> ValueRef;
+ pub fn LLVMBuildSExt(B: BuilderRef,
+ Val: ValueRef,
+ DestTy: TypeRef,
+ Name: *c_char)
+ -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMBuildFPToUI(B: BuilderRef,
- Val: ValueRef,
- DestTy: TypeRef,
- Name: *c_char) -> ValueRef;
+ pub fn LLVMBuildFPToUI(B: BuilderRef,
+ Val: ValueRef,
+ DestTy: TypeRef,
+ Name: *c_char)
+ -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMBuildFPToSI(B: BuilderRef,
- Val: ValueRef,
- DestTy: TypeRef,
- Name: *c_char) -> ValueRef;
+ pub fn LLVMBuildFPToSI(B: BuilderRef,
+ Val: ValueRef,
+ DestTy: TypeRef,
+ Name: *c_char)
+ -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMBuildUIToFP(B: BuilderRef,
- Val: ValueRef,
- DestTy: TypeRef,
- Name: *c_char) -> ValueRef;
+ pub fn LLVMBuildUIToFP(B: BuilderRef,
+ Val: ValueRef,
+ DestTy: TypeRef,
+ Name: *c_char)
+ -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMBuildSIToFP(B: BuilderRef,
- Val: ValueRef,
- DestTy: TypeRef,
- Name: *c_char) -> ValueRef;
+ pub fn LLVMBuildSIToFP(B: BuilderRef,
+ Val: ValueRef,
+ DestTy: TypeRef,
+ Name: *c_char)
+ -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMBuildFPTrunc(B: BuilderRef,
- Val: ValueRef,
- DestTy: TypeRef,
- Name: *c_char) -> ValueRef;
+ pub fn LLVMBuildFPTrunc(B: BuilderRef,
+ Val: ValueRef,
+ DestTy: TypeRef,
+ Name: *c_char)
+ -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMBuildFPExt(B: BuilderRef,
- Val: ValueRef,
- DestTy: TypeRef,
- Name: *c_char) -> ValueRef;
+ pub fn LLVMBuildFPExt(B: BuilderRef,
+ Val: ValueRef,
+ DestTy: TypeRef,
+ Name: *c_char)
+ -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMBuildPtrToInt(B: BuilderRef,
- Val: ValueRef,
- DestTy: TypeRef,
- Name: *c_char) -> ValueRef;
+ pub fn LLVMBuildPtrToInt(B: BuilderRef,
+ Val: ValueRef,
+ DestTy: TypeRef,
+ Name: *c_char)
+ -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMBuildIntToPtr(B: BuilderRef,
- Val: ValueRef,
- DestTy: TypeRef,
- Name: *c_char) -> ValueRef;
+ pub fn LLVMBuildIntToPtr(B: BuilderRef,
+ Val: ValueRef,
+ DestTy: TypeRef,
+ Name: *c_char)
+ -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMBuildBitCast(B: BuilderRef,
- Val: ValueRef,
- DestTy: TypeRef,
- Name: *c_char) -> ValueRef;
+ pub fn LLVMBuildBitCast(B: BuilderRef,
+ Val: ValueRef,
+ DestTy: TypeRef,
+ Name: *c_char)
+ -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMBuildZExtOrBitCast(B: BuilderRef,
- Val: ValueRef,
- DestTy: TypeRef,
- Name: *c_char)
+ pub fn LLVMBuildZExtOrBitCast(B: BuilderRef,
+ Val: ValueRef,
+ DestTy: TypeRef,
+ Name: *c_char)
-> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMBuildSExtOrBitCast(B: BuilderRef,
- Val: ValueRef,
- DestTy: TypeRef,
- Name: *c_char)
+ pub fn LLVMBuildSExtOrBitCast(B: BuilderRef,
+ Val: ValueRef,
+ DestTy: TypeRef,
+ Name: *c_char)
-> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMBuildTruncOrBitCast(B: BuilderRef,
- Val: ValueRef,
- DestTy: TypeRef,
- Name: *c_char)
- -> ValueRef;
- #[fast_ffi]
- pub unsafe fn LLVMBuildCast(B: BuilderRef, Op: Opcode, Val: ValueRef,
- DestTy: TypeRef, Name: *c_char) -> ValueRef;
- #[fast_ffi]
- pub unsafe fn LLVMBuildPointerCast(B: BuilderRef,
+ pub fn LLVMBuildTruncOrBitCast(B: BuilderRef,
Val: ValueRef,
DestTy: TypeRef,
Name: *c_char)
+ -> ValueRef;
+ #[fast_ffi]
+ pub fn LLVMBuildCast(B: BuilderRef,
+ Op: Opcode,
+ Val: ValueRef,
+ DestTy: TypeRef,
+ Name: *c_char) -> ValueRef;
+ #[fast_ffi]
+ pub fn LLVMBuildPointerCast(B: BuilderRef,
+ Val: ValueRef,
+ DestTy: TypeRef,
+ Name: *c_char)
-> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMBuildIntCast(B: BuilderRef,
- Val: ValueRef,
- DestTy: TypeRef,
- Name: *c_char) -> ValueRef;
+ pub fn LLVMBuildIntCast(B: BuilderRef,
+ Val: ValueRef,
+ DestTy: TypeRef,
+ Name: *c_char)
+ -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMBuildFPCast(B: BuilderRef,
- Val: ValueRef,
- DestTy: TypeRef,
- Name: *c_char) -> ValueRef;
+ pub fn LLVMBuildFPCast(B: BuilderRef,
+ Val: ValueRef,
+ DestTy: TypeRef,
+ Name: *c_char)
+ -> ValueRef;
/* Comparisons */
#[fast_ffi]
- pub unsafe fn LLVMBuildICmp(B: BuilderRef, Op: c_uint, LHS: ValueRef,
- RHS: ValueRef, Name: *c_char) -> ValueRef;
+ pub fn LLVMBuildICmp(B: BuilderRef,
+ Op: c_uint,
+ LHS: ValueRef,
+ RHS: ValueRef,
+ Name: *c_char)
+ -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMBuildFCmp(B: BuilderRef, Op: c_uint, LHS: ValueRef,
- RHS: ValueRef, Name: *c_char) -> ValueRef;
+ pub fn LLVMBuildFCmp(B: BuilderRef,
+ Op: c_uint,
+ LHS: ValueRef,
+ RHS: ValueRef,
+ Name: *c_char)
+ -> ValueRef;
/* Miscellaneous instructions */
#[fast_ffi]
- pub unsafe fn LLVMBuildPhi(B: BuilderRef,
- Ty: TypeRef,
- Name: *c_char)
- -> ValueRef;
+ pub fn LLVMBuildPhi(B: BuilderRef, Ty: TypeRef, Name: *c_char)
+ -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMBuildCall(B: BuilderRef,
- Fn: ValueRef,
- Args: *ValueRef,
- NumArgs: c_uint,
- Name: *c_char)
- -> ValueRef;
+ pub fn LLVMBuildCall(B: BuilderRef,
+ Fn: ValueRef,
+ Args: *ValueRef,
+ NumArgs: c_uint,
+ Name: *c_char)
+ -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMBuildSelect(B: BuilderRef,
- If: ValueRef,
- Then: ValueRef,
- Else: ValueRef,
- Name: *c_char)
- -> ValueRef;
+ pub fn LLVMBuildSelect(B: BuilderRef,
+ If: ValueRef,
+ Then: ValueRef,
+ Else: ValueRef,
+ Name: *c_char)
+ -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMBuildVAArg(B: BuilderRef,
- list: ValueRef,
- Ty: TypeRef,
- Name: *c_char)
- -> ValueRef;
+ pub fn LLVMBuildVAArg(B: BuilderRef,
+ list: ValueRef,
+ Ty: TypeRef,
+ Name: *c_char)
+ -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMBuildExtractElement(B: BuilderRef,
- VecVal: ValueRef,
- Index: ValueRef,
- Name: *c_char)
+ pub fn LLVMBuildExtractElement(B: BuilderRef,
+ VecVal: ValueRef,
+ Index: ValueRef,
+ Name: *c_char)
-> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMBuildInsertElement(B: BuilderRef,
- VecVal: ValueRef,
- EltVal: ValueRef,
- Index: ValueRef,
- Name: *c_char)
+ pub fn LLVMBuildInsertElement(B: BuilderRef,
+ VecVal: ValueRef,
+ EltVal: ValueRef,
+ Index: ValueRef,
+ Name: *c_char)
-> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMBuildShuffleVector(B: BuilderRef,
- V1: ValueRef,
- V2: ValueRef,
- Mask: ValueRef,
- Name: *c_char)
+ pub fn LLVMBuildShuffleVector(B: BuilderRef,
+ V1: ValueRef,
+ V2: ValueRef,
+ Mask: ValueRef,
+ Name: *c_char)
-> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMBuildExtractValue(B: BuilderRef,
- AggVal: ValueRef,
- Index: c_uint,
- Name: *c_char)
+ pub fn LLVMBuildExtractValue(B: BuilderRef,
+ AggVal: ValueRef,
+ Index: c_uint,
+ Name: *c_char)
-> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMBuildInsertValue(B: BuilderRef,
- AggVal: ValueRef,
- EltVal: ValueRef,
- Index: c_uint,
- Name: *c_char)
+ pub fn LLVMBuildInsertValue(B: BuilderRef,
+ AggVal: ValueRef,
+ EltVal: ValueRef,
+ Index: c_uint,
+ Name: *c_char)
-> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMBuildIsNull(B: BuilderRef,
- Val: ValueRef,
- Name: *c_char)
- -> ValueRef;
+ pub fn LLVMBuildIsNull(B: BuilderRef, Val: ValueRef, Name: *c_char)
+ -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMBuildIsNotNull(B: BuilderRef,
- Val: ValueRef,
- Name: *c_char)
- -> ValueRef;
+ pub fn LLVMBuildIsNotNull(B: BuilderRef, Val: ValueRef, Name: *c_char)
+ -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMBuildPtrDiff(B: BuilderRef,
- LHS: ValueRef,
- RHS: ValueRef,
- Name: *c_char) -> ValueRef;
+ pub fn LLVMBuildPtrDiff(B: BuilderRef,
+ LHS: ValueRef,
+ RHS: ValueRef,
+ Name: *c_char)
+ -> ValueRef;
/* Atomic Operations */
- pub unsafe fn LLVMBuildAtomicLoad(B: BuilderRef,
- PointerVal: ValueRef,
- Name: *c_char,
- Order: AtomicOrdering,
- Alignment: c_uint)
- -> ValueRef;
+ pub fn LLVMBuildAtomicLoad(B: BuilderRef,
+ PointerVal: ValueRef,
+ Name: *c_char,
+ Order: AtomicOrdering,
+ Alignment: c_uint)
+ -> ValueRef;
- pub unsafe fn LLVMBuildAtomicStore(B: BuilderRef,
- Val: ValueRef,
- Ptr: ValueRef,
- Order: AtomicOrdering,
- Alignment: c_uint)
- -> ValueRef;
+ pub fn LLVMBuildAtomicStore(B: BuilderRef,
+ Val: ValueRef,
+ Ptr: ValueRef,
+ Order: AtomicOrdering,
+ Alignment: c_uint)
+ -> ValueRef;
- pub unsafe fn LLVMBuildAtomicCmpXchg(B: BuilderRef,
- LHS: ValueRef,
- CMP: ValueRef,
- RHS: ValueRef,
- Order: AtomicOrdering)
- -> ValueRef;
- pub unsafe fn LLVMBuildAtomicRMW(B: BuilderRef,
- Op: AtomicBinOp,
- LHS: ValueRef,
- RHS: ValueRef,
- Order: AtomicOrdering)
- -> ValueRef;
+ pub fn LLVMBuildAtomicCmpXchg(B: BuilderRef,
+ LHS: ValueRef,
+ CMP: ValueRef,
+ RHS: ValueRef,
+ Order: AtomicOrdering)
+ -> ValueRef;
+ pub fn LLVMBuildAtomicRMW(B: BuilderRef,
+ Op: AtomicBinOp,
+ LHS: ValueRef,
+ RHS: ValueRef,
+ Order: AtomicOrdering)
+ -> ValueRef;
- pub unsafe fn LLVMBuildAtomicFence(B: BuilderRef, Order: AtomicOrdering);
+ pub fn LLVMBuildAtomicFence(B: BuilderRef, Order: AtomicOrdering);
/* Selected entries from the downcasts. */
#[fast_ffi]
- pub unsafe fn LLVMIsATerminatorInst(Inst: ValueRef) -> ValueRef;
+ pub fn LLVMIsATerminatorInst(Inst: ValueRef) -> ValueRef;
/** Writes a module to the specified path. Returns 0 on success. */
#[fast_ffi]
- pub unsafe fn LLVMWriteBitcodeToFile(M: ModuleRef,
- Path: *c_char) -> c_int;
+ pub fn LLVMWriteBitcodeToFile(M: ModuleRef, Path: *c_char) -> c_int;
/** Creates target data from a target layout string. */
#[fast_ffi]
- pub unsafe fn LLVMCreateTargetData(StringRep: *c_char)
- -> TargetDataRef;
- /** Adds the target data to the given pass manager. The pass manager
- references the target data only weakly. */
+ pub fn LLVMCreateTargetData(StringRep: *c_char) -> TargetDataRef;
+ /// Adds the target data to the given pass manager. The pass manager
+ /// references the target data only weakly.
#[fast_ffi]
- pub unsafe fn LLVMAddTargetData(TD: TargetDataRef,
- PM: PassManagerRef);
+ pub fn LLVMAddTargetData(TD: TargetDataRef, PM: PassManagerRef);
/** Number of bytes clobbered when doing a Store to *T. */
#[fast_ffi]
- pub unsafe fn LLVMStoreSizeOfType(TD: TargetDataRef, Ty: TypeRef)
- -> c_ulonglong;
+ pub fn LLVMStoreSizeOfType(TD: TargetDataRef, Ty: TypeRef)
+ -> c_ulonglong;
/** Number of bytes clobbered when doing a Store to *T. */
#[fast_ffi]
- pub unsafe fn LLVMSizeOfTypeInBits(TD: TargetDataRef, Ty: TypeRef)
- -> c_ulonglong;
+ pub fn LLVMSizeOfTypeInBits(TD: TargetDataRef, Ty: TypeRef)
+ -> c_ulonglong;
/** Distance between successive elements in an array of T.
Includes ABI padding. */
#[fast_ffi]
- pub unsafe fn LLVMABISizeOfType(TD: TargetDataRef, Ty: TypeRef)
- -> c_uint;
+ pub fn LLVMABISizeOfType(TD: TargetDataRef, Ty: TypeRef) -> c_uint;
/** Returns the preferred alignment of a type. */
#[fast_ffi]
- pub unsafe fn LLVMPreferredAlignmentOfType(TD: TargetDataRef,
- Ty: TypeRef) -> c_uint;
+ pub fn LLVMPreferredAlignmentOfType(TD: TargetDataRef, Ty: TypeRef)
+ -> c_uint;
/** Returns the minimum alignment of a type. */
#[fast_ffi]
- pub unsafe fn LLVMABIAlignmentOfType(TD: TargetDataRef,
- Ty: TypeRef) -> c_uint;
+ pub fn LLVMABIAlignmentOfType(TD: TargetDataRef, Ty: TypeRef)
+ -> c_uint;
- /** Computes the byte offset of the indexed struct element for a target. */
+ /// Computes the byte offset of the indexed struct element for a
+ /// target.
#[fast_ffi]
- pub unsafe fn LLVMOffsetOfElement(TD: TargetDataRef,
- StructTy: TypeRef,
- Element: c_uint)
- -> c_ulonglong;
+ pub fn LLVMOffsetOfElement(TD: TargetDataRef,
+ StructTy: TypeRef,
+ Element: c_uint)
+ -> c_ulonglong;
/**
* Returns the minimum alignment of a type when part of a call frame.
*/
#[fast_ffi]
- pub unsafe fn LLVMCallFrameAlignmentOfType(TD: TargetDataRef,
- Ty: TypeRef)
- -> c_uint;
+ pub fn LLVMCallFrameAlignmentOfType(TD: TargetDataRef, Ty: TypeRef)
+ -> c_uint;
/** Disposes target data. */
#[fast_ffi]
- pub unsafe fn LLVMDisposeTargetData(TD: TargetDataRef);
+ pub fn LLVMDisposeTargetData(TD: TargetDataRef);
/** Creates a pass manager. */
#[fast_ffi]
- pub unsafe fn LLVMCreatePassManager() -> PassManagerRef;
+ pub fn LLVMCreatePassManager() -> PassManagerRef;
/** Creates a function-by-function pass manager */
#[fast_ffi]
- pub unsafe fn LLVMCreateFunctionPassManagerForModule(M:ModuleRef) -> PassManagerRef;
+ pub fn LLVMCreateFunctionPassManagerForModule(M: ModuleRef)
+ -> PassManagerRef;
/** Disposes a pass manager. */
#[fast_ffi]
- pub unsafe fn LLVMDisposePassManager(PM: PassManagerRef);
+ pub fn LLVMDisposePassManager(PM: PassManagerRef);
/** Runs a pass manager on a module. */
#[fast_ffi]
- pub unsafe fn LLVMRunPassManager(PM: PassManagerRef,
- M: ModuleRef) -> Bool;
+ pub fn LLVMRunPassManager(PM: PassManagerRef, M: ModuleRef) -> Bool;
/** Runs the function passes on the provided function. */
#[fast_ffi]
- pub unsafe fn LLVMRunFunctionPassManager(FPM:PassManagerRef, F:ValueRef) -> Bool;
+ pub fn LLVMRunFunctionPassManager(FPM: PassManagerRef, F: ValueRef)
+ -> Bool;
/** Initializes all the function passes scheduled in the manager */
#[fast_ffi]
- pub unsafe fn LLVMInitializeFunctionPassManager(FPM:PassManagerRef) -> Bool;
+ pub fn LLVMInitializeFunctionPassManager(FPM: PassManagerRef) -> Bool;
/** Finalizes all the function passes scheduled in the manager */
#[fast_ffi]
- pub unsafe fn LLVMFinalizeFunctionPassManager(FPM:PassManagerRef) -> Bool;
+ pub fn LLVMFinalizeFunctionPassManager(FPM: PassManagerRef) -> Bool;
#[fast_ffi]
- pub unsafe fn LLVMInitializePasses();
+ pub fn LLVMInitializePasses();
#[fast_ffi]
- pub unsafe fn LLVMAddPass(PM:PassManagerRef,P:PassRef);
+ pub fn LLVMAddPass(PM: PassManagerRef, P: PassRef);
#[fast_ffi]
- pub unsafe fn LLVMCreatePass(PassName:*c_char) -> PassRef;
+ pub fn LLVMCreatePass(PassName: *c_char) -> PassRef;
#[fast_ffi]
- pub unsafe fn LLVMDestroyPass(P: PassRef);
+ pub fn LLVMDestroyPass(P: PassRef);
/** Adds a verification pass. */
#[fast_ffi]
- pub unsafe fn LLVMAddVerifierPass(PM: PassManagerRef);
+ pub fn LLVMAddVerifierPass(PM: PassManagerRef);
#[fast_ffi]
- pub unsafe fn LLVMAddGlobalOptimizerPass(PM: PassManagerRef);
+ pub fn LLVMAddGlobalOptimizerPass(PM: PassManagerRef);
#[fast_ffi]
- pub unsafe fn LLVMAddIPSCCPPass(PM: PassManagerRef);
+ pub fn LLVMAddIPSCCPPass(PM: PassManagerRef);
#[fast_ffi]
- pub unsafe fn LLVMAddDeadArgEliminationPass(PM: PassManagerRef);
+ pub fn LLVMAddDeadArgEliminationPass(PM: PassManagerRef);
#[fast_ffi]
- pub unsafe fn LLVMAddInstructionCombiningPass(PM: PassManagerRef);
+ pub fn LLVMAddInstructionCombiningPass(PM: PassManagerRef);
#[fast_ffi]
- pub unsafe fn LLVMAddCFGSimplificationPass(PM: PassManagerRef);
+ pub fn LLVMAddCFGSimplificationPass(PM: PassManagerRef);
#[fast_ffi]
- pub unsafe fn LLVMAddFunctionInliningPass(PM: PassManagerRef);
+ pub fn LLVMAddFunctionInliningPass(PM: PassManagerRef);
#[fast_ffi]
- pub unsafe fn LLVMAddFunctionAttrsPass(PM: PassManagerRef);
+ pub fn LLVMAddFunctionAttrsPass(PM: PassManagerRef);
#[fast_ffi]
- pub unsafe fn LLVMAddScalarReplAggregatesPass(PM: PassManagerRef);
+ pub fn LLVMAddScalarReplAggregatesPass(PM: PassManagerRef);
#[fast_ffi]
- pub unsafe fn LLVMAddScalarReplAggregatesPassSSA(PM: PassManagerRef);
+ pub fn LLVMAddScalarReplAggregatesPassSSA(PM: PassManagerRef);
#[fast_ffi]
- pub unsafe fn LLVMAddJumpThreadingPass(PM: PassManagerRef);
+ pub fn LLVMAddJumpThreadingPass(PM: PassManagerRef);
#[fast_ffi]
- pub unsafe fn LLVMAddConstantPropagationPass(PM: PassManagerRef);
+ pub fn LLVMAddConstantPropagationPass(PM: PassManagerRef);
#[fast_ffi]
- pub unsafe fn LLVMAddReassociatePass(PM: PassManagerRef);
+ pub fn LLVMAddReassociatePass(PM: PassManagerRef);
#[fast_ffi]
- pub unsafe fn LLVMAddLoopRotatePass(PM: PassManagerRef);
+ pub fn LLVMAddLoopRotatePass(PM: PassManagerRef);
#[fast_ffi]
- pub unsafe fn LLVMAddLICMPass(PM: PassManagerRef);
+ pub fn LLVMAddLICMPass(PM: PassManagerRef);
#[fast_ffi]
- pub unsafe fn LLVMAddLoopUnswitchPass(PM: PassManagerRef);
+ pub fn LLVMAddLoopUnswitchPass(PM: PassManagerRef);
#[fast_ffi]
- pub unsafe fn LLVMAddLoopDeletionPass(PM: PassManagerRef);
+ pub fn LLVMAddLoopDeletionPass(PM: PassManagerRef);
#[fast_ffi]
- pub unsafe fn LLVMAddLoopUnrollPass(PM: PassManagerRef);
+ pub fn LLVMAddLoopUnrollPass(PM: PassManagerRef);
#[fast_ffi]
- pub unsafe fn LLVMAddGVNPass(PM: PassManagerRef);
+ pub fn LLVMAddGVNPass(PM: PassManagerRef);
#[fast_ffi]
- pub unsafe fn LLVMAddMemCpyOptPass(PM: PassManagerRef);
+ pub fn LLVMAddMemCpyOptPass(PM: PassManagerRef);
#[fast_ffi]
- pub unsafe fn LLVMAddSCCPPass(PM: PassManagerRef);
+ pub fn LLVMAddSCCPPass(PM: PassManagerRef);
#[fast_ffi]
- pub unsafe fn LLVMAddDeadStoreEliminationPass(PM: PassManagerRef);
+ pub fn LLVMAddDeadStoreEliminationPass(PM: PassManagerRef);
#[fast_ffi]
- pub unsafe fn LLVMAddStripDeadPrototypesPass(PM: PassManagerRef);
+ pub fn LLVMAddStripDeadPrototypesPass(PM: PassManagerRef);
#[fast_ffi]
- pub unsafe fn LLVMAddConstantMergePass(PM: PassManagerRef);
+ pub fn LLVMAddConstantMergePass(PM: PassManagerRef);
#[fast_ffi]
- pub unsafe fn LLVMAddArgumentPromotionPass(PM: PassManagerRef);
+ pub fn LLVMAddArgumentPromotionPass(PM: PassManagerRef);
#[fast_ffi]
- pub unsafe fn LLVMAddTailCallEliminationPass(PM: PassManagerRef);
+ pub fn LLVMAddTailCallEliminationPass(PM: PassManagerRef);
#[fast_ffi]
- pub unsafe fn LLVMAddIndVarSimplifyPass(PM: PassManagerRef);
+ pub fn LLVMAddIndVarSimplifyPass(PM: PassManagerRef);
#[fast_ffi]
- pub unsafe fn LLVMAddAggressiveDCEPass(PM: PassManagerRef);
+ pub fn LLVMAddAggressiveDCEPass(PM: PassManagerRef);
#[fast_ffi]
- pub unsafe fn LLVMAddGlobalDCEPass(PM: PassManagerRef);
+ pub fn LLVMAddGlobalDCEPass(PM: PassManagerRef);
#[fast_ffi]
- pub unsafe fn LLVMAddCorrelatedValuePropagationPass(PM:
- PassManagerRef);
+ pub fn LLVMAddCorrelatedValuePropagationPass(PM: PassManagerRef);
#[fast_ffi]
- pub unsafe fn LLVMAddPruneEHPass(PM: PassManagerRef);
+ pub fn LLVMAddPruneEHPass(PM: PassManagerRef);
#[fast_ffi]
- pub unsafe fn LLVMAddSimplifyLibCallsPass(PM: PassManagerRef);
+ pub fn LLVMAddSimplifyLibCallsPass(PM: PassManagerRef);
#[fast_ffi]
- pub unsafe fn LLVMAddLoopIdiomPass(PM: PassManagerRef);
+ pub fn LLVMAddLoopIdiomPass(PM: PassManagerRef);
#[fast_ffi]
- pub unsafe fn LLVMAddEarlyCSEPass(PM: PassManagerRef);
+ pub fn LLVMAddEarlyCSEPass(PM: PassManagerRef);
#[fast_ffi]
- pub unsafe fn LLVMAddTypeBasedAliasAnalysisPass(PM: PassManagerRef);
+ pub fn LLVMAddTypeBasedAliasAnalysisPass(PM: PassManagerRef);
#[fast_ffi]
- pub unsafe fn LLVMAddBasicAliasAnalysisPass(PM: PassManagerRef);
+ pub fn LLVMAddBasicAliasAnalysisPass(PM: PassManagerRef);
#[fast_ffi]
- pub unsafe fn LLVMPassManagerBuilderCreate() -> PassManagerBuilderRef;
+ pub fn LLVMPassManagerBuilderCreate() -> PassManagerBuilderRef;
#[fast_ffi]
- pub unsafe fn LLVMPassManagerBuilderDispose(PMB:
- PassManagerBuilderRef);
+ pub fn LLVMPassManagerBuilderDispose(PMB: PassManagerBuilderRef);
#[fast_ffi]
- pub unsafe fn LLVMPassManagerBuilderSetOptLevel(
- PMB: PassManagerBuilderRef, OptimizationLevel: c_uint);
+ pub fn LLVMPassManagerBuilderSetOptLevel(PMB: PassManagerBuilderRef,
+ OptimizationLevel: c_uint);
#[fast_ffi]
- pub unsafe fn LLVMPassManagerBuilderSetSizeLevel(
- PMB: PassManagerBuilderRef, Value: Bool);
+ pub fn LLVMPassManagerBuilderSetSizeLevel(PMB: PassManagerBuilderRef,
+ Value: Bool);
#[fast_ffi]
- pub unsafe fn LLVMPassManagerBuilderSetDisableUnitAtATime(
- PMB: PassManagerBuilderRef, Value: Bool);
+ pub fn LLVMPassManagerBuilderSetDisableUnitAtATime(
+ PMB: PassManagerBuilderRef,
+ Value: Bool);
#[fast_ffi]
- pub unsafe fn LLVMPassManagerBuilderSetDisableUnrollLoops(
- PMB: PassManagerBuilderRef, Value: Bool);
+ pub fn LLVMPassManagerBuilderSetDisableUnrollLoops(
+ PMB: PassManagerBuilderRef,
+ Value: Bool);
#[fast_ffi]
- pub unsafe fn LLVMPassManagerBuilderSetDisableSimplifyLibCalls
- (PMB: PassManagerBuilderRef, Value: Bool);
+ pub fn LLVMPassManagerBuilderSetDisableSimplifyLibCalls(
+ PMB: PassManagerBuilderRef,
+ Value: Bool);
#[fast_ffi]
- pub unsafe fn LLVMPassManagerBuilderUseInlinerWithThreshold
- (PMB: PassManagerBuilderRef, threshold: c_uint);
+ pub fn LLVMPassManagerBuilderUseInlinerWithThreshold(
+ PMB: PassManagerBuilderRef,
+ threshold: c_uint);
#[fast_ffi]
- pub unsafe fn LLVMPassManagerBuilderPopulateModulePassManager
- (PMB: PassManagerBuilderRef, PM: PassManagerRef);
+ pub fn LLVMPassManagerBuilderPopulateModulePassManager(
+ PMB: PassManagerBuilderRef,
+ PM: PassManagerRef);
#[fast_ffi]
- pub unsafe fn LLVMPassManagerBuilderPopulateFunctionPassManager
- (PMB: PassManagerBuilderRef, PM: PassManagerRef);
+ pub fn LLVMPassManagerBuilderPopulateFunctionPassManager(
+ PMB: PassManagerBuilderRef,
+ PM: PassManagerRef);
/** Destroys a memory buffer. */
#[fast_ffi]
- pub unsafe fn LLVMDisposeMemoryBuffer(MemBuf: MemoryBufferRef);
+ pub fn LLVMDisposeMemoryBuffer(MemBuf: MemoryBufferRef);
/* Stuff that's in rustllvm/ because it's not upstream yet. */
/** Opens an object file. */
#[fast_ffi]
- pub unsafe fn LLVMCreateObjectFile(MemBuf: MemoryBufferRef)
- -> ObjectFileRef;
+ pub fn LLVMCreateObjectFile(MemBuf: MemoryBufferRef) -> ObjectFileRef;
/** Closes an object file. */
#[fast_ffi]
- pub unsafe fn LLVMDisposeObjectFile(ObjFile: ObjectFileRef);
+ pub fn LLVMDisposeObjectFile(ObjFile: ObjectFileRef);
/** Enumerates the sections in an object file. */
#[fast_ffi]
- pub unsafe fn LLVMGetSections(ObjFile: ObjectFileRef)
- -> SectionIteratorRef;
+ pub fn LLVMGetSections(ObjFile: ObjectFileRef) -> SectionIteratorRef;
/** Destroys a section iterator. */
#[fast_ffi]
- pub unsafe fn LLVMDisposeSectionIterator(SI: SectionIteratorRef);
+ pub fn LLVMDisposeSectionIterator(SI: SectionIteratorRef);
/** Returns true if the section iterator is at the end of the section
list: */
#[fast_ffi]
- pub unsafe fn LLVMIsSectionIteratorAtEnd(ObjFile: ObjectFileRef,
- SI: SectionIteratorRef) -> Bool;
+ pub fn LLVMIsSectionIteratorAtEnd(ObjFile: ObjectFileRef,
+ SI: SectionIteratorRef)
+ -> Bool;
/** Moves the section iterator to point to the next section. */
#[fast_ffi]
- pub unsafe fn LLVMMoveToNextSection(SI: SectionIteratorRef);
+ pub fn LLVMMoveToNextSection(SI: SectionIteratorRef);
/** Returns the current section name. */
#[fast_ffi]
- pub unsafe fn LLVMGetSectionName(SI: SectionIteratorRef) -> *c_char;
+ pub fn LLVMGetSectionName(SI: SectionIteratorRef) -> *c_char;
/** Returns the current section size. */
#[fast_ffi]
- pub unsafe fn LLVMGetSectionSize(SI: SectionIteratorRef)
- -> c_ulonglong;
+ pub fn LLVMGetSectionSize(SI: SectionIteratorRef) -> c_ulonglong;
/** Returns the current section contents as a string buffer. */
#[fast_ffi]
- pub unsafe fn LLVMGetSectionContents(SI: SectionIteratorRef)
- -> *c_char;
+ pub fn LLVMGetSectionContents(SI: SectionIteratorRef) -> *c_char;
/** Reads the given file and returns it as a memory buffer. Use
LLVMDisposeMemoryBuffer() to get rid of it. */
#[fast_ffi]
- pub unsafe fn LLVMRustCreateMemoryBufferWithContentsOfFile(
- Path: *c_char)
- -> MemoryBufferRef;
+ pub fn LLVMRustCreateMemoryBufferWithContentsOfFile(Path: *c_char)
+ -> MemoryBufferRef;
#[fast_ffi]
- pub unsafe fn LLVMRustWriteOutputFile(PM: PassManagerRef,
- M: ModuleRef,
- Triple: *c_char,
- Feature: *c_char,
- Output: *c_char,
- // FIXME: When #2334 is fixed,
- // change c_uint to FileType
- FileType: c_uint,
- OptLevel: c_int,
- EnableSegmentedStacks: bool)
- -> bool;
+ pub fn LLVMRustWriteOutputFile(PM: PassManagerRef,
+ M: ModuleRef,
+ Triple: *c_char,
+ Feature: *c_char,
+ Output: *c_char,
+ // FIXME: When #2334 is fixed,
+ // change c_uint to FileType
+ FileType: c_uint,
+ OptLevel: c_int,
+ EnableSegmentedStacks: bool)
+ -> bool;
/** Returns a string describing the last error caused by an LLVMRust*
call. */
#[fast_ffi]
- pub unsafe fn LLVMRustGetLastError() -> *c_char;
+ pub fn LLVMRustGetLastError() -> *c_char;
/** Prepare the JIT. Returns a memory manager that can load crates. */
#[fast_ffi]
- pub unsafe fn LLVMRustPrepareJIT(__morestack: *()) -> *();
+ pub fn LLVMRustPrepareJIT(__morestack: *()) -> *();
/** Load a crate into the memory manager. */
#[fast_ffi]
- pub unsafe fn LLVMRustLoadCrate(MM: *(),
- Filename: *c_char)
- -> bool;
+ pub fn LLVMRustLoadCrate(MM: *(), Filename: *c_char) -> bool;
/** Execute the JIT engine. */
#[fast_ffi]
- pub unsafe fn LLVMRustBuildJIT(MM: *(),
- M: ModuleRef,
- EnableSegmentedStacks: bool) -> ExecutionEngineRef;
+ pub fn LLVMRustBuildJIT(MM: *(),
+ M: ModuleRef,
+ EnableSegmentedStacks: bool)
+ -> ExecutionEngineRef;
/** Parses the bitcode in the given memory buffer. */
#[fast_ffi]
- pub unsafe fn LLVMRustParseBitcode(MemBuf: MemoryBufferRef)
- -> ModuleRef;
+ pub fn LLVMRustParseBitcode(MemBuf: MemoryBufferRef) -> ModuleRef;
/** Parses LLVM asm in the given file */
#[fast_ffi]
- pub unsafe fn LLVMRustParseAssemblyFile(Filename: *c_char,
- C: ContextRef)
- -> ModuleRef;
+ pub fn LLVMRustParseAssemblyFile(Filename: *c_char, C: ContextRef)
+ -> ModuleRef;
#[fast_ffi]
- pub unsafe fn LLVMRustAddPrintModulePass(PM: PassManagerRef,
- M: ModuleRef,
- Output: *c_char);
+ pub fn LLVMRustAddPrintModulePass(PM: PassManagerRef,
+ M: ModuleRef,
+ Output: *c_char);
/** Turn on LLVM pass-timing. */
#[fast_ffi]
- pub unsafe fn LLVMRustEnableTimePasses();
+ pub fn LLVMRustEnableTimePasses();
/// Print the pass timings since static dtors aren't picking them up.
#[fast_ffi]
- pub unsafe fn LLVMRustPrintPassTimings();
+ pub fn LLVMRustPrintPassTimings();
#[fast_ffi]
- pub unsafe fn LLVMRustStartMultithreading() -> bool;
+ pub fn LLVMRustStartMultithreading() -> bool;
#[fast_ffi]
- pub unsafe fn LLVMStructCreateNamed(C: ContextRef, Name: *c_char)
- -> TypeRef;
+ pub fn LLVMStructCreateNamed(C: ContextRef, Name: *c_char) -> TypeRef;
#[fast_ffi]
- pub unsafe fn LLVMStructSetBody(StructTy: TypeRef,
- ElementTypes: *TypeRef,
- ElementCount: c_uint,
- Packed: Bool);
+ pub fn LLVMStructSetBody(StructTy: TypeRef,
+ ElementTypes: *TypeRef,
+ ElementCount: c_uint,
+ Packed: Bool);
#[fast_ffi]
- pub unsafe fn LLVMConstNamedStruct(S: TypeRef,
- ConstantVals: *ValueRef,
- Count: c_uint)
- -> ValueRef;
+ pub fn LLVMConstNamedStruct(S: TypeRef,
+ ConstantVals: *ValueRef,
+ Count: c_uint)
+ -> ValueRef;
/** Enables LLVM debug output. */
#[fast_ffi]
- pub unsafe fn LLVMSetDebug(Enabled: c_int);
+ pub fn LLVMSetDebug(Enabled: c_int);
/** Prepares inline assembly. */
#[fast_ffi]
- pub unsafe fn LLVMInlineAsm(Ty: TypeRef, AsmString: *c_char,
- Constraints: *c_char, SideEffects: Bool,
- AlignStack: Bool, Dialect: c_uint)
- -> ValueRef;
+ pub fn LLVMInlineAsm(Ty: TypeRef,
+ AsmString: *c_char,
+ Constraints: *c_char,
+ SideEffects: Bool,
+ AlignStack: Bool,
+ Dialect: c_uint)
+ -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMDIBuilderCreate(M: ModuleRef) -> DIBuilderRef;
+ pub fn LLVMDIBuilderCreate(M: ModuleRef) -> DIBuilderRef;
#[fast_ffi]
- pub unsafe fn LLVMDIBuilderDispose(Builder: DIBuilderRef);
+ pub fn LLVMDIBuilderDispose(Builder: DIBuilderRef);
#[fast_ffi]
- pub unsafe fn LLVMDIBuilderFinalize(Builder: DIBuilderRef);
+ pub fn LLVMDIBuilderFinalize(Builder: DIBuilderRef);
- #[fast_ffi]
- pub unsafe fn LLVMDIBuilderCreateCompileUnit(
- Builder: DIBuilderRef,
- Lang: c_uint,
- File: *c_char,
- Dir: *c_char,
- Producer: *c_char,
- isOptimized: bool,
- Flags: *c_char,
- RuntimeVer: c_uint,
- SplitName: *c_char);
-
- #[fast_ffi]
- pub unsafe fn LLVMDIBuilderCreateFile(
- Builder: DIBuilderRef,
- Filename: *c_char,
- Directory: *c_char) -> DIFile;
-
- #[fast_ffi]
- pub unsafe fn LLVMDIBuilderCreateSubroutineType(
- Builder: DIBuilderRef,
- File: DIFile,
- ParameterTypes: DIArray) -> DICompositeType;
+ #[fast_ffi]
+ pub fn LLVMDIBuilderCreateCompileUnit(Builder: DIBuilderRef,
+ Lang: c_uint,
+ File: *c_char,
+ Dir: *c_char,
+ Producer: *c_char,
+ isOptimized: bool,
+ Flags: *c_char,
+ RuntimeVer: c_uint,
+ SplitName: *c_char);
+
+ #[fast_ffi]
+ pub fn LLVMDIBuilderCreateFile(Builder: DIBuilderRef,
+ Filename: *c_char,
+ Directory: *c_char)
+ -> DIFile;
+
+ #[fast_ffi]
+ pub fn LLVMDIBuilderCreateSubroutineType(Builder: DIBuilderRef,
+ File: DIFile,
+ ParameterTypes: DIArray)
+ -> DICompositeType;
- #[fast_ffi]
- pub unsafe fn LLVMDIBuilderCreateFunction(
- Builder: DIBuilderRef,
- Scope: DIDescriptor,
- Name: *c_char,
- LinkageName: *c_char,
- File: DIFile,
- LineNo: c_uint,
- Ty: DIType,
- isLocalToUnit: bool,
- isDefinition: bool,
- ScopeLine: c_uint,
- Flags: c_uint,
- isOptimized: bool,
- Fn: ValueRef,
- TParam: ValueRef,
- Decl: ValueRef) -> DISubprogram;
+ #[fast_ffi]
+ pub fn LLVMDIBuilderCreateFunction(Builder: DIBuilderRef,
+ Scope: DIDescriptor,
+ Name: *c_char,
+ LinkageName: *c_char,
+ File: DIFile,
+ LineNo: c_uint,
+ Ty: DIType,
+ isLocalToUnit: bool,
+ isDefinition: bool,
+ ScopeLine: c_uint,
+ Flags: c_uint,
+ isOptimized: bool,
+ Fn: ValueRef,
+ TParam: ValueRef,
+ Decl: ValueRef)
+ -> DISubprogram;
+
+ #[fast_ffi]
+ pub fn LLVMDIBuilderCreateBasicType(Builder: DIBuilderRef,
+ Name: *c_char,
+ SizeInBits: c_ulonglong,
+ AlignInBits: c_ulonglong,
+ Encoding: c_uint)
+ -> DIBasicType;
+
+ #[fast_ffi]
+ pub fn LLVMDIBuilderCreatePointerType(Builder: DIBuilderRef,
+ PointeeTy: DIType,
+ SizeInBits: c_ulonglong,
+ AlignInBits: c_ulonglong,
+ Name: *c_char)
+ -> DIDerivedType;
+
+ #[fast_ffi]
+ pub fn LLVMDIBuilderCreateStructType(Builder: DIBuilderRef,
+ Scope: DIDescriptor,
+ Name: *c_char,
+ File: DIFile,
+ LineNumber: c_uint,
+ SizeInBits: c_ulonglong,
+ AlignInBits: c_ulonglong,
+ Flags: c_uint,
+ DerivedFrom: DIType,
+ Elements: DIArray,
+ RunTimeLang: c_uint,
+ VTableHolder: ValueRef)
+ -> DICompositeType;
+
+ #[fast_ffi]
+ pub fn LLVMDIBuilderCreateMemberType(Builder: DIBuilderRef,
+ Scope: DIDescriptor,
+ Name: *c_char,
+ File: DIFile,
+ LineNo: c_uint,
+ SizeInBits: c_ulonglong,
+ AlignInBits: c_ulonglong,
+ OffsetInBits: c_ulonglong,
+ Flags: c_uint,
+ Ty: DIType)
+ -> DIDerivedType;
+
+ #[fast_ffi]
+ pub fn LLVMDIBuilderCreateLexicalBlock(Builder: DIBuilderRef,
+ Scope: DIDescriptor,
+ File: DIFile,
+ Line: c_uint,
+ Col: c_uint)
+ -> DILexicalBlock;
+
+ #[fast_ffi]
+ pub fn LLVMDIBuilderCreateLocalVariable(Builder: DIBuilderRef,
+ Tag: c_uint,
+ Scope: DIDescriptor,
+ Name: *c_char,
+ File: DIFile,
+ LineNo: c_uint,
+ Ty: DIType,
+ AlwaysPreserve: bool,
+ Flags: c_uint,
+ ArgNo: c_uint)
+ -> DIVariable;
+
+ #[fast_ffi]
+ pub fn LLVMDIBuilderCreateArrayType(Builder: DIBuilderRef,
+ Size: c_ulonglong,
+ AlignInBits: c_ulonglong,
+ Ty: DIType,
+ Subscripts: DIArray)
+ -> DIType;
+
+ #[fast_ffi]
+ pub fn LLVMDIBuilderCreateVectorType(Builder: DIBuilderRef,
+ Size: c_ulonglong,
+ AlignInBits: c_ulonglong,
+ Ty: DIType,
+ Subscripts: DIArray)
+ -> DIType;
+
+ #[fast_ffi]
+ pub fn LLVMDIBuilderGetOrCreateSubrange(Builder: DIBuilderRef,
+ Lo: c_longlong,
+ Count: c_longlong)
+ -> DISubrange;
+
+ #[fast_ffi]
+ pub fn LLVMDIBuilderGetOrCreateArray(Builder: DIBuilderRef,
+ Ptr: *DIDescriptor,
+ Count: c_uint)
+ -> DIArray;
+
+ #[fast_ffi]
+ pub fn LLVMDIBuilderInsertDeclareAtEnd(Builder: DIBuilderRef,
+ Val: ValueRef,
+ VarInfo: DIVariable,
+ InsertAtEnd: BasicBlockRef)
+ -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMDIBuilderCreateBasicType(
- Builder: DIBuilderRef,
- Name: *c_char,
- SizeInBits: c_ulonglong,
- AlignInBits: c_ulonglong,
- Encoding: c_uint) -> DIBasicType;
+ pub fn LLVMDIBuilderInsertDeclareBefore(Builder: DIBuilderRef,
+ Val: ValueRef,
+ VarInfo: DIVariable,
+ InsertBefore: ValueRef)
+ -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMDIBuilderCreatePointerType(
- Builder: DIBuilderRef,
- PointeeTy: DIType,
- SizeInBits: c_ulonglong,
- AlignInBits: c_ulonglong,
- Name: *c_char) -> DIDerivedType;
+ pub fn LLVMDIBuilderCreateEnumerator(Builder: DIBuilderRef,
+ Name: *c_char,
+ Val: c_ulonglong)
+ -> ValueRef;
#[fast_ffi]
- pub unsafe fn LLVMDIBuilderCreateStructType(
- Builder: DIBuilderRef,
- Scope: DIDescriptor,
- Name: *c_char,
- File: DIFile,
- LineNumber: c_uint,
- SizeInBits: c_ulonglong,
- AlignInBits: c_ulonglong,
- Flags: c_uint,
- DerivedFrom: DIType,
- Elements: DIArray,
- RunTimeLang: c_uint,
- VTableHolder: ValueRef) -> DICompositeType;
-
- #[fast_ffi]
- pub unsafe fn LLVMDIBuilderCreateMemberType(
- Builder: DIBuilderRef,
- Scope: DIDescriptor,
- Name: *c_char,
- File: DIFile,
- LineNo: c_uint,
- SizeInBits: c_ulonglong,
- AlignInBits: c_ulonglong,
- OffsetInBits: c_ulonglong,
- Flags: c_uint,
- Ty: DIType) -> DIDerivedType;
-
- #[fast_ffi]
- pub unsafe fn LLVMDIBuilderCreateLexicalBlock(
- Builder: DIBuilderRef,
- Scope: DIDescriptor,
- File: DIFile,
- Line: c_uint,
- Col: c_uint) -> DILexicalBlock;
-
- #[fast_ffi]
- pub unsafe fn LLVMDIBuilderCreateLocalVariable(
- Builder: DIBuilderRef,
- Tag: c_uint,
- Scope: DIDescriptor,
- Name: *c_char,
- File: DIFile,
- LineNo: c_uint,
- Ty: DIType,
- AlwaysPreserve: bool,
- Flags: c_uint,
- ArgNo: c_uint) -> DIVariable;
-
- #[fast_ffi]
- pub unsafe fn LLVMDIBuilderCreateArrayType(
- Builder: DIBuilderRef,
- Size: c_ulonglong,
- AlignInBits: c_ulonglong,
- Ty: DIType,
- Subscripts: DIArray) -> DIType;
-
- #[fast_ffi]
- pub unsafe fn LLVMDIBuilderCreateVectorType(
- Builder: DIBuilderRef,
- Size: c_ulonglong,
- AlignInBits: c_ulonglong,
- Ty: DIType,
- Subscripts: DIArray) -> DIType;
-
- #[fast_ffi]
- pub unsafe fn LLVMDIBuilderGetOrCreateSubrange(
- Builder: DIBuilderRef,
- Lo: c_longlong,
- Count: c_longlong) -> DISubrange;
-
- #[fast_ffi]
- pub unsafe fn LLVMDIBuilderGetOrCreateArray(
- Builder: DIBuilderRef,
- Ptr: *DIDescriptor,
- Count: c_uint) -> DIArray;
-
- #[fast_ffi]
- pub unsafe fn LLVMDIBuilderInsertDeclareAtEnd(
- Builder: DIBuilderRef,
- Val: ValueRef,
- VarInfo: DIVariable,
- InsertAtEnd: BasicBlockRef) -> ValueRef;
-
- #[fast_ffi]
- pub unsafe fn LLVMDIBuilderInsertDeclareBefore(
- Builder: DIBuilderRef,
- Val: ValueRef,
- VarInfo: DIVariable,
- InsertBefore: ValueRef) -> ValueRef;
-
- #[fast_ffi]
- pub unsafe fn LLVMDIBuilderCreateEnumerator(
- Builder: DIBuilderRef,
- Name: *c_char,
- Val: c_ulonglong) -> ValueRef;
-
- #[fast_ffi]
- pub unsafe fn LLVMDIBuilderCreateEnumerationType(
- Builder: DIBuilderRef,
- Scope: ValueRef,
- Name: *c_char,
- File: ValueRef,
- LineNumber: c_uint,
- SizeInBits: c_ulonglong,
- AlignInBits: c_ulonglong,
- Elements: ValueRef,
- ClassType: ValueRef) -> ValueRef;
-
- #[fast_ffi]
- pub unsafe fn LLVMDIBuilderCreateUnionType(
- Builder: DIBuilderRef,
- Scope: ValueRef,
- Name: *c_char,
- File: ValueRef,
- LineNumber: c_uint,
- SizeInBits: c_ulonglong,
- AlignInBits: c_ulonglong,
- Flags: c_uint ,
- Elements: ValueRef,
- RunTimeLang: c_uint) -> ValueRef;
+ pub fn LLVMDIBuilderCreateEnumerationType(Builder: DIBuilderRef,
+ Scope: ValueRef,
+ Name: *c_char,
+ File: ValueRef,
+ LineNumber: c_uint,
+ SizeInBits: c_ulonglong,
+ AlignInBits: c_ulonglong,
+ Elements: ValueRef,
+ ClassType: ValueRef)
+ -> ValueRef;
+
+ #[fast_ffi]
+ pub fn LLVMDIBuilderCreateUnionType(Builder: DIBuilderRef,
+ Scope: ValueRef,
+ Name: *c_char,
+ File: ValueRef,
+ LineNumber: c_uint,
+ SizeInBits: c_ulonglong,
+ AlignInBits: c_ulonglong,
+ Flags: c_uint,
+ Elements: ValueRef,
+ RunTimeLang: c_uint)
+ -> ValueRef;
}
}
use libc::types::os::arch::c95::{c_char, c_int};
extern {
- pub unsafe fn isalnum(c: c_int) -> c_int;
- pub unsafe fn isalpha(c: c_int) -> c_int;
- pub unsafe fn iscntrl(c: c_int) -> c_int;
- pub unsafe fn isdigit(c: c_int) -> c_int;
- pub unsafe fn isgraph(c: c_int) -> c_int;
- pub unsafe fn islower(c: c_int) -> c_int;
- pub unsafe fn isprint(c: c_int) -> c_int;
- pub unsafe fn ispunct(c: c_int) -> c_int;
- pub unsafe fn isspace(c: c_int) -> c_int;
- pub unsafe fn isupper(c: c_int) -> c_int;
- pub unsafe fn isxdigit(c: c_int) -> c_int;
- pub unsafe fn tolower(c: c_char) -> c_char;
- pub unsafe fn toupper(c: c_char) -> c_char;
+ pub fn isalnum(c: c_int) -> c_int;
+ pub fn isalpha(c: c_int) -> c_int;
+ pub fn iscntrl(c: c_int) -> c_int;
+ pub fn isdigit(c: c_int) -> c_int;
+ pub fn isgraph(c: c_int) -> c_int;
+ pub fn islower(c: c_int) -> c_int;
+ pub fn isprint(c: c_int) -> c_int;
+ pub fn ispunct(c: c_int) -> c_int;
+ pub fn isspace(c: c_int) -> c_int;
+ pub fn isupper(c: c_int) -> c_int;
+ pub fn isxdigit(c: c_int) -> c_int;
+ pub fn tolower(c: c_char) -> c_char;
+ pub fn toupper(c: c_char) -> c_char;
}
}
use libc::types::os::arch::c95::{c_char, c_int, c_long, size_t};
extern {
- pub unsafe fn fopen(filename: *c_char, mode: *c_char)
- -> *FILE;
- pub unsafe fn freopen(filename: *c_char,
- mode: *c_char,
- file: *FILE)
- -> *FILE;
- pub unsafe fn fflush(file: *FILE) -> c_int;
- pub unsafe fn fclose(file: *FILE) -> c_int;
- pub unsafe fn remove(filename: *c_char) -> c_int;
- pub unsafe fn rename(oldname: *c_char, newname: *c_char)
- -> c_int;
- pub unsafe fn tmpfile() -> *FILE;
- pub unsafe fn setvbuf(stream: *FILE,
- buffer: *c_char,
- mode: c_int,
- size: size_t)
- -> c_int;
- pub unsafe fn setbuf(stream: *FILE, buf: *c_char);
+ pub fn fopen(filename: *c_char, mode: *c_char) -> *FILE;
+ pub fn freopen(filename: *c_char, mode: *c_char, file: *FILE)
+ -> *FILE;
+ pub fn fflush(file: *FILE) -> c_int;
+ pub fn fclose(file: *FILE) -> c_int;
+ pub fn remove(filename: *c_char) -> c_int;
+ pub fn rename(oldname: *c_char, newname: *c_char) -> c_int;
+ pub fn tmpfile() -> *FILE;
+ pub fn setvbuf(stream: *FILE,
+ buffer: *c_char,
+ mode: c_int,
+ size: size_t)
+ -> c_int;
+ pub fn setbuf(stream: *FILE, buf: *c_char);
// Omitted: printf and scanf variants.
- pub unsafe fn fgetc(stream: *FILE) -> c_int;
+ pub fn fgetc(stream: *FILE) -> c_int;
#[fast_ffi]
- pub unsafe fn fgets(buf: *mut c_char,
- n: c_int,
- stream: *FILE)
- -> *c_char;
+ pub fn fgets(buf: *mut c_char, n: c_int, stream: *FILE)
+ -> *c_char;
#[fast_ffi]
- pub unsafe fn fputc(c: c_int, stream: *FILE) -> c_int;
+ pub fn fputc(c: c_int, stream: *FILE) -> c_int;
#[fast_ffi]
- pub unsafe fn fputs(s: *c_char, stream: *FILE) -> *c_char;
+ pub fn fputs(s: *c_char, stream: *FILE) -> *c_char;
// Omitted: getc, getchar (might be macros).
// Omitted: gets, so ridiculously unsafe that it should not
// survive.
// Omitted: putc, putchar (might be macros).
- pub unsafe fn puts(s: *c_char) -> c_int;
- pub unsafe fn ungetc(c: c_int, stream: *FILE) -> c_int;
+ pub fn puts(s: *c_char) -> c_int;
+ pub fn ungetc(c: c_int, stream: *FILE) -> c_int;
#[fast_ffi]
- pub unsafe fn fread(ptr: *mut c_void,
- size: size_t,
- nobj: size_t,
- stream: *FILE)
- -> size_t;
+ pub fn fread(ptr: *mut c_void,
+ size: size_t,
+ nobj: size_t,
+ stream: *FILE)
+ -> size_t;
#[fast_ffi]
- pub unsafe fn fwrite(ptr: *c_void,
- size: size_t,
- nobj: size_t,
- stream: *FILE)
- -> size_t;
- pub unsafe fn fseek(stream: *FILE,
- offset: c_long,
- whence: c_int)
- -> c_int;
- pub unsafe fn ftell(stream: *FILE) -> c_long;
- pub unsafe fn rewind(stream: *FILE);
- pub unsafe fn fgetpos(stream: *FILE, ptr: *fpos_t) -> c_int;
- pub unsafe fn fsetpos(stream: *FILE, ptr: *fpos_t) -> c_int;
- pub unsafe fn feof(stream: *FILE) -> c_int;
- pub unsafe fn ferror(stream: *FILE) -> c_int;
- pub unsafe fn perror(s: *c_char);
+ pub fn fwrite(ptr: *c_void,
+ size: size_t,
+ nobj: size_t,
+ stream: *FILE)
+ -> size_t;
+ pub fn fseek(stream: *FILE, offset: c_long, whence: c_int)
+ -> c_int;
+ pub fn ftell(stream: *FILE) -> c_long;
+ pub fn rewind(stream: *FILE);
+ pub fn fgetpos(stream: *FILE, ptr: *fpos_t) -> c_int;
+ pub fn fsetpos(stream: *FILE, ptr: *fpos_t) -> c_int;
+ pub fn feof(stream: *FILE) -> c_int;
+ pub fn ferror(stream: *FILE) -> c_int;
+ pub fn perror(s: *c_char);
}
}
use libc::types::os::arch::c95::{size_t};
extern {
- pub unsafe fn abs(i: c_int) -> c_int;
- pub unsafe fn labs(i: c_long) -> c_long;
+ pub fn abs(i: c_int) -> c_int;
+ pub fn labs(i: c_long) -> c_long;
// Omitted: div, ldiv (return pub type incomplete).
- pub unsafe fn atof(s: *c_char) -> c_double;
- pub unsafe fn atoi(s: *c_char) -> c_int;
- pub unsafe fn strtod(s: *c_char, endp: **c_char) -> c_double;
- pub unsafe fn strtol(s: *c_char, endp: **c_char, base: c_int)
- -> c_long;
- pub unsafe fn strtoul(s: *c_char, endp: **c_char, base: c_int)
- -> c_ulong;
+ pub fn atof(s: *c_char) -> c_double;
+ pub fn atoi(s: *c_char) -> c_int;
+ pub fn strtod(s: *c_char, endp: **c_char) -> c_double;
+ pub fn strtol(s: *c_char, endp: **c_char, base: c_int)
+ -> c_long;
+ pub fn strtoul(s: *c_char, endp: **c_char, base: c_int)
+ -> c_ulong;
#[fast_ffi]
- pub unsafe fn calloc(nobj: size_t, size: size_t) -> *c_void;
+ pub fn calloc(nobj: size_t, size: size_t) -> *c_void;
#[fast_ffi]
- pub unsafe fn malloc(size: size_t) -> *c_void;
+ pub fn malloc(size: size_t) -> *c_void;
#[fast_ffi]
- pub unsafe fn realloc(p: *mut c_void, size: size_t)
- -> *mut c_void;
+ pub fn realloc(p: *mut c_void, size: size_t) -> *mut c_void;
#[fast_ffi]
- pub unsafe fn free(p: *c_void);
- pub unsafe fn abort() -> !;
- pub unsafe fn exit(status: c_int) -> !;
+ pub fn free(p: *c_void);
+ pub fn abort() -> !;
+ pub fn exit(status: c_int) -> !;
// Omitted: atexit.
- pub unsafe fn system(s: *c_char) -> c_int;
- pub unsafe fn getenv(s: *c_char) -> *c_char;
+ pub fn system(s: *c_char) -> c_int;
+ pub fn getenv(s: *c_char) -> *c_char;
// Omitted: bsearch, qsort
- pub unsafe fn rand() -> c_int;
- pub unsafe fn srand(seed: c_uint);
+ pub fn rand() -> c_int;
+ pub fn srand(seed: c_uint);
}
}
use libc::types::os::arch::c95::{wchar_t};
extern {
- pub unsafe fn strcpy(dst: *c_char, src: *c_char) -> *c_char;
- pub unsafe fn strncpy(dst: *c_char, src: *c_char, n: size_t)
- -> *c_char;
- pub unsafe fn strcat(s: *c_char, ct: *c_char) -> *c_char;
- pub unsafe fn strncat(s: *c_char, ct: *c_char, n: size_t)
- -> *c_char;
- pub unsafe fn strcmp(cs: *c_char, ct: *c_char) -> c_int;
- pub unsafe fn strncmp(cs: *c_char, ct: *c_char, n: size_t)
- -> c_int;
- pub unsafe fn strcoll(cs: *c_char, ct: *c_char) -> c_int;
- pub unsafe fn strchr(cs: *c_char, c: c_int) -> *c_char;
- pub unsafe fn strrchr(cs: *c_char, c: c_int) -> *c_char;
- pub unsafe fn strspn(cs: *c_char, ct: *c_char) -> size_t;
- pub unsafe fn strcspn(cs: *c_char, ct: *c_char) -> size_t;
- pub unsafe fn strpbrk(cs: *c_char, ct: *c_char) -> *c_char;
- pub unsafe fn strstr(cs: *c_char, ct: *c_char) -> *c_char;
- pub unsafe fn strlen(cs: *c_char) -> size_t;
- pub unsafe fn strerror(n: c_int) -> *c_char;
- pub unsafe fn strtok(s: *c_char, t: *c_char) -> *c_char;
- pub unsafe fn strxfrm(s: *c_char, ct: *c_char, n: size_t)
- -> size_t;
- pub unsafe fn wcslen(buf: *wchar_t) -> size_t;
+ pub fn strcpy(dst: *c_char, src: *c_char) -> *c_char;
+ pub fn strncpy(dst: *c_char, src: *c_char, n: size_t)
+ -> *c_char;
+ pub fn strcat(s: *c_char, ct: *c_char) -> *c_char;
+ pub fn strncat(s: *c_char, ct: *c_char, n: size_t) -> *c_char;
+ pub fn strcmp(cs: *c_char, ct: *c_char) -> c_int;
+ pub fn strncmp(cs: *c_char, ct: *c_char, n: size_t) -> c_int;
+ pub fn strcoll(cs: *c_char, ct: *c_char) -> c_int;
+ pub fn strchr(cs: *c_char, c: c_int) -> *c_char;
+ pub fn strrchr(cs: *c_char, c: c_int) -> *c_char;
+ pub fn strspn(cs: *c_char, ct: *c_char) -> size_t;
+ pub fn strcspn(cs: *c_char, ct: *c_char) -> size_t;
+ pub fn strpbrk(cs: *c_char, ct: *c_char) -> *c_char;
+ pub fn strstr(cs: *c_char, ct: *c_char) -> *c_char;
+ pub fn strlen(cs: *c_char) -> size_t;
+ pub fn strerror(n: c_int) -> *c_char;
+ pub fn strtok(s: *c_char, t: *c_char) -> *c_char;
+ pub fn strxfrm(s: *c_char, ct: *c_char, n: size_t) -> size_t;
+ pub fn wcslen(buf: *wchar_t) -> size_t;
// Omitted: memcpy, memmove, memset (provided by LLVM)
// in fact, because LLVM generates calls to them!
#[rust_stack]
#[inline]
- pub unsafe fn memcmp(cx: *c_void, ct: *c_void, n: size_t)
- -> c_int;
+ pub fn memcmp(cx: *c_void, ct: *c_void, n: size_t) -> c_int;
#[rust_stack]
#[inline]
- pub unsafe fn memchr(cx: *c_void, c: c_int, n: size_t)
- -> *c_void;
+ pub fn memchr(cx: *c_void, c: c_int, n: size_t) -> *c_void;
}
}
}
extern {
#[link_name = "_chmod"]
- pub unsafe fn chmod(path: *c_char, mode: c_int) -> c_int;
-
+ pub fn chmod(path: *c_char, mode: c_int) -> c_int;
#[link_name = "_mkdir"]
- pub unsafe fn mkdir(path: *c_char) -> c_int;
-
+ pub fn mkdir(path: *c_char) -> c_int;
#[link_name = "_fstat64"]
- pub unsafe fn fstat(fildes: c_int, buf: *mut stat) -> c_int;
-
+ pub fn fstat(fildes: c_int, buf: *mut stat) -> c_int;
#[link_name = "_stat64"]
- pub unsafe fn stat(path: *c_char, buf: *mut stat) -> c_int;
+ pub fn stat(path: *c_char, buf: *mut stat) -> c_int;
}
}
extern {
#[link_name = "_popen"]
- pub unsafe fn popen(command: *c_char, mode: *c_char) -> *FILE;
-
+ pub fn popen(command: *c_char, mode: *c_char) -> *FILE;
#[link_name = "_pclose"]
- pub unsafe fn pclose(stream: *FILE) -> c_int;
-
+ pub fn pclose(stream: *FILE) -> c_int;
#[link_name = "_fdopen"]
#[fast_ffi]
- pub unsafe fn fdopen(fd: c_int, mode: *c_char) -> *FILE;
-
+ pub fn fdopen(fd: c_int, mode: *c_char) -> *FILE;
#[link_name = "_fileno"]
- pub unsafe fn fileno(stream: *FILE) -> c_int;
+ pub fn fileno(stream: *FILE) -> c_int;
}
}
use libc::types::os::arch::c95::{c_int, c_char};
extern {
#[link_name = "_open"]
- pub unsafe fn open(path: *c_char, oflag: c_int, mode: c_int)
- -> c_int;
-
+ pub fn open(path: *c_char, oflag: c_int, mode: c_int)
+ -> c_int;
#[link_name = "_creat"]
- pub unsafe fn creat(path: *c_char, mode: c_int) -> c_int;
+ pub fn creat(path: *c_char, mode: c_int) -> c_int;
}
}
extern {
#[link_name = "_access"]
- pub unsafe fn access(path: *c_char, amode: c_int) -> c_int;
-
+ pub fn access(path: *c_char, amode: c_int) -> c_int;
#[link_name = "_chdir"]
- pub unsafe fn chdir(dir: *c_char) -> c_int;
-
+ pub fn chdir(dir: *c_char) -> c_int;
#[link_name = "_close"]
- pub unsafe fn close(fd: c_int) -> c_int;
-
+ pub fn close(fd: c_int) -> c_int;
#[link_name = "_dup"]
- pub unsafe fn dup(fd: c_int) -> c_int;
-
+ pub fn dup(fd: c_int) -> c_int;
#[link_name = "_dup2"]
- pub unsafe fn dup2(src: c_int, dst: c_int) -> c_int;
-
+ pub fn dup2(src: c_int, dst: c_int) -> c_int;
#[link_name = "_execv"]
- pub unsafe fn execv(prog: *c_char, argv: **c_char)
- -> intptr_t;
-
+ pub fn execv(prog: *c_char, argv: **c_char) -> intptr_t;
#[link_name = "_execve"]
- pub unsafe fn execve(prog: *c_char,
- argv: **c_char,
- envp: **c_char)
- -> c_int;
-
+ pub fn execve(prog: *c_char, argv: **c_char, envp: **c_char)
+ -> c_int;
#[link_name = "_execvp"]
- pub unsafe fn execvp(c: *c_char, argv: **c_char) -> c_int;
-
+ pub fn execvp(c: *c_char, argv: **c_char) -> c_int;
#[link_name = "_execvpe"]
- pub unsafe fn execvpe(c: *c_char,
- argv: **c_char,
- envp: **c_char)
- -> c_int;
-
+ pub fn execvpe(c: *c_char, argv: **c_char, envp: **c_char)
+ -> c_int;
#[link_name = "_getcwd"]
- pub unsafe fn getcwd(buf: *c_char, size: size_t) -> *c_char;
-
+ pub fn getcwd(buf: *c_char, size: size_t) -> *c_char;
#[link_name = "_getpid"]
- pub unsafe fn getpid() -> c_int;
-
+ pub fn getpid() -> c_int;
#[link_name = "_isatty"]
- pub unsafe fn isatty(fd: c_int) -> c_int;
-
+ pub fn isatty(fd: c_int) -> c_int;
#[link_name = "_lseek"]
- pub unsafe fn lseek(fd: c_int, offset: c_long, origin: c_int)
- -> c_long;
-
+ pub fn lseek(fd: c_int, offset: c_long, origin: c_int)
+ -> c_long;
#[link_name = "_pipe"]
- pub unsafe fn pipe(fds: *mut c_int,
- psize: c_uint,
- textmode: c_int)
- -> c_int;
-
+ pub fn pipe(fds: *mut c_int, psize: c_uint, textmode: c_int)
+ -> c_int;
#[link_name = "_read"]
#[fast_ffi]
- pub unsafe fn read(fd: c_int, buf: *mut c_void, count: c_uint)
- -> c_int;
-
+ pub fn read(fd: c_int, buf: *mut c_void, count: c_uint)
+ -> c_int;
#[link_name = "_rmdir"]
- pub unsafe fn rmdir(path: *c_char) -> c_int;
-
+ pub fn rmdir(path: *c_char) -> c_int;
#[link_name = "_unlink"]
- pub unsafe fn unlink(c: *c_char) -> c_int;
-
+ pub fn unlink(c: *c_char) -> c_int;
#[link_name = "_write"]
#[fast_ffi]
- pub unsafe fn write(fd: c_int, buf: *c_void, count: c_uint)
- -> c_int;
+ pub fn write(fd: c_int, buf: *c_void, count: c_uint) -> c_int;
}
}
#[nolink]
#[abi = "cdecl"]
extern {
- pub unsafe fn chmod(path: *c_char, mode: mode_t) -> c_int;
- pub unsafe fn fchmod(fd: c_int, mode: mode_t) -> c_int;
+ pub fn chmod(path: *c_char, mode: mode_t) -> c_int;
+ pub fn fchmod(fd: c_int, mode: mode_t) -> c_int;
#[cfg(target_os = "linux")]
#[cfg(target_os = "freebsd")]
#[cfg(target_os = "android")]
- pub unsafe fn fstat(fildes: c_int, buf: *mut stat) -> c_int;
+ pub fn fstat(fildes: c_int, buf: *mut stat) -> c_int;
#[cfg(target_os = "macos")]
#[link_name = "fstat64"]
- pub unsafe fn fstat(fildes: c_int, buf: *mut stat) -> c_int;
+ pub fn fstat(fildes: c_int, buf: *mut stat) -> c_int;
- pub unsafe fn mkdir(path: *c_char, mode: mode_t) -> c_int;
- pub unsafe fn mkfifo(path: *c_char, mode: mode_t) -> c_int;
+ pub fn mkdir(path: *c_char, mode: mode_t) -> c_int;
+ pub fn mkfifo(path: *c_char, mode: mode_t) -> c_int;
#[cfg(target_os = "linux")]
#[cfg(target_os = "freebsd")]
#[cfg(target_os = "android")]
- pub unsafe fn stat(path: *c_char, buf: *mut stat) -> c_int;
+ pub fn stat(path: *c_char, buf: *mut stat) -> c_int;
#[cfg(target_os = "macos")]
#[link_name = "stat64"]
- pub unsafe fn stat(path: *c_char, buf: *mut stat) -> c_int;
+ pub fn stat(path: *c_char, buf: *mut stat) -> c_int;
}
}
use libc::types::os::arch::c95::{c_char, c_int};
extern {
- pub unsafe fn popen(command: *c_char, mode: *c_char) -> *FILE;
- pub unsafe fn pclose(stream: *FILE) -> c_int;
- pub unsafe fn fdopen(fd: c_int, mode: *c_char) -> *FILE;
- pub unsafe fn fileno(stream: *FILE) -> c_int;
+ pub fn popen(command: *c_char, mode: *c_char) -> *FILE;
+ pub fn pclose(stream: *FILE) -> c_int;
+ pub fn fdopen(fd: c_int, mode: *c_char) -> *FILE;
+ pub fn fileno(stream: *FILE) -> c_int;
}
}
use libc::types::os::arch::posix88::mode_t;
extern {
- pub unsafe fn open(path: *c_char, oflag: c_int, mode: c_int)
- -> c_int;
- pub unsafe fn creat(path: *c_char, mode: mode_t) -> c_int;
- pub unsafe fn fcntl(fd: c_int, cmd: c_int) -> c_int;
+ pub fn open(path: *c_char, oflag: c_int, mode: c_int)
+ -> c_int;
+ pub fn creat(path: *c_char, mode: mode_t) -> c_int;
+ pub fn fcntl(fd: c_int, cmd: c_int) -> c_int;
}
}
}
extern {
- unsafe fn rust_opendir(dirname: *c_char) -> *DIR;
- unsafe fn rust_readdir(dirp: *DIR) -> *dirent_t;
+ fn rust_opendir(dirname: *c_char) -> *DIR;
+ fn rust_readdir(dirp: *DIR) -> *dirent_t;
}
extern {
- pub unsafe fn closedir(dirp: *DIR) -> c_int;
- pub unsafe fn rewinddir(dirp: *DIR);
- pub unsafe fn seekdir(dirp: *DIR, loc: c_long);
- pub unsafe fn telldir(dirp: *DIR) -> c_long;
+ pub fn closedir(dirp: *DIR) -> c_int;
+ pub fn rewinddir(dirp: *DIR);
+ pub fn seekdir(dirp: *DIR, loc: c_long);
+ pub fn telldir(dirp: *DIR) -> c_long;
}
}
use libc::types::os::arch::posix88::{ssize_t, uid_t};
extern {
- pub unsafe fn access(path: *c_char, amode: c_int) -> c_int;
- pub unsafe fn alarm(seconds: c_uint) -> c_uint;
- pub unsafe fn chdir(dir: *c_char) -> c_int;
- pub unsafe fn chown(path: *c_char, uid: uid_t, gid: gid_t)
- -> c_int;
- pub unsafe fn close(fd: c_int) -> c_int;
- pub unsafe fn dup(fd: c_int) -> c_int;
- pub unsafe fn dup2(src: c_int, dst: c_int) -> c_int;
- pub unsafe fn execv(prog: *c_char, argv: **c_char) -> c_int;
- pub unsafe fn execve(prog: *c_char,
- argv: **c_char,
- envp: **c_char)
- -> c_int;
- pub unsafe fn execvp(c: *c_char, argv: **c_char) -> c_int;
- pub unsafe fn fork() -> pid_t;
- pub unsafe fn fpathconf(filedes: c_int, name: c_int)
- -> c_long;
- pub unsafe fn getcwd(buf: *c_char, size: size_t) -> *c_char;
- pub unsafe fn getegid() -> gid_t;
- pub unsafe fn geteuid() -> uid_t;
- pub unsafe fn getgid() -> gid_t ;
- pub unsafe fn getgroups(ngroups_max: c_int,
- groups: *mut gid_t)
- -> c_int;
- pub unsafe fn getlogin() -> *c_char;
- pub unsafe fn getopt(argc: c_int,
- argv: **c_char,
- optstr: *c_char)
- -> c_int;
- pub unsafe fn getpgrp() -> pid_t;
- pub unsafe fn getpid() -> pid_t;
- pub unsafe fn getppid() -> pid_t;
- pub unsafe fn getuid() -> uid_t;
- pub unsafe fn isatty(fd: c_int) -> c_int;
- pub unsafe fn link(src: *c_char, dst: *c_char) -> c_int;
- pub unsafe fn lseek(fd: c_int, offset: off_t, whence: c_int)
- -> off_t;
- pub unsafe fn pathconf(path: *c_char, name: c_int) -> c_long;
- pub unsafe fn pause() -> c_int;
- pub unsafe fn pipe(fds: *mut c_int) -> c_int;
+ pub fn access(path: *c_char, amode: c_int) -> c_int;
+ pub fn alarm(seconds: c_uint) -> c_uint;
+ pub fn chdir(dir: *c_char) -> c_int;
+ pub fn chown(path: *c_char, uid: uid_t, gid: gid_t) -> c_int;
+ pub fn close(fd: c_int) -> c_int;
+ pub fn dup(fd: c_int) -> c_int;
+ pub fn dup2(src: c_int, dst: c_int) -> c_int;
+ pub fn execv(prog: *c_char, argv: **c_char) -> c_int;
+ pub fn execve(prog: *c_char, argv: **c_char, envp: **c_char)
+ -> c_int;
+ pub fn execvp(c: *c_char, argv: **c_char) -> c_int;
+ pub fn fork() -> pid_t;
+ pub fn fpathconf(filedes: c_int, name: c_int) -> c_long;
+ pub fn getcwd(buf: *c_char, size: size_t) -> *c_char;
+ pub fn getegid() -> gid_t;
+ pub fn geteuid() -> uid_t;
+ pub fn getgid() -> gid_t ;
+ pub fn getgroups(ngroups_max: c_int, groups: *mut gid_t)
+ -> c_int;
+ pub fn getlogin() -> *c_char;
+ pub fn getopt(argc: c_int, argv: **c_char, optstr: *c_char)
+ -> c_int;
+ pub fn getpgrp() -> pid_t;
+ pub fn getpid() -> pid_t;
+ pub fn getppid() -> pid_t;
+ pub fn getuid() -> uid_t;
+ pub fn isatty(fd: c_int) -> c_int;
+ pub fn link(src: *c_char, dst: *c_char) -> c_int;
+ pub fn lseek(fd: c_int, offset: off_t, whence: c_int)
+ -> off_t;
+ pub fn pathconf(path: *c_char, name: c_int) -> c_long;
+ pub fn pause() -> c_int;
+ pub fn pipe(fds: *mut c_int) -> c_int;
#[fast_ffi]
- pub unsafe fn read(fd: c_int, buf: *mut c_void, count: size_t)
- -> ssize_t;
- pub unsafe fn rmdir(path: *c_char) -> c_int;
- pub unsafe fn setgid(gid: gid_t) -> c_int;
- pub unsafe fn setpgid(pid: pid_t, pgid: pid_t) -> c_int;
- pub unsafe fn setsid() -> pid_t;
- pub unsafe fn setuid(uid: uid_t) -> c_int;
- pub unsafe fn sleep(secs: c_uint) -> c_uint;
- pub unsafe fn sysconf(name: c_int) -> c_long;
- pub unsafe fn tcgetpgrp(fd: c_int) -> pid_t;
- pub unsafe fn ttyname(fd: c_int) -> *c_char;
- pub unsafe fn unlink(c: *c_char) -> c_int;
+ pub fn read(fd: c_int, buf: *mut c_void, count: size_t)
+ -> ssize_t;
+ pub fn rmdir(path: *c_char) -> c_int;
+ pub fn setgid(gid: gid_t) -> c_int;
+ pub fn setpgid(pid: pid_t, pgid: pid_t) -> c_int;
+ pub fn setsid() -> pid_t;
+ pub fn setuid(uid: uid_t) -> c_int;
+ pub fn sleep(secs: c_uint) -> c_uint;
+ pub fn sysconf(name: c_int) -> c_long;
+ pub fn tcgetpgrp(fd: c_int) -> pid_t;
+ pub fn ttyname(fd: c_int) -> *c_char;
+ pub fn unlink(c: *c_char) -> c_int;
#[fast_ffi]
- pub unsafe fn write(fd: c_int, buf: *c_void, count: size_t)
- -> ssize_t;
+ pub fn write(fd: c_int, buf: *c_void, count: size_t)
+ -> ssize_t;
}
}
use libc::types::os::arch::posix88::{pid_t};
extern {
- pub unsafe fn kill(pid: pid_t, sig: c_int) -> c_int;
+ pub fn kill(pid: pid_t, sig: c_int) -> c_int;
}
}
use libc::types::os::arch::posix88::{mode_t, off_t};
extern {
- pub unsafe fn mlock(addr: *c_void, len: size_t) -> c_int;
- pub unsafe fn munlock(addr: *c_void, len: size_t) -> c_int;
- pub unsafe fn mlockall(flags: c_int) -> c_int;
- pub unsafe fn munlockall() -> c_int;
-
- pub unsafe fn mmap(addr: *c_void,
- len: size_t,
- prot: c_int,
- flags: c_int,
- fd: c_int,
- offset: off_t)
- -> *mut c_void;
- pub unsafe fn munmap(addr: *c_void, len: size_t) -> c_int;
-
- pub unsafe fn mprotect(addr: *c_void,
- len: size_t,
- prot: c_int)
- -> c_int;
-
- pub unsafe fn msync(addr: *c_void, len: size_t, flags: c_int)
- -> c_int;
- pub unsafe fn shm_open(name: *c_char,
- oflag: c_int,
- mode: mode_t)
- -> c_int;
- pub unsafe fn shm_unlink(name: *c_char) -> c_int;
+ pub fn mlock(addr: *c_void, len: size_t) -> c_int;
+ pub fn munlock(addr: *c_void, len: size_t) -> c_int;
+ pub fn mlockall(flags: c_int) -> c_int;
+ pub fn munlockall() -> c_int;
+
+ pub fn mmap(addr: *c_void,
+ len: size_t,
+ prot: c_int,
+ flags: c_int,
+ fd: c_int,
+ offset: off_t)
+ -> *mut c_void;
+ pub fn munmap(addr: *c_void, len: size_t) -> c_int;
+
+ pub fn mprotect(addr: *c_void, len: size_t, prot: c_int)
+ -> c_int;
+
+ pub fn msync(addr: *c_void, len: size_t, flags: c_int)
+ -> c_int;
+ pub fn shm_open(name: *c_char, oflag: c_int, mode: mode_t)
+ -> c_int;
+ pub fn shm_unlink(name: *c_char) -> c_int;
}
}
}
#[cfg(target_os = "linux")]
#[cfg(target_os = "freebsd")]
#[cfg(target_os = "android")]
- pub unsafe fn lstat(path: *c_char, buf: *mut stat) -> c_int;
+ pub fn lstat(path: *c_char, buf: *mut stat) -> c_int;
#[cfg(target_os = "macos")]
#[link_name = "lstat64"]
- pub unsafe fn lstat(path: *c_char, buf: *mut stat) -> c_int;
+ pub fn lstat(path: *c_char, buf: *mut stat) -> c_int;
}
}
use libc::types::os::arch::posix88::{ssize_t};
extern {
- pub unsafe fn readlink(path: *c_char,
- buf: *mut c_char,
- bufsz: size_t)
- -> ssize_t;
+ pub fn readlink(path: *c_char,
+ buf: *mut c_char,
+ bufsz: size_t)
+ -> ssize_t;
- pub unsafe fn fsync(fd: c_int) -> c_int;
+ pub fn fsync(fd: c_int) -> c_int;
#[cfg(target_os = "linux")]
#[cfg(target_os = "android")]
- pub unsafe fn fdatasync(fd: c_int) -> c_int;
+ pub fn fdatasync(fd: c_int) -> c_int;
- pub unsafe fn setenv(name: *c_char,
- val: *c_char,
- overwrite: c_int)
- -> c_int;
- pub unsafe fn unsetenv(name: *c_char) -> c_int;
- pub unsafe fn putenv(string: *c_char) -> c_int;
+ pub fn setenv(name: *c_char, val: *c_char, overwrite: c_int)
+ -> c_int;
+ pub fn unsetenv(name: *c_char) -> c_int;
+ pub fn putenv(string: *c_char) -> c_int;
- pub unsafe fn symlink(path1: *c_char, path2: *c_char)
- -> c_int;
+ pub fn symlink(path1: *c_char, path2: *c_char) -> c_int;
}
}
use libc::types::os::arch::posix88::{pid_t};
extern {
- pub unsafe fn waitpid(pid: pid_t,
- status: *mut c_int,
- options: c_int)
- -> pid_t;
+ pub fn waitpid(pid: pid_t, status: *mut c_int, options: c_int)
+ -> pid_t;
}
}
use libc::types::os::common::posix01::{glob_t};
extern {
- pub unsafe fn glob(pattern: *c_char,
- flags: c_int,
- errfunc: *c_void, // XXX callback
- pglob: *mut glob_t);
- pub unsafe fn globfree(pglob: *mut glob_t);
+ pub fn glob(pattern: *c_char,
+ flags: c_int,
+ errfunc: *c_void, // XXX callback
+ pglob: *mut glob_t);
+ pub fn globfree(pglob: *mut glob_t);
}
}
use libc::types::os::arch::c95::{c_int, size_t};
extern {
- pub unsafe fn posix_madvise(addr: *c_void,
- len: size_t,
- advice: c_int)
- -> c_int;
+ pub fn posix_madvise(addr: *c_void,
+ len: size_t,
+ advice: c_int)
+ -> c_int;
}
}
}
#[abi = "cdecl"]
extern {
- pub unsafe fn sysctl(name: *c_int,
- namelen: c_uint,
- oldp: *mut c_void,
- oldlenp: *mut size_t,
- newp: *c_void,
- newlen: size_t)
- -> c_int;
-
- pub unsafe fn sysctlbyname(name: *c_char,
- oldp: *mut c_void,
- oldlenp: *mut size_t,
- newp: *c_void,
- newlen: size_t)
- -> c_int;
-
- pub unsafe fn sysctlnametomib(name: *c_char,
- mibp: *mut c_int,
- sizep: *mut size_t)
- -> c_int;
-
- pub unsafe fn getdtablesize() -> c_int;
-
- pub unsafe fn madvise(addr: *c_void, len: size_t, advice: c_int)
- -> c_int;
-
- pub unsafe fn mincore(addr: *c_void, len: size_t, vec: *c_uchar)
- -> c_int;
+ pub fn sysctl(name: *c_int,
+ namelen: c_uint,
+ oldp: *mut c_void,
+ oldlenp: *mut size_t,
+ newp: *c_void,
+ newlen: size_t)
+ -> c_int;
+ pub fn sysctlbyname(name: *c_char,
+ oldp: *mut c_void,
+ oldlenp: *mut size_t,
+ newp: *c_void,
+ newlen: size_t)
+ -> c_int;
+ pub fn sysctlnametomib(name: *c_char,
+ mibp: *mut c_int,
+ sizep: *mut size_t)
+ -> c_int;
+ pub fn getdtablesize() -> c_int;
+ pub fn madvise(addr: *c_void, len: size_t, advice: c_int)
+ -> c_int;
+ pub fn mincore(addr: *c_void, len: size_t, vec: *c_uchar)
+ -> c_int;
}
}
#[abi = "cdecl"]
extern {
- pub unsafe fn getdtablesize() -> c_int;
-
- pub unsafe fn madvise(addr: *c_void, len: size_t, advice: c_int)
- -> c_int;
-
- pub unsafe fn mincore(addr: *c_void, len: size_t, vec: *c_uchar)
- -> c_int;
+ pub fn getdtablesize() -> c_int;
+ pub fn madvise(addr: *c_void, len: size_t, advice: c_int)
+ -> c_int;
+ pub fn mincore(addr: *c_void, len: size_t, vec: *c_uchar)
+ -> c_int;
}
}
#[abi = "cdecl"]
extern {
- pub unsafe fn _NSGetExecutablePath(buf: *mut c_char,
- bufsize: *mut u32)
- -> c_int;
+ pub fn _NSGetExecutablePath(buf: *mut c_char, bufsize: *mut u32)
+ -> c_int;
}
}
#[abi = "stdcall"]
extern "stdcall" {
- pub unsafe fn GetEnvironmentVariableW(n: LPCWSTR,
- v: LPWSTR,
- nsize: DWORD)
- -> DWORD;
- pub unsafe fn SetEnvironmentVariableW(n: LPCWSTR, v: LPCWSTR)
- -> BOOL;
- pub unsafe fn GetEnvironmentStringsA() -> LPTCH;
- pub unsafe fn FreeEnvironmentStringsA(env_ptr: LPTCH) -> BOOL;
-
- pub unsafe fn GetModuleFileNameW(hModule: HMODULE,
- lpFilename: LPWSTR,
- nSize: DWORD)
- -> DWORD;
- pub unsafe fn CreateDirectoryW(lpPathName: LPCWSTR,
- lpSecurityAttributes:
- LPSECURITY_ATTRIBUTES)
- -> BOOL;
- pub unsafe fn CopyFileW(lpExistingFileName: LPCWSTR,
+ pub fn GetEnvironmentVariableW(n: LPCWSTR,
+ v: LPWSTR,
+ nsize: DWORD)
+ -> DWORD;
+ pub fn SetEnvironmentVariableW(n: LPCWSTR, v: LPCWSTR)
+ -> BOOL;
+ pub fn GetEnvironmentStringsA() -> LPTCH;
+ pub fn FreeEnvironmentStringsA(env_ptr: LPTCH) -> BOOL;
+ pub fn GetModuleFileNameW(hModule: HMODULE,
+ lpFilename: LPWSTR,
+ nSize: DWORD)
+ -> DWORD;
+ pub fn CreateDirectoryW(lpPathName: LPCWSTR,
+ lpSecurityAttributes:
+ LPSECURITY_ATTRIBUTES)
+ -> BOOL;
+ pub fn CopyFileW(lpExistingFileName: LPCWSTR,
lpNewFileName: LPCWSTR,
bFailIfExists: BOOL)
-> BOOL;
- pub unsafe fn DeleteFileW(lpPathName: LPCWSTR) -> BOOL;
- pub unsafe fn RemoveDirectoryW(lpPathName: LPCWSTR) -> BOOL;
- pub unsafe fn SetCurrentDirectoryW(lpPathName: LPCWSTR)
- -> BOOL;
-
- pub unsafe fn GetLastError() -> DWORD;
- pub unsafe fn FindFirstFileW(fileName: *u16,
- findFileData: HANDLE)
- -> HANDLE;
- pub unsafe fn FindNextFileW(findFile: HANDLE,
- findFileData: HANDLE)
- -> BOOL;
- pub unsafe fn FindClose(findFile: HANDLE) -> BOOL;
- pub unsafe fn DuplicateHandle(hSourceProcessHandle: HANDLE,
- hSourceHandle: HANDLE,
- hTargetProcessHandle: HANDLE,
- lpTargetHandle: LPHANDLE,
- dwDesiredAccess: DWORD,
- bInheritHandle: BOOL,
- dwOptions: DWORD)
- -> BOOL;
- pub unsafe fn CloseHandle(hObject: HANDLE) -> BOOL;
- pub unsafe fn OpenProcess(dwDesiredAccess: DWORD,
- bInheritHandle: BOOL,
- dwProcessId: DWORD)
- -> HANDLE;
- pub unsafe fn GetCurrentProcess() -> HANDLE;
- pub unsafe fn CreateProcessA(lpApplicationName: LPCTSTR,
- lpCommandLine: LPTSTR,
- lpProcessAttributes:
- LPSECURITY_ATTRIBUTES,
- lpThreadAttributes:
- LPSECURITY_ATTRIBUTES,
- bInheritHandles: BOOL,
- dwCreationFlags: DWORD,
- lpEnvironment: LPVOID,
- lpCurrentDirectory: LPCTSTR,
- lpStartupInfo: LPSTARTUPINFO,
- lpProcessInformation:
- LPPROCESS_INFORMATION)
- -> BOOL;
- pub unsafe fn WaitForSingleObject(hHandle: HANDLE,
- dwMilliseconds: DWORD)
- -> DWORD;
- pub unsafe fn TerminateProcess(hProcess: HANDLE,
- uExitCode: c_uint)
- -> BOOL;
- pub unsafe fn GetExitCodeProcess(hProcess: HANDLE,
- lpExitCode: LPDWORD)
- -> BOOL;
-
- pub unsafe fn GetSystemInfo(lpSystemInfo: LPSYSTEM_INFO);
- pub unsafe fn VirtualAlloc(lpAddress: LPVOID,
- dwSize: SIZE_T,
- flAllocationType: DWORD,
- flProtect: DWORD)
- -> LPVOID;
- pub unsafe fn VirtualFree(lpAddress: LPVOID,
- dwSize: SIZE_T,
- dwFreeType: DWORD)
- -> BOOL;
- pub unsafe fn VirtualLock(lpAddress: LPVOID, dwSize: SIZE_T)
+ pub fn DeleteFileW(lpPathName: LPCWSTR) -> BOOL;
+ pub fn RemoveDirectoryW(lpPathName: LPCWSTR) -> BOOL;
+ pub fn SetCurrentDirectoryW(lpPathName: LPCWSTR) -> BOOL;
+ pub fn GetLastError() -> DWORD;
+ pub fn FindFirstFileW(fileName: *u16, findFileData: HANDLE)
+ -> HANDLE;
+ pub fn FindNextFileW(findFile: HANDLE, findFileData: HANDLE)
+ -> BOOL;
+ pub fn FindClose(findFile: HANDLE) -> BOOL;
+ pub fn DuplicateHandle(hSourceProcessHandle: HANDLE,
+ hSourceHandle: HANDLE,
+ hTargetProcessHandle: HANDLE,
+ lpTargetHandle: LPHANDLE,
+ dwDesiredAccess: DWORD,
+ bInheritHandle: BOOL,
+ dwOptions: DWORD)
+ -> BOOL;
+ pub fn CloseHandle(hObject: HANDLE) -> BOOL;
+ pub fn OpenProcess(dwDesiredAccess: DWORD,
+ bInheritHandle: BOOL,
+ dwProcessId: DWORD)
+ -> HANDLE;
+ pub fn GetCurrentProcess() -> HANDLE;
+ pub fn CreateProcessA(lpApplicationName: LPCTSTR,
+ lpCommandLine: LPTSTR,
+ lpProcessAttributes:
+ LPSECURITY_ATTRIBUTES,
+ lpThreadAttributes:
+ LPSECURITY_ATTRIBUTES,
+ bInheritHandles: BOOL,
+ dwCreationFlags: DWORD,
+ lpEnvironment: LPVOID,
+ lpCurrentDirectory: LPCTSTR,
+ lpStartupInfo: LPSTARTUPINFO,
+ lpProcessInformation:
+ LPPROCESS_INFORMATION)
+ -> BOOL;
+ pub fn WaitForSingleObject(hHandle: HANDLE,
+ dwMilliseconds: DWORD)
+ -> DWORD;
+ pub fn TerminateProcess(hProcess: HANDLE, uExitCode: c_uint)
+ -> BOOL;
+ pub fn GetExitCodeProcess(hProcess: HANDLE,
+ lpExitCode: LPDWORD)
-> BOOL;
- pub unsafe fn VirtualUnlock(lpAddress: LPVOID, dwSize: SIZE_T)
- -> BOOL;
- pub unsafe fn VirtualProtect(lpAddress: LPVOID,
- dwSize: SIZE_T,
- flNewProtect: DWORD,
- lpflOldProtect: LPDWORD)
- -> BOOL;
- pub unsafe fn VirtualQuery(lpAddress: LPCVOID,
- lpBuffer:
- LPMEMORY_BASIC_INFORMATION,
- dwLength: SIZE_T)
- -> SIZE_T;
-
- pub unsafe fn CreateFileMappingW(hFile: HANDLE,
- lpAttributes:
- LPSECURITY_ATTRIBUTES,
- flProtect: DWORD,
- dwMaximumSizeHigh: DWORD,
- dwMaximumSizeLow: DWORD,
- lpName: LPCTSTR)
- -> HANDLE;
- pub unsafe fn MapViewOfFile(hFileMappingObject: HANDLE,
- dwDesiredAccess: DWORD,
- dwFileOffsetHigh: DWORD,
- dwFileOffsetLow: DWORD,
- dwNumberOfBytesToMap: SIZE_T)
- -> LPVOID;
- pub unsafe fn UnmapViewOfFile(lpBaseAddress: LPCVOID) -> BOOL;
+ pub fn GetSystemInfo(lpSystemInfo: LPSYSTEM_INFO);
+ pub fn VirtualAlloc(lpAddress: LPVOID,
+ dwSize: SIZE_T,
+ flAllocationType: DWORD,
+ flProtect: DWORD)
+ -> LPVOID;
+ pub fn VirtualFree(lpAddress: LPVOID,
+ dwSize: SIZE_T,
+ dwFreeType: DWORD)
+ -> BOOL;
+ pub fn VirtualLock(lpAddress: LPVOID, dwSize: SIZE_T) -> BOOL;
+ pub fn VirtualUnlock(lpAddress: LPVOID, dwSize: SIZE_T)
+ -> BOOL;
+ pub fn VirtualProtect(lpAddress: LPVOID,
+ dwSize: SIZE_T,
+ flNewProtect: DWORD,
+ lpflOldProtect: LPDWORD)
+ -> BOOL;
+ pub fn VirtualQuery(lpAddress: LPCVOID,
+ lpBuffer: LPMEMORY_BASIC_INFORMATION,
+ dwLength: SIZE_T)
+ -> SIZE_T;
+ pub fn CreateFileMappingW(hFile: HANDLE,
+ lpAttributes: LPSECURITY_ATTRIBUTES,
+ flProtect: DWORD,
+ dwMaximumSizeHigh: DWORD,
+ dwMaximumSizeLow: DWORD,
+ lpName: LPCTSTR)
+ -> HANDLE;
+ pub fn MapViewOfFile(hFileMappingObject: HANDLE,
+ dwDesiredAccess: DWORD,
+ dwFileOffsetHigh: DWORD,
+ dwFileOffsetLow: DWORD,
+ dwNumberOfBytesToMap: SIZE_T)
+ -> LPVOID;
+ pub fn UnmapViewOfFile(lpBaseAddress: LPCVOID) -> BOOL;
}
}
#[nolink]
extern {
#[link_name = "_commit"]
- pub unsafe fn commit(fd: c_int) -> c_int;
+ pub fn commit(fd: c_int) -> c_int;
#[link_name = "_get_osfhandle"]
- pub unsafe fn get_osfhandle(fd: c_int) -> c_long;
+ pub fn get_osfhandle(fd: c_int) -> c_long;
}
}
}