Please use GitHub pull requests for new patches. Avoid migrating existing patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
llvm/bindings/ocaml/llvm/llvm_ocaml.h
/*===-- llvm_ocaml.h - LLVM OCaml Glue --------------------------*- C++ -*-===*\ | /*===-- llvm_ocaml.h - LLVM OCaml Glue --------------------------*- C++ -*-===*\ | ||||||||
jberdine: intended? | |||||||||
|* *| | |* *| | ||||||||
|* Part of the LLVM Project, under the Apache License v2.0 with LLVM *| | |* Part of the LLVM Project, under the Apache License v2.0 with LLVM *| | ||||||||
|* Exceptions. *| | |* Exceptions. *| | ||||||||
|* See https://llvm.org/LICENSE.txt for license information. *| | |* See https://llvm.org/LICENSE.txt for license information. *| | ||||||||
|* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception *| | |* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception *| | ||||||||
|* *| | |* *| | ||||||||
|*===----------------------------------------------------------------------===*| | |*===----------------------------------------------------------------------===*| | ||||||||
|* *| | |* *| | ||||||||
Show All 17 Lines | |||||||||
#define Val_none Val_int(0) | #define Val_none Val_int(0) | ||||||||
#define Some_val(v) Field(v, 0) | #define Some_val(v) Field(v, 0) | ||||||||
#define Tag_some 0 | #define Tag_some 0 | ||||||||
#define Is_none(v) ((v) == Val_none) | #define Is_none(v) ((v) == Val_none) | ||||||||
#define Is_some(v) Is_block(v) | #define Is_some(v) Is_block(v) | ||||||||
value caml_alloc_some(value); | value caml_alloc_some(value); | ||||||||
#endif | #endif | ||||||||
value to_val(void *ptr); | |||||||||
void *from_val(value v); | |||||||||
Not Done ReplyInline Actions
jberdine: | |||||||||
void *alloc_temp(value Elements); | |||||||||
#define DiagnosticInfo_val(v) ((LLVMDiagnosticInfoRef)from_val(v)) | |||||||||
#define Context_val(v) ((LLVMContextRef)from_val(v)) | |||||||||
#define Attribute_val(v) ((LLVMAttributeRef)from_val(v)) | |||||||||
#define Module_val(v) ((LLVMModuleRef)from_val(v)) | |||||||||
#define Metadata_val(v) ((LLVMMetadataRef)from_val(v)) | |||||||||
Not Done ReplyInline Actions
maybe jberdine: maybe | |||||||||
#define Type_val(v) ((LLVMTypeRef)from_val(v)) | |||||||||
#define Value_val(v) ((LLVMValueRef)from_val(v)) | |||||||||
#define Use_val(v) ((LLVMUseRef)from_val(v)) | |||||||||
#define BasicBlock_val(v) ((LLVMBasicBlockRef)from_val(v)) | |||||||||
#define MemoryBuffer_val(v) ((LLVMMemoryBufferRef)from_val(v)) | |||||||||
#define PassManager_val(v) ((LLVMPassManagerRef)from_val(v)) | |||||||||
/* Convert a C pointer to an OCaml option */ | /* Convert a C pointer to an OCaml option */ | ||||||||
value ptr_to_option(void *Ptr); | value ptr_to_option(void *Ptr); | ||||||||
/* Convert a C string into an OCaml string */ | /* Convert a C string into an OCaml string */ | ||||||||
value cstr_to_string(const char *Str, mlsize_t Len); | value cstr_to_string(const char *Str, mlsize_t Len); | ||||||||
#endif // LLVM_LLVM_OCAML_H | #endif // LLVM_LLVM_OCAML_H |
intended?