| ... | @@ -1,7 +1,7 @@ | ... | @@ -1,7 +1,7 @@ |
| 1 | //! We do this instead of @cImport because the self-hosted compiler is easier | 1 | //! We do this instead of @cImport because the self-hosted compiler is easier |
| 2 | //! to bootstrap if it does not depend on translate-c. | 2 | //! to bootstrap if it does not depend on translate-c. |
| 3 | | 3 | |
| 4 | const LLVMBool = bool; | 4 | const Bool = bool; |
| 5 | pub const AttributeIndex = c_uint; | 5 | pub const AttributeIndex = c_uint; |
| 6 | | 6 | |
| 7 | /// Make sure to use the *InContext functions instead of the global ones. | 7 | /// Make sure to use the *InContext functions instead of the global ones. |
| ... | @@ -22,13 +22,13 @@ pub const Context = opaque { | ... | @@ -22,13 +22,13 @@ pub const Context = opaque { |
| 22 | extern fn LLVMVoidTypeInContext(C: *const Context) *const Type; | 22 | extern fn LLVMVoidTypeInContext(C: *const Context) *const Type; |
| 23 | | 23 | |
| 24 | pub const structType = LLVMStructTypeInContext; | 24 | pub const structType = LLVMStructTypeInContext; |
| 25 | extern fn LLVMStructTypeInContext(C: *const Context, ElementTypes: [*]*const Type, ElementCount: c_uint, Packed: LLVMBool) *const Type; | 25 | extern fn LLVMStructTypeInContext(C: *const Context, ElementTypes: [*]*const Type, ElementCount: c_uint, Packed: Bool) *const Type; |
| 26 | | 26 | |
| 27 | pub const constString = LLVMConstStringInContext; | 27 | pub const constString = LLVMConstStringInContext; |
| 28 | extern fn LLVMConstStringInContext(C: *const Context, Str: [*]const u8, Length: c_uint, DontNullTerminate: LLVMBool) *const Value; | 28 | extern fn LLVMConstStringInContext(C: *const Context, Str: [*]const u8, Length: c_uint, DontNullTerminate: Bool) *const Value; |
| 29 | | 29 | |
| 30 | pub const constStruct = LLVMConstStructInContext; | 30 | pub const constStruct = LLVMConstStructInContext; |
| 31 | extern fn LLVMConstStructInContext(C: *const Context, ConstantVals: [*]*const Value, Count: c_uint, Packed: LLVMBool) *const Value; | 31 | extern fn LLVMConstStructInContext(C: *const Context, ConstantVals: [*]*const Value, Count: c_uint, Packed: Bool) *const Value; |
| 32 | | 32 | |
| 33 | pub const createBasicBlock = LLVMCreateBasicBlockInContext; | 33 | pub const createBasicBlock = LLVMCreateBasicBlockInContext; |
| 34 | extern fn LLVMCreateBasicBlockInContext(C: *const Context, Name: [*:0]const u8) *const BasicBlock; | 34 | extern fn LLVMCreateBasicBlockInContext(C: *const Context, Name: [*:0]const u8) *const BasicBlock; |
| ... | @@ -59,7 +59,7 @@ pub const Value = opaque { | ... | @@ -59,7 +59,7 @@ pub const Value = opaque { |
| 59 | | 59 | |
| 60 | pub const Type = opaque { | 60 | pub const Type = opaque { |
| 61 | pub const functionType = LLVMFunctionType; | 61 | pub const functionType = LLVMFunctionType; |
| 62 | extern fn LLVMFunctionType(ReturnType: *const Type, ParamTypes: ?[*]*const Type, ParamCount: c_uint, IsVarArg: LLVMBool) *const Type; | 62 | extern fn LLVMFunctionType(ReturnType: *const Type, ParamTypes: ?[*]*const Type, ParamCount: c_uint, IsVarArg: Bool) *const Type; |
| 63 | | 63 | |
| 64 | pub const constNull = LLVMConstNull; | 64 | pub const constNull = LLVMConstNull; |
| 65 | extern fn LLVMConstNull(Ty: *const Type) *const Value; | 65 | extern fn LLVMConstNull(Ty: *const Type) *const Value; |
| ... | @@ -68,7 +68,7 @@ pub const Type = opaque { | ... | @@ -68,7 +68,7 @@ pub const Type = opaque { |
| 68 | extern fn LLVMConstAllOnes(Ty: *const Type) *const Value; | 68 | extern fn LLVMConstAllOnes(Ty: *const Type) *const Value; |
| 69 | | 69 | |
| 70 | pub const constInt = LLVMConstInt; | 70 | pub const constInt = LLVMConstInt; |
| 71 | extern fn LLVMConstInt(IntTy: *const Type, N: c_ulonglong, SignExtend: LLVMBool) *const Value; | 71 | extern fn LLVMConstInt(IntTy: *const Type, N: c_ulonglong, SignExtend: Bool) *const Value; |
| 72 | | 72 | |
| 73 | pub const constArray = LLVMConstArray; | 73 | pub const constArray = LLVMConstArray; |
| 74 | extern fn LLVMConstArray(ElementTy: *const Type, ConstantVals: ?[*]*const Value, Length: c_uint) *const Value; | 74 | extern fn LLVMConstArray(ElementTy: *const Type, ConstantVals: ?[*]*const Value, Length: c_uint) *const Value; |
| ... | @@ -91,7 +91,7 @@ pub const Module = opaque { | ... | @@ -91,7 +91,7 @@ pub const Module = opaque { |
| 91 | extern fn LLVMDisposeModule(*const Module) void; | 91 | extern fn LLVMDisposeModule(*const Module) void; |
| 92 | | 92 | |
| 93 | pub const verify = LLVMVerifyModule; | 93 | pub const verify = LLVMVerifyModule; |
| 94 | extern fn LLVMVerifyModule(*const Module, Action: VerifierFailureAction, OutMessage: *[*:0]const u8) LLVMBool; | 94 | extern fn LLVMVerifyModule(*const Module, Action: VerifierFailureAction, OutMessage: *[*:0]const u8) Bool; |
| 95 | | 95 | |
| 96 | pub const addFunction = LLVMAddFunction; | 96 | pub const addFunction = LLVMAddFunction; |
| 97 | extern fn LLVMAddFunction(*const Module, Name: [*:0]const u8, FunctionTy: *const Type) *const Value; | 97 | extern fn LLVMAddFunction(*const Module, Name: [*:0]const u8, FunctionTy: *const Type) *const Value; |
| ... | @@ -191,7 +191,7 @@ pub const Builder = opaque { | ... | @@ -191,7 +191,7 @@ pub const Builder = opaque { |
| 191 | extern fn LLVMBuildNUWSub(*const Builder, LHS: *const Value, RHS: *const Value, Name: [*:0]const u8) *const Value; | 191 | extern fn LLVMBuildNUWSub(*const Builder, LHS: *const Value, RHS: *const Value, Name: [*:0]const u8) *const Value; |
| 192 | | 192 | |
| 193 | pub const buildIntCast2 = LLVMBuildIntCast2; | 193 | pub const buildIntCast2 = LLVMBuildIntCast2; |
| 194 | extern fn LLVMBuildIntCast2(*const Builder, Val: *const Value, DestTy: *const Type, IsSigned: LLVMBool, Name: [*:0]const u8) *const Value; | 194 | extern fn LLVMBuildIntCast2(*const Builder, Val: *const Value, DestTy: *const Type, IsSigned: Bool, Name: [*:0]const u8) *const Value; |
| 195 | | 195 | |
| 196 | pub const buildBitCast = LLVMBuildBitCast; | 196 | pub const buildBitCast = LLVMBuildBitCast; |
| 197 | extern fn LLVMBuildBitCast(*const Builder, Val: *const Value, DestTy: *const Type, Name: [*:0]const u8) *const Value; | 197 | extern fn LLVMBuildBitCast(*const Builder, Val: *const Value, DestTy: *const Type, Name: [*:0]const u8) *const Value; |
| ... | @@ -258,7 +258,7 @@ pub const TargetMachine = opaque { | ... | @@ -258,7 +258,7 @@ pub const TargetMachine = opaque { |
| 258 | Filename: [*:0]const u8, | 258 | Filename: [*:0]const u8, |
| 259 | codegen: CodeGenFileType, | 259 | codegen: CodeGenFileType, |
| 260 | ErrorMessage: *[*:0]const u8, | 260 | ErrorMessage: *[*:0]const u8, |
| 261 | ) LLVMBool; | 261 | ) Bool; |
| 262 | }; | 262 | }; |
| 263 | | 263 | |
| 264 | pub const CodeMode = extern enum { | 264 | pub const CodeMode = extern enum { |
| ... | @@ -295,7 +295,7 @@ pub const CodeGenFileType = extern enum { | ... | @@ -295,7 +295,7 @@ pub const CodeGenFileType = extern enum { |
| 295 | | 295 | |
| 296 | pub const Target = opaque { | 296 | pub const Target = opaque { |
| 297 | pub const getFromTriple = LLVMGetTargetFromTriple; | 297 | pub const getFromTriple = LLVMGetTargetFromTriple; |
| 298 | extern fn LLVMGetTargetFromTriple(Triple: [*:0]const u8, T: **const Target, ErrorMessage: *[*:0]const u8) LLVMBool; | 298 | extern fn LLVMGetTargetFromTriple(Triple: [*:0]const u8, T: **const Target, ErrorMessage: *[*:0]const u8) Bool; |
| 299 | }; | 299 | }; |
| 300 | | 300 | |
| 301 | extern fn LLVMInitializeAArch64TargetInfo() void; | 301 | extern fn LLVMInitializeAArch64TargetInfo() void; |