[LLVMdev] [PATCH] Cleanup the c and ocaml binding documentation.

Gordon Henriksen gordonhenriksen at mac.com
Tue Mar 4 06:18:26 PST 2008


Hi Erick,

Thanks, this looks good. Can you please resubmit this patch, and the  
others, as an attachment?

On Mar 4, 2008, at 03:19, Erick Tryzelaar wrote:

> ---
> bindings/ocaml/llvm/llvm.ml      |    2 +-
> bindings/ocaml/llvm/llvm.mli     |    2 +-
> bindings/ocaml/llvm/llvm_ocaml.c |    2 +-
> include/llvm-c/Core.h            |   32 ++++++++++++++++++ 
> +-------------
> 4 files changed, 22 insertions(+), 16 deletions(-)diff --git  
> bindings/ocaml/llvm/llvm.ml bindings/ocaml/llvm/llvm.ml
> index 6657af5..ea6ef71 100644
> --- bindings/ocaml/llvm/llvm.ml
> +++ bindings/ocaml/llvm/llvm.ml
> @@ -1,4 +1,4 @@
> -(*===-- tools/ml/llvm.ml - LLVM Ocaml Interface  
> ---------------------------===*
> +(*===-- llvm/llvm.ml - LLVM Ocaml Implementation  
> ---------------------------===*
>  *
>  *                     The LLVM Compiler Infrastructure
>  *
> diff --git bindings/ocaml/llvm/llvm.mli bindings/ocaml/llvm/llvm.mli
> index c6d50c9..3ed9d27 100644
> --- bindings/ocaml/llvm/llvm.mli
> +++ bindings/ocaml/llvm/llvm.mli
> @@ -1,4 +1,4 @@
> -(*===-- tools/ml/llvm.ml - LLVM Ocaml Interface  
> ---------------------------===*
> +(*===-- llvm/llvm.mli - LLVM Ocaml Interface  
> -------------------------------===*
>  *
>  *                     The LLVM Compiler Infrastructure
>  *
> diff --git bindings/ocaml/llvm/llvm_ocaml.c bindings/ocaml/llvm/ 
> llvm_ocaml.c
> index 3f48887..f4e958d 100644
> --- bindings/ocaml/llvm/llvm_ocaml.c
> +++ bindings/ocaml/llvm/llvm_ocaml.c
> @@ -1,4 +1,4 @@
> -/*===-- llvm_ocaml.h - LLVM Ocaml Glue --------------------------*-  
> C++ -*-===*\
> +/*===-- llvm_ocaml.c - LLVM Ocaml Glue --------------------------*-  
> C++ -*-===*\
> | 
> *                                                                            *|
> |*                     The LLVM Compiler  
> Infrastructure                       *|
> | 
> *                                                                            *|
> diff --git include/llvm-c/Core.h include/llvm-c/Core.h
> index 9b11df5..3676377 100644
> --- include/llvm-c/Core.h
> +++ include/llvm-c/Core.h
> @@ -48,20 +48,20 @@ extern "C" {
>
> /**
>  * The top-level container for all other LLVM Intermediate  
> Representation (IR)
> - * objects. See the llvm::Module class.
> + * objects. See the [llvm::Module] class.
>  */
> typedef struct LLVMOpaqueModule *LLVMModuleRef;
>
> /**
> - * Each value in the LLVM IR has a type, an instance of [lltype].  
> See the
> - * llvm::Type class.
> + * Each value in the LLVM IR has a type, an instance of  
> [LLVMTypeRef]. See the
> + * [llvm::Type] class.
>  */
> typedef struct LLVMOpaqueType *LLVMTypeRef;
>
> /**
> - * When building recursive types using [refine_type], [lltype]  
> values may become
> - * invalid; use [lltypehandle] to resolve this problem. See the
> - * llvm::AbstractTypeHolder] class.
> + * When building recursive types using [LLVMRefineType],  
> [LLVMTypeRef] values may become
> + * invalid; use [LLVMTypeHandleRef] to resolve this problem. See the
> + * [llvm::AbstractTypeHolder] class.
>  */
> typedef struct LLVMOpaqueTypeHandle *LLVMTypeHandleRef;
>
> @@ -70,12 +70,12 @@ typedef struct LLVMOpaqueBasicBlock  
> *LLVMBasicBlockRef;
> typedef struct LLVMOpaqueBuilder *LLVMBuilderRef;
>
> /* Used to provide a module to JIT or interpreter.
> - * See the llvm::ModuleProvider class.
> + * See the [llvm::ModuleProvider] class.
>  */
> typedef struct LLVMOpaqueModuleProvider *LLVMModuleProviderRef;
>
> /* Used to provide a module to JIT or interpreter.
> - * See the llvm::MemoryBuffer class.
> + * See the [llvm::MemoryBuffer] class.
>  */
> typedef struct LLVMOpaqueMemoryBuffer *LLVMMemoryBufferRef;
>
> @@ -165,18 +165,21 @@ void LLVMDisposeMessage(char *Message);
> /*===-- Modules  
> -----------------------------------------------------------===*/
>
> /* Create and destroy modules. */
> +/** See [llvm::Module::Module]. */
> LLVMModuleRef LLVMModuleCreateWithName(const char *ModuleID);
> +
> +/** See [llvm::Module::~Module]. */
> void LLVMDisposeModule(LLVMModuleRef M);
>
> -/* Data layout */
> +/** Data layout. See [Module::getDataLayout]. */
> const char *LLVMGetDataLayout(LLVMModuleRef M);
> void LLVMSetDataLayout(LLVMModuleRef M, const char *Triple);
>
> -/* Target triple */
> +/** Target triple. See [Module::getTargetTriple]. */
> const char *LLVMGetTarget(LLVMModuleRef M);
> void LLVMSetTarget(LLVMModuleRef M, const char *Triple);
>
> -/* Same as Module::addTypeName. */
> +/** See [Module::addTypeName]. */
> int LLVMAddTypeName(LLVMModuleRef M, const char *Name, LLVMTypeRef  
> Ty);
> void LLVMDeleteTypeName(LLVMModuleRef M, const char *Name);
>
> @@ -198,7 +201,10 @@ void LLVMDeleteTypeName(LLVMModuleRef M, const  
> char *Name);
>  *     opaque type
>  */
>
> +/** See [llvm::LLVMTypeKind::getTypeID]. */
> LLVMTypeKind LLVMGetTypeKind(LLVMTypeRef Ty);
> +
> +/** See [llvm::DerivedType::refineAbstractTypeTo]. */
> void LLVMRefineAbstractType(LLVMTypeRef AbstractType, LLVMTypeRef  
> ConcreteType);
>
> /* Operations on integer types */
> @@ -546,13 +552,13 @@ LLVMValueRef  
> LLVMBuildShuffleVector(LLVMBuilderRef, LLVMValueRef V1,
>
> /* Encapsulates the module M in a module provider, taking ownership  
> of the
>  * module.
> - * See the constructor  
> llvm::ExistingModuleProvider::ExistingModuleProvider.
> + * See the constructor  
> [llvm::ExistingModuleProvider::ExistingModuleProvider].
>  */
> LLVMModuleProviderRef
> LLVMCreateModuleProviderForExistingModule(LLVMModuleRef M);
>
> /* Destroys the module provider MP as well as the contained module.
> - * See the destructor llvm::ModuleProvider::~ModuleProvider.
> + * See the destructor [llvm::ModuleProvider::~ModuleProvider].
>  */
> void LLVMDisposeModuleProvider(LLVMModuleProviderRef MP);
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev



— Gordon





More information about the llvm-dev mailing list