clang  19.0.0git
ObjCPropertyAttributeOrderFixer.h
Go to the documentation of this file.
1 //===--- ObjCPropertyAttributeOrderFixer.h ------------------------------*- C++
2 //-*-===//
3 //
4 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5 // See https://llvm.org/LICENSE.txt for license information.
6 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //
8 //===----------------------------------------------------------------------===//
9 ///
10 /// \file
11 /// This file declares ObjCPropertyAttributeOrderFixer, a TokenAnalyzer that
12 /// adjusts the order of attributes in an ObjC `@property(...)` declaration,
13 /// depending on the style.
14 ///
15 //===----------------------------------------------------------------------===//
16 
17 #ifndef LLVM_CLANG_LIB_FORMAT_OBJCPROPERTYATTRIBUTEORDERFIXER_H
18 #define LLVM_CLANG_LIB_FORMAT_OBJCPROPERTYATTRIBUTEORDERFIXER_H
19 
20 #include "TokenAnalyzer.h"
21 
22 namespace clang {
23 namespace format {
24 
26  llvm::StringMap<unsigned> SortOrderMap;
27 
28  void analyzeObjCPropertyDecl(const SourceManager &SourceMgr,
29  const AdditionalKeywords &Keywords,
30  tooling::Replacements &Fixes,
31  const FormatToken *Tok);
32 
33  void sortPropertyAttributes(const SourceManager &SourceMgr,
34  tooling::Replacements &Fixes,
35  const FormatToken *BeginTok,
36  const FormatToken *EndTok);
37 
38  std::pair<tooling::Replacements, unsigned>
39  analyze(TokenAnnotator &Annotator,
40  SmallVectorImpl<AnnotatedLine *> &AnnotatedLines,
41  FormatTokenLexer &Tokens) override;
42 
43 public:
45  const FormatStyle &Style);
46 };
47 
48 } // end namespace format
49 } // end namespace clang
50 
51 #endif
This file declares an abstract TokenAnalyzer, and associated helper classes.
This class handles loading and caching of source files into memory.
ObjCPropertyAttributeOrderFixer(const Environment &Env, const FormatStyle &Style)
const Environment & Env
Definition: TokenAnalyzer.h:97
Determines extra information about the tokens comprising an UnwrappedLine.
Maintains a set of replacements that are conflict-free.
Definition: Replacement.h:212
The JSON file list parser is used to communicate input to InstallAPI.
Encapsulates keywords that are context sensitive or for languages not properly supported by Clang's l...
Definition: FormatToken.h:995
The FormatStyle is used to configure the formatting to follow specific guidelines.
Definition: Format.h:55
A wrapper around a Token storing information about the whitespace characters preceding it.
Definition: FormatToken.h:290