From ad523cc398d132ca48215f6499ba420cf0f7aaaa Mon Sep 17 00:00:00 2001 From: Mats Larsen Date: Sun, 7 Nov 2021 12:23:17 +0100 Subject: [PATCH] [NFC][Docs] Add missing Doxygen group comments for LLVM-C The LLVM-C API is relatively small so we've previously added doxygen tags so it's easier to navigate the LLVM-C web docs. Over the years, more headers were added without proper doxygen tags, effectively hiding them from the main LLVM-C doxygen page. This patch adds comments to headers which did not have them. Reviewed By: lhames Differential Revision: https://reviews.llvm.org/D112474 --- llvm/include/llvm-c/Comdat.h | 11 +++++++++++ llvm/include/llvm-c/Core.h | 2 ++ llvm/include/llvm-c/DebugInfo.h | 11 +++++++++++ llvm/include/llvm-c/DisassemblerTypes.h | 10 ++++++++++ llvm/include/llvm-c/Error.h | 11 +++++++++++ llvm/include/llvm-c/ErrorHandling.h | 10 ++++++++++ llvm/include/llvm-c/IRReader.h | 11 +++++++++++ llvm/include/llvm-c/LLJIT.h | 11 +++++++++++ llvm/include/llvm-c/Linker.h | 11 +++++++++++ llvm/include/llvm-c/Orc.h | 11 +++++++++++ llvm/include/llvm-c/OrcEE.h | 11 +++++++++++ llvm/include/llvm-c/Support.h | 10 ++++++++++ llvm/include/llvm-c/TargetMachine.h | 10 ++++++++++ llvm/include/llvm-c/Transforms/PassBuilder.h | 11 +++++++++++ 14 files changed, 141 insertions(+) diff --git a/llvm/include/llvm-c/Comdat.h b/llvm/include/llvm-c/Comdat.h index 81cde11..8002bc0 100644 --- a/llvm/include/llvm-c/Comdat.h +++ b/llvm/include/llvm-c/Comdat.h @@ -19,6 +19,13 @@ LLVM_C_EXTERN_C_BEGIN +/** + * @defgroup LLVMCCoreComdat Comdats + * @ingroup LLVMCCore + * + * @{ + */ + typedef enum { LLVMAnyComdatSelectionKind, ///< The linker may choose any COMDAT. LLVMExactMatchComdatSelectionKind, ///< The data referenced by the COMDAT must @@ -66,6 +73,10 @@ LLVMComdatSelectionKind LLVMGetComdatSelectionKind(LLVMComdatRef C); */ void LLVMSetComdatSelectionKind(LLVMComdatRef C, LLVMComdatSelectionKind Kind); +/** + * @} + */ + LLVM_C_EXTERN_C_END #endif diff --git a/llvm/include/llvm-c/Core.h b/llvm/include/llvm-c/Core.h index a7324c6..d170eff1 100644 --- a/llvm/include/llvm-c/Core.h +++ b/llvm/include/llvm-c/Core.h @@ -4091,6 +4091,7 @@ void LLVMDisposeMemoryBuffer(LLVMMemoryBufferRef MemBuf); /** * @defgroup LLVMCCorePassRegistry Pass Registry + * @ingroup LLVMCCore * * @{ */ @@ -4105,6 +4106,7 @@ LLVMPassRegistryRef LLVMGetGlobalPassRegistry(void); /** * @defgroup LLVMCCorePassManagers Pass Managers + * @ingroup LLVMCCore * * @{ */ diff --git a/llvm/include/llvm-c/DebugInfo.h b/llvm/include/llvm-c/DebugInfo.h index 0c7b5db..d7fb898 100644 --- a/llvm/include/llvm-c/DebugInfo.h +++ b/llvm/include/llvm-c/DebugInfo.h @@ -22,6 +22,13 @@ LLVM_C_EXTERN_C_BEGIN /** + * @defgroup LLVMCCoreDebugInfo Debug Information + * @ingroup LLVMCCore + * + * @{ + */ + +/** * Debug info flags. */ typedef enum { @@ -1367,6 +1374,10 @@ void LLVMInstructionSetDebugLoc(LLVMValueRef Inst, LLVMMetadataRef Loc); */ LLVMMetadataKind LLVMGetMetadataKind(LLVMMetadataRef Metadata); +/** + * @} + */ + LLVM_C_EXTERN_C_END #endif diff --git a/llvm/include/llvm-c/DisassemblerTypes.h b/llvm/include/llvm-c/DisassemblerTypes.h index ae5c682..53baaef 100644 --- a/llvm/include/llvm-c/DisassemblerTypes.h +++ b/llvm/include/llvm-c/DisassemblerTypes.h @@ -18,6 +18,12 @@ #endif /** + * @addtogroup LLVMCDisassembler + * + * @{ + */ + +/** * An opaque reference to a disassembler context. */ typedef void *LLVMDisasmContextRef; @@ -157,4 +163,8 @@ typedef const char *(*LLVMSymbolLookupCallback)(void *DisInfo, /* The output reference is to a C++ symbol name. */ #define LLVMDisassembler_ReferenceType_DeMangled_Name 9 +/** + * @} + */ + #endif diff --git a/llvm/include/llvm-c/Error.h b/llvm/include/llvm-c/Error.h index bc702ac..c3baaf6 100644 --- a/llvm/include/llvm-c/Error.h +++ b/llvm/include/llvm-c/Error.h @@ -18,6 +18,13 @@ LLVM_C_EXTERN_C_BEGIN +/** + * @defgroup LLVMCError Error Handling + * @ingroup LLVMC + * + * @{ + */ + #define LLVMErrorSuccess 0 /** @@ -67,6 +74,10 @@ LLVMErrorTypeId LLVMGetStringErrorTypeId(void); */ LLVMErrorRef LLVMCreateStringError(const char *ErrMsg); +/** + * @} + */ + LLVM_C_EXTERN_C_END #endif diff --git a/llvm/include/llvm-c/ErrorHandling.h b/llvm/include/llvm-c/ErrorHandling.h index 5ba099c..d9b9f22 100644 --- a/llvm/include/llvm-c/ErrorHandling.h +++ b/llvm/include/llvm-c/ErrorHandling.h @@ -18,6 +18,12 @@ LLVM_C_EXTERN_C_BEGIN +/** + * @addtogroup LLVMCError + * + * @{ + */ + typedef void (*LLVMFatalErrorHandler)(const char *Reason); /** @@ -42,6 +48,10 @@ void LLVMResetFatalErrorHandler(void); */ void LLVMEnablePrettyStackTrace(void); +/** + * @} + */ + LLVM_C_EXTERN_C_END #endif diff --git a/llvm/include/llvm-c/IRReader.h b/llvm/include/llvm-c/IRReader.h index 5a3f633..905b84f 100644 --- a/llvm/include/llvm-c/IRReader.h +++ b/llvm/include/llvm-c/IRReader.h @@ -20,6 +20,13 @@ LLVM_C_EXTERN_C_BEGIN /** + * @defgroup LLVMCCoreIRReader IR Reader + * @ingroup LLVMCCore + * + * @{ + */ + +/** * Read LLVM IR from a memory buffer and convert it into an in-memory Module * object. Returns 0 on success. * Optionally returns a human-readable description of any errors that @@ -32,6 +39,10 @@ LLVMBool LLVMParseIRInContext(LLVMContextRef ContextRef, LLVMMemoryBufferRef MemBuf, LLVMModuleRef *OutM, char **OutMessage); +/** + * @} + */ + LLVM_C_EXTERN_C_END #endif diff --git a/llvm/include/llvm-c/LLJIT.h b/llvm/include/llvm-c/LLJIT.h index f689ca0..a06133a 100644 --- a/llvm/include/llvm-c/LLJIT.h +++ b/llvm/include/llvm-c/LLJIT.h @@ -32,6 +32,13 @@ LLVM_C_EXTERN_C_BEGIN /** + * @defgroup LLVMCExecutionEngineLLJIT LLJIT + * @ingroup LLVMCExecutionEngine + * + * @{ + */ + +/** * A function for constructing an ObjectLinkingLayer instance to be used * by an LLJIT instance. * @@ -235,6 +242,10 @@ LLVMOrcIRTransformLayerRef LLVMOrcLLJITGetIRTransformLayer(LLVMOrcLLJITRef J); */ const char *LLVMOrcLLJITGetDataLayoutStr(LLVMOrcLLJITRef J); +/** + * @} + */ + LLVM_C_EXTERN_C_END #endif /* LLVM_C_LLJIT_H */ diff --git a/llvm/include/llvm-c/Linker.h b/llvm/include/llvm-c/Linker.h index 1ad9cc9..acff5d5 100644 --- a/llvm/include/llvm-c/Linker.h +++ b/llvm/include/llvm-c/Linker.h @@ -19,6 +19,13 @@ LLVM_C_EXTERN_C_BEGIN +/** + * @defgroup LLVMCCoreLinker Linker + * @ingroup LLVMCCore + * + * @{ + */ + /* This enum is provided for backwards-compatibility only. It has no effect. */ typedef enum { LLVMLinkerDestroySource = 0, /* This is the default behavior. */ @@ -35,4 +42,8 @@ LLVMBool LLVMLinkModules2(LLVMModuleRef Dest, LLVMModuleRef Src); LLVM_C_EXTERN_C_END +/** + * @} + */ + #endif diff --git a/llvm/include/llvm-c/Orc.h b/llvm/include/llvm-c/Orc.h index 480ce83..e2f30b7 100644 --- a/llvm/include/llvm-c/Orc.h +++ b/llvm/include/llvm-c/Orc.h @@ -34,6 +34,13 @@ LLVM_C_EXTERN_C_BEGIN /** + * @defgroup LLVMCExecutionEngineORC On-Request-Compilation + * @ingroup LLVMCExecutionEngine + * + * @{ + */ + +/** * Represents an address in the executor process. */ typedef uint64_t LLVMOrcJITTargetAddress; @@ -1176,6 +1183,10 @@ void LLVMOrcDisposeDumpObjects(LLVMOrcDumpObjectsRef DumpObjects); LLVMErrorRef LLVMOrcDumpObjects_CallOperator(LLVMOrcDumpObjectsRef DumpObjects, LLVMMemoryBufferRef *ObjBuffer); +/** + * @} + */ + LLVM_C_EXTERN_C_END #endif /* LLVM_C_ORC_H */ diff --git a/llvm/include/llvm-c/OrcEE.h b/llvm/include/llvm-c/OrcEE.h index 2435e74..e7ae0f5 100644 --- a/llvm/include/llvm-c/OrcEE.h +++ b/llvm/include/llvm-c/OrcEE.h @@ -33,6 +33,13 @@ LLVM_C_EXTERN_C_BEGIN /** + * @defgroup LLVMCExecutionEngineORCEE ExecutionEngine-based ORC Utils + * @ingroup LLVMCExecutionEngine + * + * @{ + */ + +/** * Create a RTDyldObjectLinkingLayer instance using the standard * SectionMemoryManager for memory management. */ @@ -50,6 +57,10 @@ void LLVMOrcRTDyldObjectLinkingLayerRegisterJITEventListener( LLVMOrcObjectLayerRef RTDyldObjLinkingLayer, LLVMJITEventListenerRef Listener); +/** + * @} + */ + LLVM_C_EXTERN_C_END #endif /* LLVM_C_ORCEE_H */ diff --git a/llvm/include/llvm-c/Support.h b/llvm/include/llvm-c/Support.h index 866df32..1765786 100644 --- a/llvm/include/llvm-c/Support.h +++ b/llvm/include/llvm-c/Support.h @@ -21,6 +21,12 @@ LLVM_C_EXTERN_C_BEGIN /** + * @addtogroup LLVMCCore + * + * @{ + */ + +/** * This function permanently loads the dynamic library at the given path. * It is safe to call this function multiple times for the same library. * @@ -57,6 +63,10 @@ void *LLVMSearchForAddressOfSymbol(const char *symbolName); */ void LLVMAddSymbol(const char *symbolName, void *symbolValue); +/** + * @} + */ + LLVM_C_EXTERN_C_END #endif diff --git a/llvm/include/llvm-c/TargetMachine.h b/llvm/include/llvm-c/TargetMachine.h index f82edd9..23c8c63 100644 --- a/llvm/include/llvm-c/TargetMachine.h +++ b/llvm/include/llvm-c/TargetMachine.h @@ -25,6 +25,12 @@ LLVM_C_EXTERN_C_BEGIN +/** + * @addtogroup LLVMCTarget + * + * @{ + */ + typedef struct LLVMOpaqueTargetMachine *LLVMTargetMachineRef; typedef struct LLVMTarget *LLVMTargetRef; @@ -156,6 +162,10 @@ char* LLVMGetHostCPUFeatures(void); /** Adds the target-specific analysis passes to the pass manager. */ void LLVMAddAnalysisPasses(LLVMTargetMachineRef T, LLVMPassManagerRef PM); +/** + * @} + */ + LLVM_C_EXTERN_C_END #endif diff --git a/llvm/include/llvm-c/Transforms/PassBuilder.h b/llvm/include/llvm-c/Transforms/PassBuilder.h index 0de9be6..6d9f1b4 100644 --- a/llvm/include/llvm-c/Transforms/PassBuilder.h +++ b/llvm/include/llvm-c/Transforms/PassBuilder.h @@ -18,6 +18,13 @@ #include "llvm-c/TargetMachine.h" #include "llvm-c/Types.h" +/** + * @defgroup LLVMCCoreNewPM New Pass Manager + * @ingroup LLVMCCore + * + * @{ + */ + LLVM_C_EXTERN_C_BEGIN /** @@ -97,6 +104,10 @@ void LLVMPassBuilderOptionsSetMergeFunctions(LLVMPassBuilderOptionsRef Options, */ void LLVMDisposePassBuilderOptions(LLVMPassBuilderOptionsRef Options); +/** + * @} + */ + LLVM_C_EXTERN_C_END #endif // LLVM_C_TRANSFORMS_PASSBUILDER_H -- 2.7.4