diff options
author | Alexander Kornienko <alexfh@google.com> | 2013-01-14 11:34:14 +0000 |
---|---|---|
committer | Alexander Kornienko <alexfh@google.com> | 2013-01-14 11:34:14 +0000 |
commit | a4ae9f30ef7bccdaa3feef8036af07fbb91f107c (patch) | |
tree | 8ad6c13025dcfb2778c32dfb3ff9772b99e4de2d /include/clang/Format/Format.h | |
parent | 1b6f4bd8d7e75e775053b1cb1281c6a127746e93 (diff) |
Custom DiagnosticConsumer parameter of reformat() + silence diagnostics in unit tests.
Summary:
Added tests for clang-format diagnostics. Added DiagnosticConsumer
argument to clang::format::reformat().
Reviewers: klimek, djasper
Reviewed By: djasper
CC: cfe-commits, thakis, rafael.espindola
Differential Revision: http://llvm-reviews.chandlerc.com/D290
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172399 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Format/Format.h')
-rw-r--r-- | include/clang/Format/Format.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/include/clang/Format/Format.h b/include/clang/Format/Format.h index e3a066e9d8..aac552b602 100644 --- a/include/clang/Format/Format.h +++ b/include/clang/Format/Format.h @@ -25,6 +25,7 @@ namespace clang { class Lexer; class SourceManager; +class DiagnosticConsumer; namespace format { @@ -57,7 +58,7 @@ struct FormatStyle { unsigned SpacesBeforeTrailingComments; /// \brief If the constructor initializers don't fit on a line, put each - /// initializer on its own line. + /// initializer on its own line. bool ConstructorInitializerAllOnOneLineOrOnePerLine; /// \brief Add a space in front of an Objective-C protocol list, i.e. use @@ -84,11 +85,15 @@ FormatStyle getGoogleStyle(); /// everything that might influence its formatting or might be influenced by its /// formatting. /// +/// \param DiagClient A custom DiagnosticConsumer. Can be 0, in this case +/// diagnostic is output to llvm::errs(). +/// /// Returns the \c Replacements necessary to make all \p Ranges comply with /// \p Style. tooling::Replacements reformat(const FormatStyle &Style, Lexer &Lex, SourceManager &SourceMgr, - std::vector<CharSourceRange> Ranges); + std::vector<CharSourceRange> Ranges, + DiagnosticConsumer *DiagClient = 0); /// \brief Returns the \c LangOpts that the formatter expects you to set. LangOptions getFormattingLangOpts(); |