diff options
Diffstat (limited to 'contrib/llvm-project/clang/lib/Format/UnwrappedLineParser.h')
-rw-r--r-- | contrib/llvm-project/clang/lib/Format/UnwrappedLineParser.h | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/contrib/llvm-project/clang/lib/Format/UnwrappedLineParser.h b/contrib/llvm-project/clang/lib/Format/UnwrappedLineParser.h index 739298690bbd..d5eeb3d57149 100644 --- a/contrib/llvm-project/clang/lib/Format/UnwrappedLineParser.h +++ b/contrib/llvm-project/clang/lib/Format/UnwrappedLineParser.h @@ -15,17 +15,8 @@ #ifndef LLVM_CLANG_LIB_FORMAT_UNWRAPPEDLINEPARSER_H #define LLVM_CLANG_LIB_FORMAT_UNWRAPPEDLINEPARSER_H -#include "Encoding.h" -#include "FormatToken.h" #include "Macros.h" -#include "clang/Basic/IdentifierTable.h" -#include "clang/Format/Format.h" -#include "llvm/ADT/ArrayRef.h" -#include "llvm/ADT/BitVector.h" -#include "llvm/Support/Regex.h" -#include <list> #include <stack> -#include <vector> namespace clang { namespace format { @@ -58,6 +49,9 @@ struct UnwrappedLine { /// Whether it is part of a macro body. bool InMacroBody = false; + /// Nesting level of unbraced body of a control statement. + unsigned UnbracedBodyLevel = 0; + bool MustBeDeclaration = false; /// Whether the parser has seen \c decltype(auto) in this line. @@ -166,7 +160,7 @@ private: void parseDoWhile(); void parseLabel(bool LeftAlignLabel = false); void parseCaseLabel(); - void parseSwitch(); + void parseSwitch(bool IsExpr); void parseNamespace(); bool parseModuleImport(); void parseNew(); @@ -324,6 +318,8 @@ private: llvm::BitVector DeclarationScopeStack; const FormatStyle &Style; + bool IsCpp; + LangOptions LangOpts; const AdditionalKeywords &Keywords; llvm::Regex CommentPragmasRegex; @@ -420,6 +416,8 @@ struct UnwrappedLineNode { SmallVector<UnwrappedLine, 0> Children; }; +std::ostream &operator<<(std::ostream &Stream, const UnwrappedLine &Line); + } // end namespace format } // end namespace clang |