Path: blob/main/contrib/llvm-project/clang/lib/Format/ObjCPropertyAttributeOrderFixer.h
35233 views
//===--- ObjCPropertyAttributeOrderFixer.h ------------------------------*- C++1//-*-===//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-exception6//7//===----------------------------------------------------------------------===//8///9/// \file10/// This file declares ObjCPropertyAttributeOrderFixer, a TokenAnalyzer that11/// adjusts the order of attributes in an ObjC `@property(...)` declaration,12/// depending on the style.13///14//===----------------------------------------------------------------------===//1516#ifndef LLVM_CLANG_LIB_FORMAT_OBJCPROPERTYATTRIBUTEORDERFIXER_H17#define LLVM_CLANG_LIB_FORMAT_OBJCPROPERTYATTRIBUTEORDERFIXER_H1819#include "TokenAnalyzer.h"2021namespace clang {22namespace format {2324class ObjCPropertyAttributeOrderFixer : public TokenAnalyzer {25llvm::StringMap<unsigned> SortOrderMap;2627void analyzeObjCPropertyDecl(const SourceManager &SourceMgr,28const AdditionalKeywords &Keywords,29tooling::Replacements &Fixes,30const FormatToken *Tok);3132void sortPropertyAttributes(const SourceManager &SourceMgr,33tooling::Replacements &Fixes,34const FormatToken *BeginTok,35const FormatToken *EndTok);3637std::pair<tooling::Replacements, unsigned>38analyze(TokenAnnotator &Annotator,39SmallVectorImpl<AnnotatedLine *> &AnnotatedLines,40FormatTokenLexer &Tokens) override;4142public:43ObjCPropertyAttributeOrderFixer(const Environment &Env,44const FormatStyle &Style);45};4647} // end namespace format48} // end namespace clang4950#endif515253