clang 22.0.0git
|
Namespaces | |
namespace | encoding |
namespace | internal |
Classes | |
class | AffectedRangeManager |
class | AnnotatedLine |
class | BreakableBlockComment |
class | BreakableComment |
class | BreakableLineCommentSection |
class | BreakableStringLiteral |
class | BreakableStringLiteralUsingOperators |
class | BreakableToken |
Base class for tokens / ranges of tokens that can allow breaking within the tokens - for example, to avoid whitespace beyond the column limit, or to reflow text. More... | |
class | CompoundStatementIndenter |
class | ContinuationIndenter |
class | DefinitionBlockSeparator |
class | Environment |
class | FatalDiagnosticConsumer |
struct | FormatToken |
A wrapper around a Token storing information about the whitespace characters preceding it. More... | |
class | FormatTokenLexer |
class | FormatTokenSource |
class | IndexedTokenSource |
class | IntegerLiteralSeparatorFixer |
class | JavaScriptImportSorter |
struct | JsImportedSymbol |
struct | JsModuleReference |
class | LeftRightQualifierAlignmentFixer |
struct | LineState |
The current state when indenting a unwrapped line. More... | |
class | MacroCallReconstructor |
Converts a sequence of UnwrappedLines containing expanded macros into a single UnwrappedLine containing the macro calls. More... | |
class | MacroExpander |
Takes a set of macro definitions as strings and allows expanding calls to those macros. More... | |
struct | MacroExpansion |
Contains information on the token's role in a macro expansion. More... | |
class | NamespaceEndCommentsFixer |
class | NumericLiteralCaseFixer |
struct | NumericLiteralInfo |
class | ObjCPropertyAttributeOrderFixer |
struct | ObjCPropertyEntry |
struct | ParenState |
class | ParseErrorCategory |
struct | RawStringFormatStyleManager |
class | ScopedLineState |
class | ScopedMacroState |
class | TokenAnalyzer |
class | TokenAnnotator |
Determines extra information about the tokens comprising an UnwrappedLine . More... | |
struct | UnwrappedLine |
An unwrapped line is a sequence of Token , that we would like to put on a single line if there was no column limit. More... | |
class | UnwrappedLineConsumer |
Interface for users of the UnwrappedLineParser to receive the parsed lines. More... | |
class | UnwrappedLineFormatter |
struct | UnwrappedLineNode |
class | UnwrappedLineParser |
class | UsingDeclarationsSorter |
class | WhitespaceManager |
Manages the whitespaces around tokens and their replacements. More... |
Typedefs | |
typedef std::function< std::pair< tooling::Replacements, unsigned >(const Environment &)> | AnalyzerPass |
Functions | |
const std::error_category & | getParseCategory () |
std::error_code | make_error_code (ParseError e) |
static constexpr StringRef | Blanks (" \t\v\f\r") |
static StringRef | getLineCommentIndentPrefix (StringRef Comment, const FormatStyle &Style) |
static BreakableToken::Split | getCommentSplit (StringRef Text, unsigned ContentStartColumn, unsigned ColumnLimit, unsigned TabWidth, encoding::Encoding Encoding, const FormatStyle &Style, bool DecorationEndsWithStar=false) |
static BreakableToken::Split | getStringSplit (StringRef Text, unsigned UsedColumns, unsigned ColumnLimit, unsigned TabWidth, encoding::Encoding Encoding) |
bool | switchesFormatting (const FormatToken &Token) |
Checks if Token switches formatting, like /* clang-format off */. | |
static bool | mayReflowContent (StringRef Content) |
static bool | shouldIndentWrappedSelectorName (const FormatStyle &Style, LineType LineType) |
static bool | shouldUnindentNextOperator (const FormatToken &Tok) |
static unsigned | getLengthToMatchingParen (const FormatToken &Tok, ArrayRef< ParenState > Stack) |
static unsigned | getLengthToNextOperator (const FormatToken &Tok) |
static bool | startsSegmentOfBuilderTypeCall (const FormatToken &Tok) |
static bool | isAlignableBinaryOperator (const FormatToken &Token) |
static bool | startsNextOperand (const FormatToken &Current) |
static bool | mustBreakBinaryOperation (const FormatToken &Current, const FormatStyle &Style) |
static bool | opensProtoMessageField (const FormatToken &LessTok, const FormatStyle &Style) |
static std::optional< StringRef > | getRawStringDelimiter (StringRef TokenText) |
static StringRef | getCanonicalRawStringDelimiter (const FormatStyle &Style, FormatStyle::LanguageKind Language) |
static bool | hasNestedBlockInlined (const FormatToken *Previous, const FormatToken &Current, const FormatStyle &Style) |
static unsigned | getLastLineEndColumn (StringRef Text, unsigned StartColumn, unsigned TabWidth, encoding::Encoding Encoding) |
static StringRef | getEnclosingFunctionName (const FormatToken &Current) |
llvm::Error | make_string_error (const Twine &Message) |
static void | expandPresetsBraceWrapping (FormatStyle &Expanded) |
static void | expandPresetsSpaceBeforeParens (FormatStyle &Expanded) |
static void | expandPresetsSpacesInParens (FormatStyle &Expanded) |
FormatStyle | getLLVMStyle (FormatStyle::LanguageKind Language) |
FormatStyle | getGoogleStyle (FormatStyle::LanguageKind Language) |
FormatStyle | getChromiumStyle (FormatStyle::LanguageKind Language) |
FormatStyle | getMozillaStyle () |
FormatStyle | getWebKitStyle () |
FormatStyle | getGNUStyle () |
FormatStyle | getMicrosoftStyle (FormatStyle::LanguageKind Language) |
FormatStyle | getClangFormatStyle () |
FormatStyle | getNoStyle () |
bool | getPredefinedStyle (StringRef Name, FormatStyle::LanguageKind Language, FormatStyle *Style) |
ParseError | validateQualifierOrder (FormatStyle *Style) |
std::error_code | parseConfiguration (llvm::MemoryBufferRef Config, FormatStyle *Style, bool AllowUnknownOptions, llvm::SourceMgr::DiagHandlerTy DiagHandler, void *DiagHandlerCtxt, bool IsDotHFile) |
std::string | configurationAsText (const FormatStyle &Style) |
static bool | affectsRange (ArrayRef< tooling::Range > Ranges, unsigned Start, unsigned End) |
static std::pair< unsigned, unsigned > | FindCursorIndex (const ArrayRef< IncludeDirective > &Includes, const ArrayRef< unsigned > &Indices, unsigned Cursor) |
std::string | replaceCRLF (const std::string &Code) |
static void | sortCppIncludes (const FormatStyle &Style, const ArrayRef< IncludeDirective > &Includes, ArrayRef< tooling::Range > Ranges, StringRef FileName, StringRef Code, tooling::Replacements &Replaces, unsigned *Cursor) |
tooling::Replacements | sortCppIncludes (const FormatStyle &Style, StringRef Code, ArrayRef< tooling::Range > Ranges, StringRef FileName, tooling::Replacements &Replaces, unsigned *Cursor) |
static unsigned | findJavaImportGroup (const FormatStyle &Style, StringRef ImportIdentifier) |
static void | sortJavaImports (const FormatStyle &Style, const ArrayRef< JavaImportDirective > &Imports, ArrayRef< tooling::Range > Ranges, StringRef FileName, StringRef Code, tooling::Replacements &Replaces) |
tooling::Replacements | sortJavaImports (const FormatStyle &Style, StringRef Code, ArrayRef< tooling::Range > Ranges, StringRef FileName, tooling::Replacements &Replaces) |
bool | isMpegTS (StringRef Code) |
bool | isLikelyXml (StringRef Code) |
tooling::Replacements | sortIncludes (const FormatStyle &Style, StringRef Code, ArrayRef< tooling::Range > Ranges, StringRef FileName, unsigned *Cursor) |
template<typename T> | |
static Expected< tooling::Replacements > | processReplacements (T ProcessFunc, StringRef Code, const tooling::Replacements &Replaces, const FormatStyle &Style) |
Expected< tooling::Replacements > | formatReplacements (StringRef Code, const tooling::Replacements &Replaces, const FormatStyle &Style) |
Expected< tooling::Replacements > | cleanupAroundReplacements (StringRef Code, const tooling::Replacements &Replaces, const FormatStyle &Style) |
tooling::Replacements | reformat (const FormatStyle &Style, StringRef Code, ArrayRef< tooling::Range > Ranges, StringRef FileName, FormattingAttemptStatus *Status) |
tooling::Replacements | cleanup (const FormatStyle &Style, StringRef Code, ArrayRef< tooling::Range > Ranges, StringRef FileName) |
tooling::Replacements | reformat (const FormatStyle &Style, StringRef Code, ArrayRef< tooling::Range > Ranges, StringRef FileName, bool *IncompleteFormat) |
tooling::Replacements | fixNamespaceEndComments (const FormatStyle &Style, StringRef Code, ArrayRef< tooling::Range > Ranges, StringRef FileName) |
tooling::Replacements | sortUsingDeclarations (const FormatStyle &Style, StringRef Code, ArrayRef< tooling::Range > Ranges, StringRef FileName) |
LangOptions | getFormattingLangOpts (const FormatStyle &Style) |
static FormatStyle::LanguageKind | getLanguageByFileName (StringRef FileName) |
static FormatStyle::LanguageKind | getLanguageByComment (const Environment &Env) |
FormatStyle::LanguageKind | guessLanguage (StringRef FileName, StringRef Code) |
llvm::ErrorOr< std::unique_ptr< llvm::MemoryBuffer > > | loadAndParseConfigFile (StringRef ConfigFile, llvm::vfs::FileSystem *FS, FormatStyle *Style, bool AllowUnknownOptions, llvm::SourceMgr::DiagHandlerTy DiagHandler, bool IsDotHFile) |
Expected< FormatStyle > | getStyle (StringRef StyleName, StringRef FileName, StringRef FallbackStyleName, StringRef Code, llvm::vfs::FileSystem *FS, bool AllowUnknownOptions, llvm::SourceMgr::DiagHandlerTy DiagHandler) |
static bool | isClangFormatOnOff (StringRef Comment, bool On) |
bool | isClangFormatOn (StringRef Comment) |
bool | isClangFormatOff (StringRef Comment) |
const char * | getTokenTypeName (TokenType Type) |
Determines the name of a token type. | |
static unsigned | CodePointsBetween (const FormatToken *Begin, const FormatToken *End) |
bool | startsNextParameter (const FormatToken &Current, const FormatStyle &Style) |
struct clang::format::FormatToken | getPreviousNonComment () const |
Returns the previous token ignoring comments. | |
FormatToken * | getNextNonComment () const |
Returns the next token ignoring comments. | |
bool | isBlockIndentedInitRBrace (const FormatStyle &Style) const |
Returns true if this token ends a block indented initializer list. | |
bool | opensBlockOrBlockTypeList (const FormatStyle &Style) const |
Returns true if this tokens starts a block-type list, i.e. a list that should be indented with a block indent. | |
bool | isCppStructuredBinding (bool IsCpp) const |
Returns whether the token is the left square bracket of a C++ structured binding declaration. | |
bool | closesBlockOrBlockTypeList (const FormatStyle &Style) const |
Same as opensBlockOrBlockTypeList, but for the closing token. | |
const FormatToken * | getNamespaceToken () const |
Return the actual namespace token, if this token starts a namespace block. | |
void | copyFrom (const FormatToken &Tok) |
static auto | lexCSharpString (const char *Begin, const char *End, bool Verbatim, bool Interpolated) |
static size_t | countLeadingWhitespace (StringRef Text) |
Count the length of leading whitespace in a token. | |
static Base | getBase (StringRef IntegerLiteral) |
template<typename T> | |
void | forEachToken (const UnwrappedLine &Line, const T &Call, FormatToken *Parent=nullptr) |
bool | matchFilePath (StringRef Pattern, StringRef FilePath) |
bool | matchFilePath (llvm::StringRef Pattern, llvm::StringRef FilePath) |
const FormatToken * | getNamespaceToken (const AnnotatedLine *Line, const SmallVectorImpl< AnnotatedLine * > &AnnotatedLines) |
StringRef | getNamespaceTokenText (const AnnotatedLine *Line, const SmallVectorImpl< AnnotatedLine * > &AnnotatedLines) |
static bool | isNumericLiteralCaseFixerNeeded (const FormatStyle &Style) |
static std::string | transformComponent (StringRef Component, FormatStyle::NumericLiteralComponentStyle ConfigValue) |
static bool | matchesReservedSuffix (StringRef Suffix) |
Test if Suffix matches a C++ literal reserved by the library. | |
static std::string | format (StringRef NumericLiteral, const FormatStyle &Style) |
void | addQualifierAlignmentFixerPasses (const FormatStyle &Style, SmallVectorImpl< AnalyzerPass > &Passes) |
static void | replaceToken (const SourceManager &SourceMgr, tooling::Replacements &Fixes, const CharSourceRange &Range, std::string NewText) |
static void | removeToken (const SourceManager &SourceMgr, tooling::Replacements &Fixes, const FormatToken *First) |
static void | insertQualifierAfter (const SourceManager &SourceMgr, tooling::Replacements &Fixes, const FormatToken *First, const std::string &Qualifier) |
static void | insertQualifierBefore (const SourceManager &SourceMgr, tooling::Replacements &Fixes, const FormatToken *First, const std::string &Qualifier) |
static bool | endsWithSpace (const std::string &s) |
static bool | startsWithSpace (const std::string &s) |
static void | rotateTokens (const SourceManager &SourceMgr, tooling::Replacements &Fixes, const FormatToken *First, const FormatToken *Last, bool Left) |
static bool | isConfiguredQualifier (const FormatToken *const Tok, const std::vector< tok::TokenKind > &Qualifiers) |
static bool | isQualifier (const FormatToken *const Tok) |
void | prepareLeftRightOrderingForQualifierAlignmentFixer (const std::vector< std::string > &Order, std::vector< std::string > &LeftOrder, std::vector< std::string > &RightOrder, std::vector< tok::TokenKind > &Qualifiers) |
bool | isQualifierOrType (const FormatToken *Tok, const LangOptions &LangOpts) |
bool | isConfiguredQualifierOrType (const FormatToken *Tok, const std::vector< tok::TokenKind > &Qualifiers, const LangOptions &LangOpts) |
bool | isPossibleMacro (const FormatToken *Tok) |
bool | operator< (const JsModuleReference &LHS, const JsModuleReference &RHS) |
tooling::Replacements | sortJavaScriptImports (const FormatStyle &Style, StringRef Code, ArrayRef< tooling::Range > Ranges, StringRef FileName) |
static bool | mustBreakAfterAttributes (const FormatToken &Tok, const FormatStyle &Style) |
static unsigned | maxNestingDepth (const AnnotatedLine &Line) |
static FormatToken * | getFunctionName (const AnnotatedLine &Line, FormatToken *&OpeningParen) |
static bool | isCtorOrDtorName (const FormatToken *Tok) |
static bool | isFunctionDeclarationName (const LangOptions &LangOpts, const FormatToken &Current, const AnnotatedLine &Line, FormatToken *&ClosingParen) |
static bool | isAllmanBrace (const FormatToken &Tok) |
static bool | IsFunctionArgument (const FormatToken &Tok) |
static bool | isEmptyLambdaAllowed (const FormatToken &Tok, FormatStyle::ShortLambdaStyle ShortLambdaOption) |
static bool | isAllmanLambdaBrace (const FormatToken &Tok) |
static auto | computeNewlines (const AnnotatedLine &Line, const AnnotatedLine *PreviousLine, const AnnotatedLine *PrevPrevLine, const SmallVectorImpl< AnnotatedLine * > &Lines, const FormatStyle &Style) |
std::ostream & | operator<< (std::ostream &Stream, const UnwrappedLine &Line) |
template<class T> | |
static void | hash_combine (std::size_t &seed, const T &v) |
static bool | isGoogScope (const UnwrappedLine &Line) |
static bool | isIIFE (const UnwrappedLine &Line, const AdditionalKeywords &Keywords) |
static bool | ShouldBreakBeforeBrace (const FormatStyle &Style, const FormatToken &InitialToken) |
static bool | tokenCanStartNewLine (const FormatToken &Tok) |
static bool | mustBeJSIdent (const AdditionalKeywords &Keywords, const FormatToken *FormatTok) |
static bool | mustBeJSIdentOrValue (const AdditionalKeywords &Keywords, const FormatToken *FormatTok) |
static bool | isJSDeclOrStmt (const AdditionalKeywords &Keywords, const FormatToken *FormatTok) |
static bool | isC78Type (const FormatToken &Tok) |
static bool | isC78ParameterDecl (const FormatToken *Tok, const FormatToken *Next, const FormatToken *FuncName) |
static FormatToken * | getLastNonComment (const UnwrappedLine &Line) |
static void | markOptionalBraces (FormatToken *LeftBrace) |
static bool | continuesLineCommentSection (const FormatToken &FormatTok, const UnwrappedLine &Line, const FormatStyle &Style, const llvm::Regex &CommentPragmasRegex) |
template<typename F> | |
static void | AlignTokenSequence (const FormatStyle &Style, unsigned Start, unsigned End, unsigned Column, bool RightJustify, F &&Matches, SmallVector< WhitespaceManager::Change, 16 > &Changes) |
template<typename F> | |
static unsigned | AlignTokens (const FormatStyle &Style, F &&Matches, SmallVector< WhitespaceManager::Change, 16 > &Changes, unsigned StartAt, const FormatStyle::AlignConsecutiveStyle &ACS={}, bool RightJustify=false) |
static void | AlignMatchingTokenSequence (unsigned &StartOfSequence, unsigned &EndOfSequence, unsigned &MinColumn, std::function< bool(const WhitespaceManager::Change &C)> Matches, SmallVector< WhitespaceManager::Change, 16 > &Changes) |
Variables | |
const char * | StyleOptionHelpDescription |
const char * | DefaultFormatStyle = "file" |
const char * | DefaultFallbackStyle = "LLVM" |
static SmallVector< StringRef > | CppNonKeywordTypes |
typedef std::function<std::pair<tooling::Replacements, unsigned>( const Environment &)> clang::format::AnalyzerPass |
Definition at line 25 of file QualifierAlignmentFixer.h.
|
strong |
Enumerator | |
---|---|
Binary | |
Decimal | |
Hex | |
Other |
Definition at line 20 of file IntegerLiteralSeparatorFixer.cpp.
Enumerator | |
---|---|
BK_Unknown | |
BK_Block | |
BK_BracedInit |
Definition at line 226 of file FormatToken.h.
Enumerator | |
---|---|
FD_Unformatted | |
FD_Continue | |
FD_Break |
Definition at line 231 of file FormatToken.h.
Enumerator | |
---|---|
NORMAL | |
TEMPLATE_STRING | |
TOKEN_STASHED |
Definition at line 29 of file FormatTokenLexer.h.
Definition at line 23 of file TokenAnnotator.h.
Roles a token can take in a configured macro expansion.
Definition at line 234 of file FormatToken.h.
Enumerator | |
---|---|
PPK_BinPacked | |
PPK_OnePerLine | |
PPK_Inconclusive |
Definition at line 229 of file FormatToken.h.
|
strong |
Enumerator | |
---|---|
ST_Class | |
ST_CompoundRequirement | |
ST_Other |
Definition at line 40 of file TokenAnnotator.h.
enum clang::format::TokenType : uint8_t |
Determines the semantic type of a syntactic token, e.g.
whether "<" is a template opener or binary operator.
Enumerator | |
---|---|
NUM_TOKEN_TYPES |
Definition at line 215 of file FormatToken.h.
void clang::format::addQualifierAlignmentFixerPasses | ( | const FormatStyle & | Style, |
SmallVectorImpl< AnalyzerPass > & | Passes ) |
Definition at line 25 of file QualifierAlignmentFixer.cpp.
References prepareLeftRightOrderingForQualifierAlignmentFixer(), and clang::format::TokenAnalyzer::process().
Referenced by clang::format::internal::reformat().
|
static |
Definition at line 3221 of file Format.cpp.
Referenced by sortCppIncludes(), and sortJavaImports().
|
static |
Definition at line 701 of file WhitespaceManager.cpp.
References clang::C, std::function, and NewlinesBefore.
|
static |
Definition at line 528 of file WhitespaceManager.cpp.
|
static |
Definition at line 287 of file WhitespaceManager.cpp.
References BK_BracedInit, clang::Column, NewlinesBefore, Previous, and Tok.
|
staticconstexpr |
Referenced by clang::format::BreakableBlockComment::adaptStartOfLine(), clang::format::BreakableLineCommentSection::BreakableLineCommentSection(), getCommentSplit(), clang::format::BreakableBlockComment::getContentIndent(), clang::format::BreakableBlockComment::getReflowSplit(), clang::format::BreakableLineCommentSection::getReflowSplit(), clang::format::BreakableBlockComment::getSplitAfterLastLine(), getStringSplit(), clang::format::BreakableBlockComment::introducesBreakBeforeToken(), clang::format::BreakableBlockComment::mayReflow(), mayReflowContent(), and clang::format::BreakableBlockComment::reflow().
tooling::Replacements clang::format::cleanup | ( | const FormatStyle & | Style, |
StringRef | Code, | ||
ArrayRef< tooling::Range > | Ranges, | ||
StringRef | FileName ) |
Definition at line 4065 of file Format.cpp.
References clang::FileName, and clang::format::Environment::make().
Referenced by cleanupAroundReplacements().
Expected< tooling::Replacements > clang::format::cleanupAroundReplacements | ( | StringRef | Code, |
const tooling::Replacements & | Replaces, | ||
const FormatStyle & | Style ) |
Definition at line 3838 of file Format.cpp.
References cleanup(), clang::FileName, and processReplacements().
Referenced by clang::tooling::applyAtomicChanges().
bool clang::format::closesBlockOrBlockTypeList | ( | const FormatStyle & | Style | ) | const |
Same as opensBlockOrBlockTypeList, but for the closing token.
Definition at line 870 of file FormatToken.h.
|
static |
Definition at line 158 of file FormatToken.cpp.
References clang::format::FormatToken::ColumnWidth, and clang::format::FormatToken::TotalLength.
Referenced by clang::CommaSeparatedList::precomputeFormattingInfos().
|
static |
Definition at line 1528 of file UnwrappedLineFormatter.cpp.
References clang::format::AnnotatedLine::endsWith(), clang::format::AnnotatedLine::First, getNamespaceToken(), clang::format::AnnotatedLine::InPPDirective, clang::format::FormatToken::is(), clang::format::FormatToken::isNot(), clang::format::FormatToken::isOneOf(), clang::format::AnnotatedLine::Last, clang::Line, Newlines, clang::format::AnnotatedLine::startsWith(), and clang::format::AnnotatedLine::startsWithNamespace().
std::string clang::format::configurationAsText | ( | const FormatStyle & | Style | ) |
Definition at line 2236 of file Format.cpp.
References expandPresetsBraceWrapping(), expandPresetsSpaceBeforeParens(), expandPresetsSpacesInParens(), and clang::Text.
|
static |
Definition at line 4641 of file UnwrappedLineParser.cpp.
References clang::continuesLineComment(), continuesLineCommentSection(), clang::format::FormatToken::is(), clang::isLineComment(), clang::Line, clang::format::FormatToken::NewlinesBefore, clang::format::UnwrappedLineNode::Tok, and clang::format::FormatToken::TokenText.
Referenced by continuesLineCommentSection().
void clang::format::copyFrom | ( | const FormatToken & | Tok | ) |
Definition at line 891 of file FormatToken.h.
|
static |
Count the length of leading whitespace in a token.
Definition at line 1199 of file FormatTokenLexer.cpp.
References clang::isHorizontalWhitespace(), clang::isVerticalWhitespace(), clang::isWhitespace(), and clang::Text.
|
static |
Definition at line 100 of file QualifierAlignmentFixer.cpp.
References s.
Referenced by rotateTokens().
|
static |
Definition at line 1415 of file Format.cpp.
Referenced by configurationAsText(), and clang::format::internal::reformat().
|
static |
Definition at line 1515 of file Format.cpp.
Referenced by configurationAsText(), and clang::format::internal::reformat().
|
static |
Definition at line 1539 of file Format.cpp.
Referenced by configurationAsText(), and clang::format::internal::reformat().
|
static |
Definition at line 3241 of file Format.cpp.
References clang::Text.
Referenced by sortCppIncludes().
|
static |
Definition at line 3522 of file Format.cpp.
Referenced by sortJavaImports().
tooling::Replacements clang::format::fixNamespaceEndComments | ( | const FormatStyle & | Style, |
StringRef | Code, | ||
ArrayRef< tooling::Range > | Ranges, | ||
StringRef | FileName ) |
Definition at line 4087 of file Format.cpp.
References clang::FileName, clang::format::Environment::make(), and clang::format::TokenAnalyzer::process().
void clang::format::forEachToken | ( | const UnwrappedLine & | Line, |
const T & | Call, | ||
FormatToken * | Parent = nullptr ) |
Definition at line 32 of file MacroCallReconstructor.cpp.
References clang::Call, clang::First, forEachToken(), clang::Line, and clang::T.
Referenced by clang::format::MacroCallReconstructor::addLine(), and forEachToken().
|
static |
Definition at line 78 of file NumericLiteralCaseFixer.cpp.
References clang::format::NumericLiteralInfo::BaseLetterPos, clang::format::NumericLiteralInfo::ExponentLetterPos, format(), matchesReservedSuffix(), clang::format::NumericLiteralInfo::SuffixPos, and transformComponent().
Referenced by format(), and clang::format::NumericLiteralCaseFixer::process().
Expected< tooling::Replacements > clang::format::formatReplacements | ( | StringRef | Code, |
const tooling::Replacements & | Replaces, | ||
const FormatStyle & | Style ) |
Definition at line 3726 of file Format.cpp.
References clang::FileName, processReplacements(), reformat(), clang::SortIncludes, and sortIncludes().
Referenced by clang::tooling::formatAndApplyAllReplacements().
|
static |
Definition at line 22 of file IntegerLiteralSeparatorFixer.cpp.
References Binary, Decimal, Hex, and Other.
Referenced by clang::format::IntegerLiteralSeparatorFixer::process().
|
static |
Definition at line 196 of file ContinuationIndenter.cpp.
FormatStyle clang::format::getChromiumStyle | ( | FormatStyle::LanguageKind | Language | ) |
Definition at line 1926 of file Format.cpp.
References getGoogleStyle(), and clang::tooling::IncludeStyle::IBS_Preserve.
Referenced by getPredefinedStyle().
FormatStyle clang::format::getClangFormatStyle | ( | ) |
Definition at line 2079 of file Format.cpp.
References getLLVMStyle().
Referenced by getPredefinedStyle().
|
static |
Definition at line 56 of file BreakableToken.cpp.
References Blanks(), clang::format::encoding::columnWidthWithTabs(), clang::format::encoding::getCodePointNumBytes(), clang::TabWidth, and clang::Text.
Referenced by clang::format::BreakableBlockComment::getSplit(), and clang::format::BreakableComment::getSplit().
|
static |
Definition at line 2401 of file ContinuationIndenter.cpp.
References Tok.
LangOptions clang::format::getFormattingLangOpts | ( | const FormatStyle & | Style | ) |
Definition at line 4107 of file Format.cpp.
Referenced by clang::format::IntegerLiteralSeparatorFixer::process(), clang::format::NumericLiteralCaseFixer::process(), clang::format::TokenAnalyzer::TokenAnalyzer(), clang::format::TokenAnnotator::TokenAnnotator(), and clang::format::UnwrappedLineParser::UnwrappedLineParser().
|
static |
Definition at line 3651 of file TokenAnnotator.cpp.
References clang::Line, and Tok.
Referenced by clang::format::TokenAnnotator::annotate().
FormatStyle clang::format::getGNUStyle | ( | ) |
Definition at line 2035 of file Format.cpp.
References getLLVMStyle().
Referenced by getPredefinedStyle().
FormatStyle clang::format::getGoogleStyle | ( | FormatStyle::LanguageKind | Language | ) |
Definition at line 1780 of file Format.cpp.
References getGoogleStyle(), getLLVMStyle(), clang::tooling::IncludeStyle::IBS_Preserve, and clang::tooling::IncludeStyle::IBS_Regroup.
Referenced by getChromiumStyle(), getGoogleStyle(), and getPredefinedStyle().
|
static |
Definition at line 4209 of file Format.cpp.
References clang::format::Environment::getFileID(), clang::format::Environment::getSourceManager(), clang::Lexer::LexFromRawLexer(), clang::Lexer::SetCommentRetentionState(), clang::Text, and Tok.
Referenced by guessLanguage().
|
static |
Definition at line 4165 of file Format.cpp.
References clang::FileName.
Referenced by guessLanguage().
|
static |
Definition at line 2169 of file ContinuationIndenter.cpp.
References clang::format::encoding::columnWidthWithTabs(), clang::TabWidth, and clang::Text.
|
static |
Definition at line 2781 of file UnwrappedLineParser.cpp.
References getLastNonComment(), clang::Token::isNot(), and clang::Line.
Referenced by getLastNonComment().
|
static |
Definition at line 49 of file ContinuationIndenter.cpp.
References clang::format::FormatToken::CanBreakBefore, clang::format::FormatToken::isOneOf(), clang::format::FormatToken::MatchingParen, clang::format::FormatToken::Next, Tok, and clang::format::FormatToken::TotalLength.
Referenced by clang::format::ContinuationIndenter::mustBreak().
|
static |
Definition at line 119 of file ContinuationIndenter.cpp.
References Tok.
Referenced by clang::format::ContinuationIndenter::mustBreak().
|
static |
Definition at line 30 of file BreakableToken.cpp.
Referenced by clang::format::BreakableLineCommentSection::BreakableLineCommentSection().
FormatStyle clang::format::getLLVMStyle | ( | FormatStyle::LanguageKind | Language | ) |
Definition at line 1547 of file Format.cpp.
References clang::prec::Assignment, clang::tooling::IncludeStyle::IBS_Preserve, and clang::prec::Relational.
Referenced by getClangFormatStyle(), getGNUStyle(), getGoogleStyle(), getMicrosoftStyle(), getMozillaStyle(), getNoStyle(), getPredefinedStyle(), getStyle(), getWebKitStyle(), guessLanguage(), and clang::format::RawStringFormatStyleManager::RawStringFormatStyleManager().
FormatStyle clang::format::getMicrosoftStyle | ( | FormatStyle::LanguageKind | Language | ) |
Definition at line 2050 of file Format.cpp.
References getLLVMStyle().
Referenced by getPredefinedStyle().
FormatStyle clang::format::getMozillaStyle | ( | ) |
Definition at line 1985 of file Format.cpp.
References getLLVMStyle().
Referenced by getPredefinedStyle().
const FormatToken * clang::format::getNamespaceToken | ( | ) | const |
Return the actual namespace token, if this token starts a namespace block.
Definition at line 878 of file FormatToken.h.
Referenced by clang::format::NamespaceEndCommentsFixer::analyze(), computeNewlines(), and getNamespaceTokenText().
const FormatToken * clang::format::getNamespaceToken | ( | const AnnotatedLine * | Line, |
const SmallVectorImpl< AnnotatedLine * > & | AnnotatedLines ) |
Definition at line 248 of file NamespaceEndCommentsFixer.cpp.
References clang::format::FormatToken::is(), clang::format::UnwrappedLine::kInvalidIndex, and clang::Line.
StringRef clang::format::getNamespaceTokenText | ( | const AnnotatedLine * | Line, |
const SmallVectorImpl< AnnotatedLine * > & | AnnotatedLines ) |
Definition at line 271 of file NamespaceEndCommentsFixer.cpp.
References getNamespaceToken(), clang::Line, and clang::format::FormatToken::TokenText.
Referenced by clang::format::NamespaceEndCommentsFixer::analyze().
|
nodiscard |
Returns the next token ignoring comments.
Definition at line 842 of file FormatToken.h.
References Tok.
FormatStyle clang::format::getNoStyle | ( | ) |
Definition at line 2093 of file Format.cpp.
References getLLVMStyle().
Referenced by getPredefinedStyle(), and getStyle().
const std::error_category & clang::format::getParseCategory | ( | ) |
bool clang::format::getPredefinedStyle | ( | StringRef | Name, |
FormatStyle::LanguageKind | Language, | ||
FormatStyle * | Style ) |
Definition at line 2101 of file Format.cpp.
References getChromiumStyle(), getClangFormatStyle(), getGNUStyle(), getGoogleStyle(), getLLVMStyle(), getMicrosoftStyle(), getMozillaStyle(), getNoStyle(), and getWebKitStyle().
Referenced by getStyle(), and clang::format::RawStringFormatStyleManager::RawStringFormatStyleManager().
struct clang::format::FormatToken clang::format::getPreviousNonComment | ( | ) | const |
Returns the previous token ignoring comments.
Definition at line 223 of file FormatToken.h.
References LIST_TOKEN_TYPES, and NUM_TOKEN_TYPES.
|
static |
Definition at line 170 of file ContinuationIndenter.cpp.
References TokenText.
|
static |
Definition at line 158 of file BreakableToken.cpp.
References Blanks(), clang::format::encoding::columnWidthWithTabs(), clang::format::encoding::getCodePointNumBytes(), clang::format::encoding::getEscapeSequenceLength(), clang::isAlphanumeric(), clang::TabWidth, and clang::Text.
Referenced by clang::format::BreakableStringLiteral::getSplit().
Expected< FormatStyle > clang::format::getStyle | ( | StringRef | StyleName, |
StringRef | FileName, | ||
StringRef | FallbackStyleName, | ||
StringRef | Code, | ||
llvm::vfs::FileSystem * | FS, | ||
bool | AllowUnknownOptions, | ||
llvm::SourceMgr::DiagHandlerTy | DiagHandler ) |
Definition at line 4282 of file Format.cpp.
References clang::FileName, getLanguageName(), getLLVMStyle(), getNoStyle(), getPredefinedStyle(), guessLanguage(), loadAndParseConfigFile(), make_string_error(), parseConfiguration(), clang::Text, and Unsuitable.
Referenced by clang::tooling::formatAndApplyAllReplacements().
const char * clang::format::getTokenTypeName | ( | TokenType | Type | ) |
Determines the name of a token type.
Definition at line 23 of file FormatToken.cpp.
References LIST_TOKEN_TYPES, NUM_TOKEN_TYPES, and TokNames.
FormatStyle clang::format::getWebKitStyle | ( | ) |
Definition at line 2011 of file Format.cpp.
References getLLVMStyle().
Referenced by getPredefinedStyle().
FormatStyle::LanguageKind clang::format::guessLanguage | ( | StringRef | FileName, |
StringRef | Code ) |
Definition at line 4238 of file Format.cpp.
References clang::FileName, getLanguageByComment(), getLanguageByFileName(), and getLLVMStyle().
Referenced by getStyle().
Definition at line 660 of file UnwrappedLineParser.cpp.
References clang::T.
|
static |
Definition at line 1602 of file ContinuationIndenter.cpp.
References clang::format::FormatToken::is(), and Previous.
|
static |
Definition at line 74 of file QualifierAlignmentFixer.cpp.
References clang::First, clang::CharSourceRange::getCharRange(), and replaceToken().
Referenced by clang::format::LeftRightQualifierAlignmentFixer::analyzeRight().
|
static |
Definition at line 87 of file QualifierAlignmentFixer.cpp.
References clang::First, clang::CharSourceRange::getCharRange(), and replaceToken().
Referenced by clang::format::LeftRightQualifierAlignmentFixer::analyzeLeft().
|
static |
Definition at line 132 of file ContinuationIndenter.cpp.
References clang::prec::Conditional, clang::Token::is(), and clang::prec::PointerToMember.
Referenced by mustBreakBinaryOperation(), and startsNextOperand().
|
static |
Definition at line 5591 of file TokenAnnotator.cpp.
|
static |
Definition at line 5609 of file TokenAnnotator.cpp.
|
nodiscard |
Returns true
if this token ends a block indented initializer list.
Definition at line 54 of file FormatToken.cpp.
References BK_BracedInit, clang::format::FormatToken::is(), and MatchingParen.
|
static |
Definition at line 1311 of file UnwrappedLineParser.cpp.
References isC78ParameterDecl(), isC78Type(), clang::format::FormatToken::isNot(), Next, clang::format::FormatToken::Previous, and Tok.
Referenced by isC78ParameterDecl().
|
static |
Definition at line 1298 of file UnwrappedLineParser.cpp.
References isC78Type(), and Tok.
Referenced by isC78ParameterDecl(), and isC78Type().
bool clang::format::isClangFormatOff | ( | StringRef | Comment | ) |
Definition at line 4467 of file Format.cpp.
References isClangFormatOnOff().
Referenced by clang::format::IntegerLiteralSeparatorFixer::process(), clang::format::NumericLiteralCaseFixer::process(), clang::format::TokenAnnotator::setCommentLineLevels(), sortCppIncludes(), and sortJavaImports().
bool clang::format::isClangFormatOn | ( | StringRef | Comment | ) |
Definition at line 4463 of file Format.cpp.
References isClangFormatOnOff().
Referenced by clang::format::JavaScriptImportSorter::analyze(), clang::format::IntegerLiteralSeparatorFixer::process(), clang::format::NumericLiteralCaseFixer::process(), sortCppIncludes(), and sortJavaImports().
Definition at line 4451 of file Format.cpp.
Referenced by isClangFormatOff(), and isClangFormatOn().
|
static |
Definition at line 155 of file QualifierAlignmentFixer.cpp.
References Tok.
Referenced by clang::format::LeftRightQualifierAlignmentFixer::analyzeLeft(), and isConfiguredQualifierOrType().
bool clang::format::isConfiguredQualifierOrType | ( | const FormatToken * | Tok, |
const std::vector< tok::TokenKind > & | Qualifiers, | ||
const LangOptions & | LangOpts ) |
Definition at line 628 of file QualifierAlignmentFixer.cpp.
References isConfiguredQualifier(), and Tok.
Referenced by clang::format::LeftRightQualifierAlignmentFixer::analyzeLeft().
Returns whether the token is the left square bracket of a C++ structured binding declaration.
Definition at line 858 of file FormatToken.h.
|
static |
Definition at line 3711 of file TokenAnnotator.cpp.
References Tok.
Referenced by clang::format::TokenAnnotator::annotate().
|
static |
Definition at line 5604 of file TokenAnnotator.cpp.
References Tok.
|
static |
Definition at line 5597 of file TokenAnnotator.cpp.
References Tok.
|
static |
Definition at line 3787 of file TokenAnnotator.cpp.
References clang::Token::getIdentifierInfo(), clang::format::FormatToken::is(), clang::format::FormatToken::isNot(), clang::Line, clang::format::FormatToken::NestingLevel, clang::format::FormatToken::Next, Next, Previous, clang::format::FormatToken::Tok, and Tok.
Referenced by clang::format::TokenAnnotator::calculateFormattingInformation().
|
static |
Definition at line 914 of file UnwrappedLineParser.cpp.
References isGoogScope(), and clang::Line.
Referenced by isGoogScope().
|
static |
Definition at line 932 of file UnwrappedLineParser.cpp.
References isIIFE(), clang::AdditionalKeywords::kw_function, and clang::Line.
Referenced by isIIFE().
|
static |
Definition at line 1278 of file UnwrappedLineParser.cpp.
References isJSDeclOrStmt(), clang::format::FormatToken::isOneOf(), clang::AdditionalKeywords::kw_async, clang::AdditionalKeywords::kw_finally, clang::AdditionalKeywords::kw_function, clang::AdditionalKeywords::kw_import, clang::AdditionalKeywords::kw_let, clang::AdditionalKeywords::kw_var, and clang::AdditionalKeywords::kw_yield.
Referenced by isJSDeclOrStmt().
bool clang::format::isLikelyXml | ( | StringRef | Code | ) |
Definition at line 3683 of file Format.cpp.
Referenced by clang::format::internal::reformat(), and sortIncludes().
bool clang::format::isMpegTS | ( | StringRef | Code | ) |
Definition at line 3676 of file Format.cpp.
Referenced by clang::format::internal::reformat(), and sortIncludes().
|
static |
Definition at line 25 of file NumericLiteralCaseFixer.cpp.
Referenced by clang::format::NumericLiteralCaseFixer::process().
bool clang::format::isPossibleMacro | ( | const FormatToken * | Tok | ) |
Definition at line 637 of file QualifierAlignmentFixer.cpp.
References Next, clang::Text, and Tok.
Referenced by clang::format::LeftRightQualifierAlignmentFixer::analyzeLeft(), and clang::format::LeftRightQualifierAlignmentFixer::analyzeRight().
|
static |
Definition at line 160 of file QualifierAlignmentFixer.cpp.
References Tok.
Referenced by clang::format::LeftRightQualifierAlignmentFixer::analyzeLeft(), clang::format::LeftRightQualifierAlignmentFixer::analyzeRight(), and isQualifierOrType().
bool clang::format::isQualifierOrType | ( | const FormatToken * | Tok, |
const LangOptions & | LangOpts ) |
Definition at line 623 of file QualifierAlignmentFixer.cpp.
References isQualifier(), and Tok.
Referenced by clang::format::LeftRightQualifierAlignmentFixer::analyzeRight().
|
static |
Definition at line 789 of file FormatTokenLexer.cpp.
llvm::ErrorOr< std::unique_ptr< llvm::MemoryBuffer > > clang::format::loadAndParseConfigFile | ( | StringRef | ConfigFile, |
llvm::vfs::FileSystem * | FS, | ||
FormatStyle * | Style, | ||
bool | AllowUnknownOptions, | ||
llvm::SourceMgr::DiagHandlerTy | DiagHandler, | ||
bool | IsDotHFile ) |
Definition at line 4266 of file Format.cpp.
References parseConfiguration(), and clang::Text.
Referenced by getStyle().
std::error_code clang::format::make_error_code | ( | ParseError | e | ) |
Definition at line 1380 of file Format.cpp.
References getParseCategory().
Referenced by parseConfiguration().
|
inline |
Definition at line 1384 of file Format.cpp.
Referenced by getStyle().
|
static |
Definition at line 2831 of file UnwrappedLineParser.cpp.
References clang::format::FormatToken::is(), markOptionalBraces(), clang::format::FormatToken::MatchingParen, and clang::format::FormatToken::Optional.
Referenced by markOptionalBraces().
|
static |
Test if Suffix matches a C++ literal reserved by the library.
Matches against all suffixes reserved in the C++23 standard.
Definition at line 62 of file NumericLiteralCaseFixer.cpp.
Referenced by format().
bool clang::format::matchFilePath | ( | llvm::StringRef | Pattern, |
llvm::StringRef | FilePath ) |
bool clang::format::matchFilePath | ( | StringRef | Pattern, |
StringRef | FilePath ) |
Definition at line 24 of file MatchFilePath.cpp.
References clang::C, clang::Match, and matchFilePath().
Referenced by matchFilePath().
|
static |
Definition at line 3642 of file TokenAnnotator.cpp.
References clang::Line, clang::Result, and Tok.
Referenced by clang::format::TokenAnnotator::annotate().
|
static |
Definition at line 437 of file BreakableToken.cpp.
References Blanks(), and clang::isPunctuation().
Referenced by clang::format::BreakableBlockComment::mayReflow(), and clang::format::BreakableLineCommentSection::mayReflow().
|
static |
Definition at line 1254 of file UnwrappedLineParser.cpp.
References clang::Token::getIdentifierInfo(), clang::format::FormatToken::is(), clang::format::FormatToken::isOneOf(), clang::AdditionalKeywords::kw_abstract, clang::AdditionalKeywords::kw_as, clang::AdditionalKeywords::kw_async, clang::AdditionalKeywords::kw_await, clang::AdditionalKeywords::kw_extends, clang::AdditionalKeywords::kw_finally, clang::AdditionalKeywords::kw_from, clang::AdditionalKeywords::kw_function, clang::AdditionalKeywords::kw_implements, clang::AdditionalKeywords::kw_import, clang::AdditionalKeywords::kw_in, clang::AdditionalKeywords::kw_instanceof, clang::AdditionalKeywords::kw_interface, clang::AdditionalKeywords::kw_is, clang::AdditionalKeywords::kw_let, clang::AdditionalKeywords::kw_of, clang::AdditionalKeywords::kw_override, clang::AdditionalKeywords::kw_throws, clang::AdditionalKeywords::kw_var, clang::AdditionalKeywords::kw_yield, mustBeJSIdent(), and clang::format::FormatToken::Tok.
Referenced by mustBeJSIdent(), and mustBeJSIdentOrValue().
|
static |
Definition at line 1269 of file UnwrappedLineParser.cpp.
References clang::Token::isLiteral(), clang::format::FormatToken::isOneOf(), mustBeJSIdent(), mustBeJSIdentOrValue(), and clang::format::FormatToken::Tok.
Referenced by mustBeJSIdentOrValue().
|
static |
Definition at line 26 of file TokenAnnotator.cpp.
References Tok.
Referenced by clang::format::TokenAnnotator::calculateFormattingInformation().
|
static |
Definition at line 148 of file ContinuationIndenter.cpp.
References clang::format::FormatToken::CanBreakBefore, isAlignableBinaryOperator(), and startsNextOperand().
|
nodiscard |
Returns true
if this tokens starts a block-type list, i.e. a list that should be indented with a block indent.
Definition at line 69 of file FormatToken.cpp.
References BK_Block, BK_BracedInit, clang::format::FormatToken::getBlockKind(), clang::format::FormatToken::is(), and NestingLevel.
|
static |
Definition at line 157 of file ContinuationIndenter.cpp.
References clang::format::FormatToken::is(), clang::format::FormatToken::isNot(), clang::format::FormatToken::NestingLevel, and clang::format::FormatToken::Previous.
Referenced by clang::format::ContinuationIndenter::mustBreak().
bool clang::format::operator< | ( | const JsModuleReference & | LHS, |
const JsModuleReference & | RHS ) |
Definition at line 101 of file SortJavaScriptImports.cpp.
References clang::format::JsModuleReference::ALIAS, clang::format::JsModuleReference::Category, clang::format::JsModuleReference::IsExport, clang::format::JsModuleReference::Prefix, clang::format::JsModuleReference::SIDE_EFFECT, and clang::format::JsModuleReference::URL.
std::ostream & clang::format::operator<< | ( | std::ostream & | Stream, |
const UnwrappedLine & | Line ) |
Definition at line 90 of file UnwrappedLineParser.cpp.
References clang::Line.
std::error_code clang::format::parseConfiguration | ( | llvm::MemoryBufferRef | Config, |
FormatStyle * | Style, | ||
bool | AllowUnknownOptions, | ||
llvm::SourceMgr::DiagHandlerTy | DiagHandler, | ||
void * | DiagHandlerCtxt, | ||
bool | IsDotHFile ) |
Definition at line 2162 of file Format.cpp.
References BinPackTrailingCommaConflict, Error, make_error_code(), Success, Unsuitable, and validateQualifierOrder().
Referenced by getStyle(), loadAndParseConfigFile(), and parseConfiguration().
void clang::format::prepareLeftRightOrderingForQualifierAlignmentFixer | ( | const std::vector< std::string > & | Order, |
std::vector< std::string > & | LeftOrder, | ||
std::vector< std::string > & | RightOrder, | ||
std::vector< tok::TokenKind > & | Qualifiers ) |
Definition at line 589 of file QualifierAlignmentFixer.cpp.
References clang::format::LeftRightQualifierAlignmentFixer::getTokenFromQualifier(), and s.
Referenced by addQualifierAlignmentFixerPasses().
|
static |
Definition at line 3707 of file Format.cpp.
References clang::tooling::Replacements::begin(), clang::tooling::Replacements::empty(), clang::FileName, clang::tooling::Replacements::getAffectedRanges(), clang::tooling::Replacements::merge(), and clang::T.
Referenced by cleanupAroundReplacements(), and formatReplacements().
tooling::Replacements clang::format::reformat | ( | const FormatStyle & | Style, |
StringRef | Code, | ||
ArrayRef< tooling::Range > | Ranges, | ||
StringRef | FileName, | ||
bool * | IncompleteFormat ) |
Definition at line 4077 of file Format.cpp.
References clang::FileName, reformat(), and clang::Result.
tooling::Replacements clang::format::reformat | ( | const FormatStyle & | Style, |
StringRef | Code, | ||
ArrayRef< tooling::Range > | Ranges, | ||
StringRef | FileName, | ||
FormattingAttemptStatus * | Status ) |
Definition at line 4054 of file Format.cpp.
References clang::FileName, and clang::format::internal::reformat().
Referenced by clang::tooling::applyAtomicChanges(), formatReplacements(), and reformat().
|
static |
Definition at line 66 of file QualifierAlignmentFixer.cpp.
References clang::First, clang::CharSourceRange::getCharRange(), and replaceToken().
Referenced by clang::format::LeftRightQualifierAlignmentFixer::analyzeLeft().
std::string clang::format::replaceCRLF | ( | const std::string & | Code | ) |
Definition at line 3262 of file Format.cpp.
Referenced by sortCppIncludes(), and sortJavaImports().
|
static |
Definition at line 54 of file QualifierAlignmentFixer.cpp.
References clang::tooling::Replacements::add().
Referenced by clang::format::LeftRightQualifierAlignmentFixer::analyzeRight(), insertQualifierAfter(), insertQualifierBefore(), removeToken(), and rotateTokens().
|
static |
Definition at line 112 of file QualifierAlignmentFixer.cpp.
References endsWithSpace(), clang::First, clang::CharSourceRange::getCharRange(), clang::Last, replaceToken(), startsWithSpace(), and Tok.
Referenced by clang::format::LeftRightQualifierAlignmentFixer::analyzeLeft(), and clang::format::LeftRightQualifierAlignmentFixer::analyzeRight().
|
static |
Definition at line 950 of file UnwrappedLineParser.cpp.
References clang::Token::getKind(), clang::format::FormatToken::is(), ShouldBreakBeforeBrace(), and clang::format::FormatToken::Tok.
Referenced by ShouldBreakBeforeBrace().
|
static |
Definition at line 34 of file ContinuationIndenter.cpp.
References LT_ObjCMethodDecl.
|
static |
Definition at line 41 of file ContinuationIndenter.cpp.
References clang::prec::Assignment, Previous, and Tok.
|
static |
Definition at line 3290 of file Format.cpp.
References clang::tooling::Replacements::add(), affectsRange(), clang::FileName, FindCursorIndex(), clang::tooling::IncludeStyle::IBS_Preserve, clang::tooling::IncludeStyle::IBS_Regroup, replaceCRLF(), and toString().
Referenced by sortCppIncludes(), and sortIncludes().
tooling::Replacements clang::format::sortCppIncludes | ( | const FormatStyle & | Style, |
StringRef | Code, | ||
ArrayRef< tooling::Range > | Ranges, | ||
StringRef | FileName, | ||
tooling::Replacements & | Replaces, | ||
unsigned * | Cursor ) |
Definition at line 3399 of file Format.cpp.
References clang::FileName, clang::tooling::IncludeCategoryManager::getIncludePriority(), clang::tooling::IncludeCategoryManager::getSortIncludePriority(), clang::tooling::IncludeStyle::IBS_Merge, clang::tooling::IncludeStyle::IBS_Regroup, clang::tooling::HeaderIncludes::IncludeRegex, isClangFormatOff(), isClangFormatOn(), clang::Line, clang::ast_matchers::match(), and sortCppIncludes().
tooling::Replacements clang::format::sortIncludes | ( | const FormatStyle & | Style, |
StringRef | Code, | ||
ArrayRef< tooling::Range > | Ranges, | ||
StringRef | FileName, | ||
unsigned * | Cursor ) |
Definition at line 3685 of file Format.cpp.
References clang::FileName, isLikelyXml(), isMpegTS(), sortCppIncludes(), sortJavaImports(), and sortJavaScriptImports().
Referenced by clang::tooling::applyAtomicChanges(), and formatReplacements().
|
static |
Definition at line 3542 of file Format.cpp.
References clang::tooling::Replacements::add(), affectsRange(), clang::FileName, findJavaImportGroup(), clang::JavaImportGroups, replaceCRLF(), and toString().
Referenced by sortIncludes(), and sortJavaImports().
tooling::Replacements clang::format::sortJavaImports | ( | const FormatStyle & | Style, |
StringRef | Code, | ||
ArrayRef< tooling::Range > | Ranges, | ||
StringRef | FileName, | ||
tooling::Replacements & | Replaces ) |
Definition at line 3624 of file Format.cpp.
References clang::FileName, isClangFormatOff(), isClangFormatOn(), clang::Line, sortJavaImports(), and clang::Static.
tooling::Replacements clang::format::sortJavaScriptImports | ( | const FormatStyle & | Style, |
StringRef | Code, | ||
ArrayRef< tooling::Range > | Ranges, | ||
StringRef | FileName ) |
Definition at line 586 of file SortJavaScriptImports.cpp.
References clang::FileName, clang::format::Environment::make(), and clang::format::TokenAnalyzer::process().
Referenced by sortIncludes().
tooling::Replacements clang::format::sortUsingDeclarations | ( | const FormatStyle & | Style, |
StringRef | Code, | ||
ArrayRef< tooling::Range > | Ranges, | ||
StringRef | FileName ) |
Definition at line 4097 of file Format.cpp.
References clang::FileName, clang::format::Environment::make(), and clang::format::TokenAnalyzer::process().
|
static |
Definition at line 141 of file ContinuationIndenter.cpp.
References isAlignableBinaryOperator(), clang::format::FormatToken::Previous, and Previous.
Referenced by mustBreakBinaryOperation().
bool clang::format::startsNextParameter | ( | const FormatToken & | Current, |
const FormatStyle & | Style ) |
Definition at line 323 of file FormatToken.cpp.
References clang::format::FormatToken::is(), clang::format::FormatToken::Previous, and Previous.
Referenced by clang::format::ContinuationIndenter::mustBreak().
|
static |
Definition at line 127 of file ContinuationIndenter.cpp.
References Tok.
Referenced by clang::format::ContinuationIndenter::mustBreak().
|
static |
Definition at line 106 of file QualifierAlignmentFixer.cpp.
References s.
Referenced by rotateTokens().
bool clang::format::switchesFormatting | ( | const FormatToken & | Token | ) |
Checks if Token
switches formatting, like /* clang-format off */.
Token
must be a comment.
Definition at line 206 of file BreakableToken.cpp.
References clang::Token::is().
Referenced by clang::format::BreakableLineCommentSection::BreakableLineCommentSection(), clang::format::BreakableBlockComment::mayReflow(), and clang::format::BreakableLineCommentSection::mayReflow().
|
static |
Definition at line 1233 of file UnwrappedLineParser.cpp.
References Tok, and tokenCanStartNewLine().
Referenced by tokenCanStartNewLine().
|
static |
Definition at line 47 of file NumericLiteralCaseFixer.cpp.
Referenced by format().
ParseError clang::format::validateQualifierOrder | ( | FormatStyle * | Style | ) |
Definition at line 2130 of file Format.cpp.
References DuplicateQualifierSpecified, clang::format::LeftRightQualifierAlignmentFixer::getTokenFromQualifier(), InvalidQualifierSpecified, MissingQualifierOrder, MissingQualifierType, and Success.
Referenced by parseConfiguration().
|
static |
Definition at line 37 of file FormatToken.cpp.
const char* clang::format::DefaultFallbackStyle = "LLVM" |
Definition at line 4263 of file Format.cpp.
const char* clang::format::DefaultFormatStyle = "file" |
Definition at line 4261 of file Format.cpp.
const char* clang::format::StyleOptionHelpDescription |
Definition at line 4150 of file Format.cpp.