[DFAJumpThreading] Remove incoming StartBlock from all phis when unfolding select...
[llvm-project.git] / clang / lib / Format / DefinitionBlockSeparator.h
blob31c0f34d6e198b653e1253e0ba2b1b4dba58e98e
1 //===--- DefinitionBlockSeparator.h -----------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 ///
9 /// \file
10 /// This file declares DefinitionBlockSeparator, a TokenAnalyzer that inserts or
11 /// removes empty lines separating definition blocks like classes, structs,
12 /// functions, enums, and namespaces in between.
13 ///
14 //===----------------------------------------------------------------------===//
16 #ifndef LLVM_CLANG_LIB_FORMAT_DEFINITIONBLOCKSEPARATOR_H
17 #define LLVM_CLANG_LIB_FORMAT_DEFINITIONBLOCKSEPARATOR_H
19 #include "TokenAnalyzer.h"
20 #include "WhitespaceManager.h"
22 namespace clang {
23 namespace format {
24 class DefinitionBlockSeparator : public TokenAnalyzer {
25 public:
26 DefinitionBlockSeparator(const Environment &Env, const FormatStyle &Style)
27 : TokenAnalyzer(Env, Style) {}
29 std::pair<tooling::Replacements, unsigned>
30 analyze(TokenAnnotator &Annotator,
31 SmallVectorImpl<AnnotatedLine *> &AnnotatedLines,
32 FormatTokenLexer &Tokens) override;
34 private:
35 void separateBlocks(SmallVectorImpl<AnnotatedLine *> &Lines,
36 tooling::Replacements &Result, FormatTokenLexer &Tokens);
38 } // namespace format
39 } // namespace clang
41 #endif