From f4e12c8c1325ea04b54ed0b5869258254458b091 Mon Sep 17 00:00:00 2001 From: Edwin Vane Date: Mon, 30 Sep 2013 13:31:48 +0000 Subject: [PATCH] Moving style option formatting to libFormat The help text for clang-format's -style option and the function that processes its value is moved to libFormat in this patch. The goal is to enable other tools that use libFormat and also have a -style option to behave consistently with clang-format. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191666 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Format/Format.h | 24 +++++++++ lib/Format/Format.cpp | 78 +++++++++++++++++++++++++++ tools/clang-format/ClangFormat.cpp | 84 +++--------------------------- 3 files changed, 108 insertions(+), 78 deletions(-) diff --git a/include/clang/Format/Format.h b/include/clang/Format/Format.h index c326f66ef2..899087a147 100644 --- a/include/clang/Format/Format.h +++ b/include/clang/Format/Format.h @@ -347,6 +347,30 @@ tooling::Replacements reformat(const FormatStyle &Style, StringRef Code, LangOptions getFormattingLangOpts(FormatStyle::LanguageStandard Standard = FormatStyle::LS_Cpp11); +/// \brief Description to be used for help text for a llvm::cl option for +/// specifying format style. The description is closely related to the operation +/// of getStyle(). +extern const char *StyleOptionHelpDescription; + +/// \brief Construct a FormatStyle based on \c StyleName. +/// +/// \c StyleName can take several forms: +/// \li "{: , ...}" - Set specic style parameters. +/// \li "