[offload] [test] Use test compiler ID rather than host (#124408)
[llvm-project.git] / clang / lib / Format / ObjCPropertyAttributeOrderFixer.h
blobd9ce85d144afb2b683731c12ae768d198b5ebead
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 //===----------------------------------------------------------------------===//
17 #ifndef LLVM_CLANG_LIB_FORMAT_OBJCPROPERTYATTRIBUTEORDERFIXER_H
18 #define LLVM_CLANG_LIB_FORMAT_OBJCPROPERTYATTRIBUTEORDERFIXER_H
20 #include "TokenAnalyzer.h"
22 namespace clang {
23 namespace format {
25 class ObjCPropertyAttributeOrderFixer : public TokenAnalyzer {
26 llvm::StringMap<unsigned> SortOrderMap;
28 void analyzeObjCPropertyDecl(const SourceManager &SourceMgr,
29 const AdditionalKeywords &Keywords,
30 tooling::Replacements &Fixes,
31 const FormatToken *Tok);
33 void sortPropertyAttributes(const SourceManager &SourceMgr,
34 tooling::Replacements &Fixes,
35 const FormatToken *BeginTok,
36 const FormatToken *EndTok);
38 std::pair<tooling::Replacements, unsigned>
39 analyze(TokenAnnotator &Annotator,
40 SmallVectorImpl<AnnotatedLine *> &AnnotatedLines,
41 FormatTokenLexer &Tokens) override;
43 public:
44 ObjCPropertyAttributeOrderFixer(const Environment &Env,
45 const FormatStyle &Style);
48 } // end namespace format
49 } // end namespace clang
51 #endif