diff options
author | Dmitri Gribenko <gribozavr@gmail.com> | 2013-02-22 14:21:27 +0000 |
---|---|---|
committer | Dmitri Gribenko <gribozavr@gmail.com> | 2013-02-22 14:21:27 +0000 |
commit | 6ebf09130479bc7605aa09a3e6c4dc2ba3513495 (patch) | |
tree | be83c24b25f848bc5ad0f9759a3405fcd49e5b79 /include/clang/Basic | |
parent | 9d4df46b6c78825303ffbdd01bbe8d4b4513ed89 (diff) |
Comment parsing: add CommentOptions to allow specifying custom comment block commands
Add an ability to specify custom documentation block comment commands via a new
class CommentOptions. The intention is that this class will hold future
customizations for comment parsing, including defining documentation comments
with specific numbers of parameters, etc.
CommentOptions instance is a member of LangOptions.
CommentOptions is controlled by a new command-line parameter
-fcomment-block-commands=Foo,Bar,Baz.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175892 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic')
-rw-r--r-- | include/clang/Basic/CommentOptions.h | 34 | ||||
-rw-r--r-- | include/clang/Basic/LangOptions.h | 4 |
2 files changed, 38 insertions, 0 deletions
diff --git a/include/clang/Basic/CommentOptions.h b/include/clang/Basic/CommentOptions.h new file mode 100644 index 0000000000..79b9a6b883 --- /dev/null +++ b/include/clang/Basic/CommentOptions.h @@ -0,0 +1,34 @@ +//===--- CommentOptions.h - Options for parsing comments -----*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +/// +/// \file +/// \brief Defines the clang::CommentOptions interface. +/// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_CLANG_COMMENTOPTIONS_H +#define LLVM_CLANG_COMMENTOPTIONS_H + +#include <string> +#include <vector> + +namespace clang { + +/// \brief Options for controlling comment parsing. +struct CommentOptions { + typedef std::vector<std::string> BlockCommandNamesTy; + + /// \brief Command names to treat as block commands in comments. + /// Should not include the leading backslash. + BlockCommandNamesTy BlockCommandNames; +}; + +} // end namespace clang + +#endif diff --git a/include/clang/Basic/LangOptions.h b/include/clang/Basic/LangOptions.h index 29c4e7b906..21ca7eb201 100644 --- a/include/clang/Basic/LangOptions.h +++ b/include/clang/Basic/LangOptions.h @@ -15,6 +15,7 @@ #ifndef LLVM_CLANG_LANGOPTIONS_H #define LLVM_CLANG_LANGOPTIONS_H +#include "clang/Basic/CommentOptions.h" #include "clang/Basic/LLVM.h" #include "clang/Basic/ObjCRuntime.h" #include "clang/Basic/Visibility.h" @@ -78,6 +79,9 @@ public: /// \brief The name of the current module. std::string CurrentModule; + + /// \brief Options for parsing comments. + CommentOptions CommentOpts; LangOptions(); |