Organize LLVM C API docs into doxygen modules; add docs

This gives a lot of love to the docs for the C API. Like Clang's
documentation, the C API is now organized into a Doxygen "module"
(LLVMC). Each C header file is a child of the main module. Some modules
(like Core) have a hierarchy of there own. The produced documentation is
thus better organized (before everything was in one monolithic list).

This patch also includes a lot of new documentation for APIs in Core.h.
It doesn't document them all, but is better than none. Function docs are
missing @param and @return annotation, but the documentation body now
commonly provides help details (like the expected llvm::Value sub-type
to expect).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153157 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Gregory Szorc 2012-03-21 03:54:29 +00:00
parent 9be7c94ccd
commit 6244b51888
16 changed files with 1627 additions and 114 deletions

View File

@ -25,6 +25,12 @@
extern "C" {
#endif
/**
* @defgroup LLVMCAnalysis Analysis
* @ingroup LLVMC
*
* @{
*/
typedef enum {
LLVMAbortProcessAction, /* verifier will print to stderr and abort() */
@ -48,6 +54,10 @@ LLVMBool LLVMVerifyFunction(LLVMValueRef Fn, LLVMVerifierFailureAction Action);
void LLVMViewFunctionCFG(LLVMValueRef Fn);
void LLVMViewFunctionCFGOnly(LLVMValueRef Fn);
/**
* @}
*/
#ifdef __cplusplus
}
#endif

View File

@ -25,6 +25,12 @@
extern "C" {
#endif
/**
* @defgroup LLVMCBitReader Bit Reader
* @ingroup LLVMC
*
* @{
*/
/* Builds a module from the bitcode in the specified memory buffer, returning a
reference to the module via the OutModule parameter. Returns 0 on success.
@ -59,6 +65,10 @@ LLVMBool LLVMGetBitcodeModuleProvider(LLVMMemoryBufferRef MemBuf,
LLVMModuleProviderRef *OutMP,
char **OutMessage);
/**
* @}
*/
#ifdef __cplusplus
}
#endif

View File

@ -25,6 +25,12 @@
extern "C" {
#endif
/**
* @defgroup LLVMCBitWriter Bit Writer
* @ingroup LLVMC
*
* @{
*/
/*===-- Operations on modules ---------------------------------------------===*/
@ -39,6 +45,10 @@ int LLVMWriteBitcodeToFD(LLVMModuleRef M, int FD, int ShouldClose,
descriptor. Returns 0 on success. Closes the Handle. */
int LLVMWriteBitcodeToFileHandle(LLVMModuleRef M, int Handle);
/**
* @}
*/
#ifdef __cplusplus
}
#endif

File diff suppressed because it is too large Load Diff

View File

@ -18,6 +18,13 @@
#include "llvm/Support/DataTypes.h"
#include <stddef.h>
/**
* @defgroup LLVMCDisassembler Disassembler
* @ingroup LLVMC
*
* @{
*/
/**
* An opaque reference to a disassembler context.
*/
@ -157,6 +164,10 @@ size_t LLVMDisasmInstruction(LLVMDisasmContextRef DC, uint8_t *Bytes,
uint64_t BytesSize, uint64_t PC,
char *OutString, size_t OutStringSize);
/**
* @}
*/
#ifdef __cplusplus
}
#endif /* !defined(__cplusplus) */

View File

@ -25,6 +25,19 @@
extern "C" {
#endif
/**
* @defgroup LLVMCEnhancedDisassembly Enhanced Disassembly
* @ingroup LLVMC
* @deprecated
*
* This module contains an interface to the Enhanced Disassembly (edis)
* library. The edis library is deprecated and will likely disappear in
* the near future. You should use the @ref LLVMCDisassembler interface
* instead.
*
* @{
*/
/*!
@typedef EDByteReaderCallback
Interface to memory from which instructions may be read.
@ -504,6 +517,10 @@ int EDBlockEvaluateOperand(uint64_t *result,
int EDBlockVisitTokens(EDInstRef inst,
EDTokenVisitor_t visitor);
/**
* @}
*/
#endif
#ifdef __cplusplus

View File

@ -26,6 +26,13 @@
extern "C" {
#endif
/**
* @defgroup LLVMCExecutionEngine Execution Engine
* @ingroup LLVMC
*
* @{
*/
void LLVMLinkInJIT(void);
void LLVMLinkInInterpreter(void);
@ -125,6 +132,10 @@ void LLVMAddGlobalMapping(LLVMExecutionEngineRef EE, LLVMValueRef Global,
void *LLVMGetPointerToGlobal(LLVMExecutionEngineRef EE, LLVMValueRef Global);
/**
* @}
*/
#ifdef __cplusplus
}

View File

@ -22,6 +22,15 @@
extern "C" {
#endif
/**
* @defgroup LLVMCInitialization Initialization Routines
* @ingroup LLVMC
*
* This module contains routines used to initialize the LLVM system.
*
* @{
*/
void LLVMInitializeCore(LLVMPassRegistryRef R);
void LLVMInitializeTransformUtils(LLVMPassRegistryRef R);
void LLVMInitializeScalarOpts(LLVMPassRegistryRef R);
@ -34,6 +43,10 @@ void LLVMInitializeIPA(LLVMPassRegistryRef R);
void LLVMInitializeCodeGen(LLVMPassRegistryRef R);
void LLVMInitializeTarget(LLVMPassRegistryRef R);
/**
* @}
*/
#ifdef __cplusplus
}
#endif

View File

@ -20,6 +20,13 @@
extern "C" {
#endif
/**
* @defgroup LLVMCLinkTimeOptimizer Link Time Optimization
* @ingroup LLVMC
*
* @{
*/
/// This provides a dummy type for pointers to the LTO object.
typedef void* llvm_lto_t;
@ -51,6 +58,10 @@ extern "C" {
extern llvm_lto_status_t llvm_optimize_modules
(llvm_lto_t lto, const char* output_filename);
/**
* @}
*/
#ifdef __cplusplus
}
#endif

View File

@ -28,6 +28,13 @@
extern "C" {
#endif
/**
* @defgroup LLVMCObject Object file reading and writing
* @ingroup LLVMC
*
* @{
*/
// Opaque type wrappers
typedef struct LLVMOpaqueObjectFile *LLVMObjectFileRef;
typedef struct LLVMOpaqueSectionIterator *LLVMSectionIteratorRef;
@ -86,6 +93,9 @@ uint64_t LLVMGetRelocationType(LLVMRelocationIteratorRef RI);
const char *LLVMGetRelocationTypeName(LLVMRelocationIteratorRef RI);
const char *LLVMGetRelocationValueString(LLVMRelocationIteratorRef RI);
/**
* @}
*/
#ifdef __cplusplus
}

View File

@ -26,6 +26,13 @@
extern "C" {
#endif
/**
* @defgroup LLVMCTarget Target information
* @ingroup LLVMC
*
* @{
*/
enum LLVMByteOrdering { LLVMBigEndian, LLVMLittleEndian };
typedef struct LLVMOpaqueTargetData *LLVMTargetDataRef;
@ -209,6 +216,9 @@ unsigned long long LLVMOffsetOfElement(LLVMTargetDataRef, LLVMTypeRef StructTy,
See the destructor llvm::TargetData::~TargetData. */
void LLVMDisposeTargetData(LLVMTargetDataRef);
/**
* @}
*/
#ifdef __cplusplus
}

View File

@ -21,6 +21,13 @@
extern "C" {
#endif
/**
* @defgroup LLVMCTransformsIPO Interprocedural transformations
* @ingroup LLVMCTransforms
*
* @{
*/
/** See llvm::createArgumentPromotionPass function. */
void LLVMAddArgumentPromotionPass(LLVMPassManagerRef PM);
@ -63,6 +70,10 @@ void LLVMAddStripDeadPrototypesPass(LLVMPassManagerRef PM);
/** See llvm::createStripSymbolsPass function. */
void LLVMAddStripSymbolsPass(LLVMPassManagerRef PM);
/**
* @}
*/
#ifdef __cplusplus
}
#endif /* defined(__cplusplus) */

View File

@ -23,6 +23,13 @@ typedef struct LLVMOpaquePassManagerBuilder *LLVMPassManagerBuilderRef;
extern "C" {
#endif
/**
* @defgroup LLVMCTransformsPassManagerBuilder Pass manager builder
* @ingroup LLVMCTransforms
*
* @{
*/
/** See llvm::PassManagerBuilder. */
LLVMPassManagerBuilderRef LLVMPassManagerBuilderCreate(void);
void LLVMPassManagerBuilderDispose(LLVMPassManagerBuilderRef PMB);
@ -73,6 +80,10 @@ void LLVMPassManagerBuilderPopulateLTOPassManager(LLVMPassManagerBuilderRef PMB,
bool Internalize,
bool RunInliner);
/**
* @}
*/
#ifdef __cplusplus
}

View File

@ -25,6 +25,13 @@
extern "C" {
#endif
/**
* @defgroup LLVMCTransformsScalar Scalar transformations
* @ingroup LLVMCTransforms
*
* @{
*/
/** See llvm::createAggressiveDCEPass function. */
void LLVMAddAggressiveDCEPass(LLVMPassManagerRef PM);
@ -116,6 +123,9 @@ void LLVMAddTypeBasedAliasAnalysisPass(LLVMPassManagerRef PM);
/** See llvm::createBasicAliasAnalysisPass function */
void LLVMAddBasicAliasAnalysisPass(LLVMPassManagerRef PM);
/**
* @}
*/
#ifdef __cplusplus
}

View File

@ -26,9 +26,20 @@
extern "C" {
#endif
/**
* @defgroup LLVMCTransformsVectorize Vectorization transformations
* @ingroup LLVMCTransforms
*
* @{
*/
/** See llvm::createBBVectorizePass function. */
void LLVMAddBBVectorizePass(LLVMPassManagerRef PM);
/**
* @}
*/
#ifdef __cplusplus
}
#endif /* defined(__cplusplus) */

View File

@ -20,6 +20,13 @@
#include <stddef.h>
#include <unistd.h>
/**
* @defgroup LLVMCLTO LTO
* @ingroup LLVMC
*
* @{
*/
#define LTO_API_VERSION 4
typedef enum {
@ -289,5 +296,8 @@ lto_codegen_debug_options(lto_code_gen_t cg, const char *);
}
#endif
/**
* @}
*/
#endif