From a81ac0467dc242993661c7d52efae4e60962fd67 Mon Sep 17 00:00:00 2001 From: Sharp0802 Date: Sat, 5 Oct 2024 01:35:52 +0900 Subject: [PATCH] :bulb: Update in-code documents --- Doxyfile | 2 +- lilac/compilesymbolsubcommand.h | 3 +++ lilac/generatesubcommand.h | 3 +++ lilac/subcommand.h | 16 ++++++++++++++++ 4 files changed, 23 insertions(+), 1 deletion(-) diff --git a/Doxyfile b/Doxyfile index 30acadd..ccb9b08 100644 --- a/Doxyfile +++ b/Doxyfile @@ -928,7 +928,7 @@ WARN_LOGFILE = # spaces. See also FILE_PATTERNS and EXTENSION_MAPPING # Note: If this tag is empty the current directory is searched. -INPUT = docs ild langs +INPUT = docs lilac langs # This tag can be used to specify the character encoding of the source files # that Doxygen parses. Internally Doxygen uses the UTF-8 encoding. Doxygen uses diff --git a/lilac/compilesymbolsubcommand.h b/lilac/compilesymbolsubcommand.h index afc81b3..73c3ede 100644 --- a/lilac/compilesymbolsubcommand.h +++ b/lilac/compilesymbolsubcommand.h @@ -24,6 +24,9 @@ namespace lilac { + /** + * @brief A sub-command that compiles assemblies into symbols + */ class CompileSymbolSubCommand final : public SubCommand { llvm::cl::opt Language; diff --git a/lilac/generatesubcommand.h b/lilac/generatesubcommand.h index da6844a..e704677 100644 --- a/lilac/generatesubcommand.h +++ b/lilac/generatesubcommand.h @@ -24,6 +24,9 @@ namespace lilac { + /** + * @brief A sub-command that generates bindings from symbols + */ class GenerateSubCommand final : public SubCommand { llvm::cl::opt OutputPath; diff --git a/lilac/subcommand.h b/lilac/subcommand.h index 29902ad..0cfd82c 100644 --- a/lilac/subcommand.h +++ b/lilac/subcommand.h @@ -23,13 +23,25 @@ namespace lilac { + /** + * @brief An abstraction class of `llvm::cl::SubCommand` + */ class SubCommand { llvm::cl::SubCommand m_SubCommand; public: + /** + * @brief Creates a sub-command with given name and description + * @param command A name of the sub-command + * @param desc A description of the sub-command + */ SubCommand(const char* command, const char* desc); + /** + * @brief Runs a subcommand + * @return Zero will be returned when completed successfully; otherwise, non-zero will be returned + */ virtual int Run() = 0; virtual ~SubCommand() = default; @@ -38,6 +50,10 @@ namespace lilac operator bool() const; + /** + * @brief Gets default category of all sub-commands registered by LILAC + * @return Returns default category of all sub-commands registered by LILAC + */ static llvm::cl::OptionCategory& GetCategory(); }; }