clang  6.0.0svn
Namespaces | Classes | Enumerations | Functions | Variables
clang::format Namespace Reference

Namespaces

 encoding
 

Classes

struct  AdditionalKeywords
 Encapsulates keywords that are context sensitive or for languages not properly supported by Clang's lexer. More...
 
class  AffectedRangeManager
 
class  AnnotatedLine
 
class  BreakableBlockComment
 
class  BreakableComment
 
class  BreakableLineCommentSection
 
class  BreakableSingleLineToken
 Base class for single line tokens that can be broken. More...
 
class  BreakableStringLiteral
 
class  CommaSeparatedList
 
class  CompoundStatementIndenter
 
class  ContinuationIndenter
 
class  Environment
 
struct  FormatStyle
 The FormatStyle is used to configure the formatting to follow specific guidelines. More...
 
struct  FormattingAttemptStatus
 Represents the status of a formatting attempt. More...
 
struct  FormatToken
 A wrapper around a Token storing information about the whitespace characters preceding it. More...
 
class  FormatTokenLexer
 
class  FormatTokenSource
 
class  JavaScriptImportSorter
 
struct  JsImportedSymbol
 
struct  JsModuleReference
 
struct  LineState
 The current state when indenting a unwrapped line. More...
 
class  NamespaceEndCommentsFixer
 
struct  ParenState
 
class  ParseErrorCategory
 
class  ScopedLineState
 
class  TokenAnalyzer
 
class  TokenAnnotator
 Determines extra information about the tokens comprising an UnwrappedLine. More...
 
class  TokenRole
 
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
 
class  UnwrappedLineFormatter
 
struct  UnwrappedLineNode
 
class  UnwrappedLineParser
 
class  UsingDeclarationsSorter
 
class  WhitespaceManager
 Manages the whitespaces around tokens and their replacements. More...
 

Enumerations

enum  ParseError { ParseError::Success = 0, ParseError::Error, ParseError::Unsuitable }
 
enum  TokenType { NUM_TOKEN_TYPES }
 
enum  BraceBlockKind { BK_Unknown, BK_Block, BK_BracedInit }
 
enum  ParameterPackingKind { PPK_BinPacked, PPK_OnePerLine, PPK_Inconclusive }
 
enum  FormatDecision { FD_Unformatted, FD_Continue, FD_Break }
 
enum  LexerState { NORMAL, TEMPLATE_STRING, TOKEN_STASHED }
 
enum  LineType {
  LT_Invalid, LT_ImportStatement, LT_ObjCDecl, LT_ObjCMethodDecl,
  LT_ObjCProperty, LT_Other, LT_PreprocessorDirective, LT_VirtualFunctionDecl
}
 

Functions

const std::error_category & getParseCategory ()
 
std::error_code make_error_code (ParseError e)
 
FormatStyle getLLVMStyle ()
 Returns a format style complying with the LLVM coding standards: http://llvm.org/docs/CodingStandards.html. More...
 
FormatStyle getGoogleStyle (FormatStyle::LanguageKind Language)
 Returns a format style complying with one of Google's style guides: http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml. More...
 
FormatStyle getChromiumStyle (FormatStyle::LanguageKind Language)
 Returns a format style complying with Chromium's style guide: http://www.chromium.org/developers/coding-style. More...
 
FormatStyle getMozillaStyle ()
 Returns a format style complying with Mozilla's style guide: https://developer.mozilla.org/en-US/docs/Developer_Guide/Coding_Style. More...
 
FormatStyle getWebKitStyle ()
 Returns a format style complying with Webkit's style guide: http://www.webkit.org/coding/coding-style.html. More...
 
FormatStyle getGNUStyle ()
 Returns a format style complying with GNU Coding Standards: http://www.gnu.org/prep/standards/standards.html. More...
 
FormatStyle getNoStyle ()
 Returns style indicating formatting should be not applied at all. More...
 
bool getPredefinedStyle (StringRef Name, FormatStyle::LanguageKind Language, FormatStyle *Style)
 Gets a predefined style for the specified language by name. More...
 
std::error_code parseConfiguration (StringRef Text, FormatStyle *Style)
 Parse configuration from YAML-formatted text. More...
 
std::string configurationAsText (const FormatStyle &Style)
 Gets configuration in a YAML string. More...
 
tooling::Replacements sortIncludes (const FormatStyle &Style, StringRef Code, ArrayRef< tooling::Range > Ranges, StringRef FileName, unsigned *Cursor=nullptr)
 Returns the replacements necessary to sort all #include blocks that are affected by Ranges. More...
 
llvm::Expected< tooling::ReplacementsformatReplacements (StringRef Code, const tooling::Replacements &Replaces, const FormatStyle &Style)
 Returns the replacements corresponding to applying and formatting Replaces on success; otheriwse, return an llvm::Error carrying llvm::StringError. More...
 
llvm::Expected< tooling::ReplacementscleanupAroundReplacements (StringRef Code, const tooling::Replacements &Replaces, const FormatStyle &Style)
 Returns the replacements corresponding to applying Replaces and cleaning up the code after that on success; otherwise, return an llvm::Error carrying llvm::StringError. More...
 
tooling::Replacements reformat (const FormatStyle &Style, StringRef Code, ArrayRef< tooling::Range > Ranges, StringRef FileName="<stdin>", FormattingAttemptStatus *Status=nullptr)
 Reformats the given Ranges in Code. More...
 
tooling::Replacements reformat (const FormatStyle &Style, StringRef Code, ArrayRef< tooling::Range > Ranges, StringRef FileName, bool *IncompleteFormat)
 Same as above, except if IncompleteFormat is non-null, its value will be set to true if any of the affected ranges were not formatted due to a non-recoverable syntax error. More...
 
tooling::Replacements cleanup (const FormatStyle &Style, StringRef Code, ArrayRef< tooling::Range > Ranges, StringRef FileName="<stdin>")
 Clean up any erroneous/redundant code in the given Ranges in Code. More...
 
tooling::Replacements fixNamespaceEndComments (const FormatStyle &Style, StringRef Code, ArrayRef< tooling::Range > Ranges, StringRef FileName="<stdin>")
 Fix namespace end comments in the given Ranges in Code. More...
 
tooling::Replacements sortUsingDeclarations (const FormatStyle &Style, StringRef Code, ArrayRef< tooling::Range > Ranges, StringRef FileName="<stdin>")
 Sort consecutive using declarations in the given Ranges in Code. More...
 
LangOptions getFormattingLangOpts (const FormatStyle &Style=getLLVMStyle())
 Returns the LangOpts that the formatter expects you to set. More...
 
llvm::Expected< FormatStylegetStyle (StringRef StyleName, StringRef FileName, StringRef FallbackStyle, StringRef Code="", vfs::FileSystem *FS=nullptr)
 Construct a FormatStyle based on StyleName. More...
 
StringRef getLanguageName (FormatStyle::LanguageKind Language)
 
static bool IsBlank (char C)
 
static StringRef getLineCommentIndentPrefix (StringRef Comment)
 
static BreakableToken::Split getCommentSplit (StringRef Text, unsigned ContentStartColumn, unsigned ColumnLimit, unsigned TabWidth, encoding::Encoding Encoding)
 
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. More...
 
static bool mayReflowContent (StringRef Content)
 
virtual ~BreakableToken ()
 
virtual unsigned getLineCount () const =0
 Returns the number of lines in this token in the original code. More...
 
virtual unsigned getLineLengthAfterSplit (unsigned LineIndex, unsigned TailOffset, StringRef::size_type Length) const =0
 Returns the number of columns required to format the piece of line at LineIndex, from byte offset TailOffset with length Length. More...
 
virtual Split getSplit (unsigned LineIndex, unsigned TailOffset, unsigned ColumnLimit, llvm::Regex &CommentPragmasRegex) const =0
 Returns a range (offset, length) at which to break the line at LineIndex, if previously broken at TailOffset. More...
 
virtual void insertBreak (unsigned LineIndex, unsigned TailOffset, Split Split, WhitespaceManager &Whitespaces)=0
 Emits the previously retrieved Split via Whitespaces. More...
 
unsigned getLineLengthAfterCompression (unsigned RemainingTokenColumns, Split Split) const
 Returns the number of columns required to format the piece of line at LineIndex, from byte offset TailOffset after the whitespace range Split has been compressed into a single space. More...
 
virtual void compressWhitespace (unsigned LineIndex, unsigned TailOffset, Split Split, WhitespaceManager &Whitespaces)=0
 Replaces the whitespace range described by Split with a single space. More...
 
virtual Split getSplitBefore (unsigned LineIndex, unsigned PreviousEndColumn, unsigned ColumnLimit, llvm::Regex &CommentPragmasRegex) const
 Returns a whitespace range (offset, length) of the content at LineIndex such that the content preceding this range needs to be reformatted before any breaks are made to this line. More...
 
virtual unsigned getLineLengthAfterSplitBefore (unsigned LineIndex, unsigned TailOffset, unsigned PreviousEndColumn, unsigned ColumnLimit, Split SplitBefore) const
 Returns the number of columns required to format the piece of line at LineIndex after the content preceding the whitespace range specified SplitBefore has been reformatted, but before any breaks are made to this line. More...
 
virtual void replaceWhitespaceBefore (unsigned LineIndex, unsigned PreviousEndColumn, unsigned ColumnLimit, Split SplitBefore, WhitespaceManager &Whitespaces)
 Replaces the whitespace between LineIndex-1 and LineIndex. More...
 
virtual Split getSplitAfterLastLine (unsigned TailOffset, unsigned ColumnLimit) const
 Returns a whitespace range (offset, length) of the content at the last line that needs to be reformatted after the last line has been reformatted. More...
 
virtual unsigned getLineLengthAfterSplitAfterLastLine (unsigned TailOffset, Split SplitAfterLastLine) const
 Returns the number of columns required to format the piece token after the last line after a reformat of the whitespace range SplitAfterLastLine on the last line has been performed. More...
 
virtual void replaceWhitespaceAfterLastLine (unsigned TailOffset, Split SplitAfterLastLine, WhitespaceManager &Whitespaces)
 Replaces the whitespace from SplitAfterLastLine on the last line after the last line has been formatted by performing a reformatting. More...
 
virtual void updateNextToken (LineState &State) const
 Updates the next token of State to the next token after this one. More...
 
 BreakableToken (const FormatToken &Tok, bool InPPDirective, encoding::Encoding Encoding, const FormatStyle &Style)
 
static unsigned getLengthToMatchingParen (const FormatToken &Tok)
 
static unsigned getLengthToNextOperator (const FormatToken &Tok)
 
static bool startsSegmentOfBuilderTypeCall (const FormatToken &Tok)
 
static bool startsNextParameter (const FormatToken &Current, const FormatStyle &Style)
 
static bool opensProtoMessageField (const FormatToken &LessTok, const FormatStyle &Style)
 
llvm::Error make_string_error (const llvm::Twine &Message)
 
static FormatStyle expandPresets (const FormatStyle &Style)
 
static bool affectsRange (ArrayRef< tooling::Range > Ranges, unsigned Start, unsigned End)
 
static std::pair< unsigned, unsigned > FindCursorIndex (const SmallVectorImpl< IncludeDirective > &Includes, const SmallVectorImpl< unsigned > &Indices, unsigned Cursor)
 
static void sortCppIncludes (const FormatStyle &Style, const SmallVectorImpl< IncludeDirective > &Includes, ArrayRef< tooling::Range > Ranges, StringRef FileName, tooling::Replacements &Replaces, unsigned *Cursor)
 
tooling::Replacements sortCppIncludes (const FormatStyle &Style, StringRef Code, ArrayRef< tooling::Range > Ranges, StringRef FileName, tooling::Replacements &Replaces, unsigned *Cursor)
 
bool isMpegTS (StringRef Code)
 
bool isLikelyXml (StringRef Code)
 
template<typename T >
static llvm::Expected< tooling::ReplacementsprocessReplacements (T ProcessFunc, StringRef Code, const tooling::Replacements &Replaces, const FormatStyle &Style)
 
static FormatStyle::LanguageKind getLanguageByFileName (StringRef FileName)
 
const char * getTokenTypeName (TokenType Type)
 Determines the name of a token type. More...
 
static unsigned CodePointsBetween (const FormatToken *Begin, const FormatToken *End)
 
bool operator< (const JsModuleReference &LHS, const JsModuleReference &RHS)
 
tooling::Replacements sortJavaScriptImports (const FormatStyle &Style, StringRef Code, ArrayRef< tooling::Range > Ranges, StringRef FileName)
 
static unsigned maxNestingDepth (const AnnotatedLine &Line)
 
static bool isFunctionDeclarationName (const FormatToken &Current, const AnnotatedLine &Line)
 
static bool isAllmanBrace (const FormatToken &Tok)
 
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 clang::Token &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 LLVM_ATTRIBUTE_UNUSED void printDebugInfo (const UnwrappedLine &Line, StringRef Prefix="")
 
static bool continuesLineCommentSection (const FormatToken &FormatTok, const UnwrappedLine &Line, llvm::Regex &CommentPragmasRegex)
 
template<typename F >
static void AlignTokenSequence (unsigned Start, unsigned End, unsigned Column, 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)
 

Variables

const char * StyleOptionHelpDescription
 Description to be used for help text for a llvm::cl option for specifying format style. More...
 
static const char *const Blanks = " \t\v\f\r"
 
to be on a line of itself
 Base class for strategies on how to break tokens. More...
 
to be on a line of there are analogous operations *that might be executed after the last line has been reformatted
 
to be on a line of there are analogous operations *that might be executed after the last line has been for finding a split after the last line that needs *to be reflown
 
to be on a line of there are analogous operations *that might be executed after the last line has been for finding a split after the last line that needs *to be * getLineLengthAfterSplitAfterLastLine
 
to be on a line of there are analogous operations *that might be executed after the last line has been for finding a split after the last line that needs *to be for calculating the line length in *columns of the remainder of the token
 
to be on a line of there are analogous operations *that might be executed after the last line has been for finding a split after the last line that needs *to be for calculating the line length in *columns of the remainder of the andreplaceWhitespaceAfterLastLine
 
const FormatTokenTok
 
const bool InPPDirective
 
const encoding::Encoding Encoding
 
const FormatStyleStyle
 

Enumeration Type Documentation

◆ BraceBlockKind

Enumerator
BK_Unknown 
BK_Block 
BK_BracedInit 

Definition at line 108 of file FormatToken.h.

◆ FormatDecision

Enumerator
FD_Unformatted 
FD_Continue 
FD_Break 

Definition at line 113 of file FormatToken.h.

◆ LexerState

Enumerator
NORMAL 
TEMPLATE_STRING 
TOKEN_STASHED 

Definition at line 31 of file FormatTokenLexer.h.

◆ LineType

Enumerator
LT_Invalid 
LT_ImportStatement 
LT_ObjCDecl 
LT_ObjCMethodDecl 
LT_ObjCProperty 
LT_Other 
LT_PreprocessorDirective 
LT_VirtualFunctionDecl 

Definition at line 27 of file TokenAnnotator.h.

◆ ParameterPackingKind

Enumerator
PPK_BinPacked 
PPK_OnePerLine 
PPK_Inconclusive 

Definition at line 111 of file FormatToken.h.

◆ ParseError

Enumerator
Success 
Error 
Unsuitable 

Definition at line 35 of file Format.h.

◆ TokenType

Enumerator
NUM_TOKEN_TYPES 

Definition at line 97 of file FormatToken.h.

Function Documentation

◆ affectsRange()

static bool clang::format::affectsRange ( ArrayRef< tooling::Range Ranges,
unsigned  Start,
unsigned  End 
)
static

Definition at line 1324 of file Format.cpp.

◆ AlignTokens()

template<typename F >
static unsigned clang::format::AlignTokens ( const FormatStyle Style,
F &&  Matches,
SmallVector< WhitespaceManager::Change, 16 > &  Changes,
unsigned  StartAt 
)
static

Definition at line 318 of file WhitespaceManager.cpp.

◆ AlignTokenSequence()

template<typename F >
static void clang::format::AlignTokenSequence ( unsigned  Start,
unsigned  End,
unsigned  Column,
F &&  Matches,
SmallVector< WhitespaceManager::Change, 16 > &  Changes 
)
static

Definition at line 229 of file WhitespaceManager.cpp.

◆ BreakableToken()

clang::format::BreakableToken ( const FormatToken Tok,
bool  InPPDirective,
encoding::Encoding  Encoding,
const FormatStyle Style 
)
protected

Definition at line 196 of file BreakableToken.h.

◆ cleanup()

tooling::Replacements clang::format::cleanup ( const FormatStyle Style,
StringRef  Code,
ArrayRef< tooling::Range Ranges,
StringRef  FileName = "<stdin>" 
)

◆ cleanupAroundReplacements()

llvm::Expected< tooling::Replacements > clang::format::cleanupAroundReplacements ( StringRef  Code,
const tooling::Replacements Replaces,
const FormatStyle Style 
)

Returns the replacements corresponding to applying Replaces and cleaning up the code after that on success; otherwise, return an llvm::Error carrying llvm::StringError.

This also supports inserting/deleting C++ #include directives:

  • If a replacement has offset UINT_MAX, length 0, and a replacement text that is an #include directive, this will insert the #include into the correct block in the Code. When searching for points to insert new header, this ignores #include's after the #include block(s) in the beginning of a file to avoid inserting headers into code sections where new #include's should not be added by default. These code sections include:
    • raw string literals (containing #include).
    • if blocks.
    • Special #include's among declarations (e.g. functions).
  • If a replacement has offset UINT_MAX, length 1, and a replacement text that is the name of the header to be removed, the header will be removed from Code if it exists.

Definition at line 1893 of file Format.cpp.

Referenced by clang::tooling::applyAtomicChanges().

◆ CodePointsBetween()

static unsigned clang::format::CodePointsBetween ( const FormatToken Begin,
const FormatToken End 
)
static

◆ compressWhitespace()

virtual void clang::format::compressWhitespace ( unsigned  LineIndex,
unsigned  TailOffset,
Split  Split,
WhitespaceManager Whitespaces 
)
pure virtual

Replaces the whitespace range described by Split with a single space.

◆ configurationAsText()

std::string clang::format::configurationAsText ( const FormatStyle Style)

Gets configuration in a YAML string.

Definition at line 879 of file Format.cpp.

◆ continuesLineCommentSection()

static bool clang::format::continuesLineCommentSection ( const FormatToken FormatTok,
const UnwrappedLine Line,
llvm::Regex &  CommentPragmasRegex 
)
static

◆ expandPresets()

static FormatStyle clang::format::expandPresets ( const FormatStyle Style)
static

Definition at line 504 of file Format.cpp.

◆ FindCursorIndex()

static std::pair<unsigned, unsigned> clang::format::FindCursorIndex ( const SmallVectorImpl< IncludeDirective > &  Includes,
const SmallVectorImpl< unsigned > &  Indices,
unsigned  Cursor 
)
static

Definition at line 1342 of file Format.cpp.

References End, Text, and UINT_MAX.

◆ fixNamespaceEndComments()

tooling::Replacements clang::format::fixNamespaceEndComments ( const FormatStyle Style,
StringRef  Code,
ArrayRef< tooling::Range Ranges,
StringRef  FileName = "<stdin>" 
)

Fix namespace end comments in the given Ranges in Code.

Returns the Replacements that fix the namespace comments in all Ranges in Code.

Definition at line 1990 of file Format.cpp.

◆ formatReplacements()

llvm::Expected< tooling::Replacements > clang::format::formatReplacements ( StringRef  Code,
const tooling::Replacements Replaces,
const FormatStyle Style 
)

Returns the replacements corresponding to applying and formatting Replaces on success; otheriwse, return an llvm::Error carrying llvm::StringError.

Definition at line 1596 of file Format.cpp.

◆ getChromiumStyle()

FormatStyle clang::format::getChromiumStyle ( FormatStyle::LanguageKind  Language)

◆ getCommentSplit()

static BreakableToken::Split clang::format::getCommentSplit ( StringRef  Text,
unsigned  ContentStartColumn,
unsigned  ColumnLimit,
unsigned  TabWidth,
encoding::Encoding  Encoding 
)
static

◆ getFormattingLangOpts()

LangOptions clang::format::getFormattingLangOpts ( const FormatStyle Style = getLLVMStyle())

Returns the LangOpts that the formatter expects you to set.

Parameters
Styledetermines specific settings for lexing mode.

Definition at line 2010 of file Format.cpp.

Referenced by clang::format::FormatTokenLexer::FormatTokenLexer().

◆ getGNUStyle()

FormatStyle clang::format::getGNUStyle ( )

Returns a format style complying with GNU Coding Standards: http://www.gnu.org/prep/standards/standards.html.

Definition at line 786 of file Format.cpp.

Referenced by clang::format::FormatStyle::operator==().

◆ getGoogleStyle()

FormatStyle clang::format::getGoogleStyle ( FormatStyle::LanguageKind  Language)

Returns a format style complying with one of Google's style guides: http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml.

http://google-styleguide.googlecode.com/svn/trunk/javascriptguide.xml. https://developers.google.com/protocol-buffers/docs/style.

Definition at line 650 of file Format.cpp.

References clang::format::FormatStyle::AccessModifierOffset, clang::format::FormatStyle::AlignAfterOpenBracket, clang::format::FormatStyle::AlignEscapedNewlines, clang::format::FormatStyle::AlignOperands, clang::format::FormatStyle::AlignTrailingComments, clang::format::FormatStyle::AllowShortFunctionsOnASingleLine, clang::format::FormatStyle::AllowShortIfStatementsOnASingleLine, clang::format::FormatStyle::AllowShortLoopsOnASingleLine, clang::format::FormatStyle::AlwaysBreakBeforeMultilineStrings, clang::format::FormatStyle::AlwaysBreakTemplateDeclarations, clang::format::FormatStyle::BreakBeforeBinaryOperators, clang::format::FormatStyle::BreakBeforeTernaryOperators, clang::format::FormatStyle::ColumnLimit, clang::format::FormatStyle::CommentPragmas, clang::format::FormatStyle::ConstructorInitializerAllOnOneLineOrOnePerLine, clang::format::FormatStyle::DerivePointerAlignment, getLLVMStyle(), clang::format::FormatStyle::IncludeCategories, clang::format::FormatStyle::IncludeIsMainRegex, clang::format::FormatStyle::IndentCaseLabels, clang::format::FormatStyle::JavaScriptQuotes, clang::format::FormatStyle::JavaScriptWrapImports, clang::format::FormatStyle::KeepEmptyLinesAtTheStartOfBlocks, clang::format::FormatStyle::Language, clang::format::FormatStyle::MaxEmptyLinesToKeep, clang::format::FormatStyle::NamespaceIndentation, clang::format::FormatStyle::ObjCSpaceAfterProperty, clang::format::FormatStyle::ObjCSpaceBeforeProtocolList, clang::format::FormatStyle::PenaltyBreakBeforeFirstCallParameter, clang::format::FormatStyle::PenaltyReturnTypeOnItsOwnLine, clang::format::FormatStyle::PointerAlignment, clang::format::FormatStyle::SpaceAfterCStyleCast, clang::format::FormatStyle::SpacesBeforeTrailingComments, clang::format::FormatStyle::SpacesInContainerLiterals, and clang::format::FormatStyle::Standard.

Referenced by getChromiumStyle(), and clang::format::FormatStyle::operator==().

◆ getLanguageByFileName()

static FormatStyle::LanguageKind clang::format::getLanguageByFileName ( StringRef  FileName)
static

Definition at line 2038 of file Format.cpp.

◆ getLanguageName()

StringRef clang::format::getLanguageName ( FormatStyle::LanguageKind  Language)
inline

Definition at line 1799 of file Format.h.

Referenced by clang::format::TokenAnalyzer::TokenAnalyzer().

◆ getLengthToMatchingParen()

static unsigned clang::format::getLengthToMatchingParen ( const FormatToken Tok)
static

◆ getLengthToNextOperator()

static unsigned clang::format::getLengthToNextOperator ( const FormatToken Tok)
static

◆ getLineCommentIndentPrefix()

static StringRef clang::format::getLineCommentIndentPrefix ( StringRef  Comment)
static

◆ getLineCount()

virtual unsigned clang::format::getLineCount ( ) const
pure virtual

Returns the number of lines in this token in the original code.

Referenced by getLineLengthAfterSplitAfterLastLine(), replaceWhitespaceAfterLastLine(), and ~BreakableToken().

◆ getLineLengthAfterCompression()

unsigned clang::format::BreakableToken::getLineLengthAfterCompression ( unsigned  RemainingTokenColumns,
Split  Split 
) const

Returns the number of columns required to format the piece of line at LineIndex, from byte offset TailOffset after the whitespace range Split has been compressed into a single space.

Definition at line 168 of file BreakableToken.cpp.

◆ getLineLengthAfterSplit()

virtual unsigned clang::format::getLineLengthAfterSplit ( unsigned  LineIndex,
unsigned  TailOffset,
StringRef::size_type  Length 
) const
pure virtual

Returns the number of columns required to format the piece of line at LineIndex, from byte offset TailOffset with length Length.

Note that previous breaks are not taken into account. TailOffset is always specified from the start of the (original) line. Length can be set to StringRef::npos, which means "to the end of line".

Referenced by getLineLengthAfterSplitAfterLastLine(), getLineLengthAfterSplitBefore(), and ~BreakableToken().

◆ getLineLengthAfterSplitAfterLastLine()

virtual unsigned clang::format::getLineLengthAfterSplitAfterLastLine ( unsigned  TailOffset,
Split  SplitAfterLastLine 
) const
virtual

Returns the number of columns required to format the piece token after the last line after a reformat of the whitespace range SplitAfterLastLine on the last line has been performed.

Definition at line 173 of file BreakableToken.h.

References getLineCount(), and getLineLengthAfterSplit().

◆ getLineLengthAfterSplitBefore()

virtual unsigned clang::format::getLineLengthAfterSplitBefore ( unsigned  LineIndex,
unsigned  TailOffset,
unsigned  PreviousEndColumn,
unsigned  ColumnLimit,
Split  SplitBefore 
) const
virtual

Returns the number of columns required to format the piece of line at LineIndex after the content preceding the whitespace range specified SplitBefore has been reformatted, but before any breaks are made to this line.

Definition at line 142 of file BreakableToken.h.

References getLineLengthAfterSplit().

◆ getLLVMStyle()

FormatStyle clang::format::getLLVMStyle ( )

Returns a format style complying with the LLVM coding standards: http://llvm.org/docs/CodingStandards.html.

Definition at line 557 of file Format.cpp.

References clang::format::FormatStyle::AccessModifierOffset, clang::format::FormatStyle::AlignAfterOpenBracket, clang::format::FormatStyle::AlignConsecutiveAssignments, clang::format::FormatStyle::AlignConsecutiveDeclarations, clang::format::FormatStyle::AlignEscapedNewlines, clang::format::FormatStyle::AlignOperands, clang::format::FormatStyle::AlignTrailingComments, clang::format::FormatStyle::AllowAllParametersOfDeclarationOnNextLine, clang::format::FormatStyle::AllowShortBlocksOnASingleLine, clang::format::FormatStyle::AllowShortCaseLabelsOnASingleLine, clang::format::FormatStyle::AllowShortFunctionsOnASingleLine, clang::format::FormatStyle::AllowShortIfStatementsOnASingleLine, clang::format::FormatStyle::AllowShortLoopsOnASingleLine, clang::format::FormatStyle::AlwaysBreakAfterDefinitionReturnType, clang::format::FormatStyle::AlwaysBreakAfterReturnType, clang::format::FormatStyle::AlwaysBreakBeforeMultilineStrings, clang::format::FormatStyle::AlwaysBreakTemplateDeclarations, clang::prec::Assignment, clang::format::FormatStyle::BinPackArguments, clang::format::FormatStyle::BinPackParameters, clang::format::FormatStyle::BraceWrapping, clang::format::FormatStyle::BreakAfterJavaFieldAnnotations, clang::format::FormatStyle::BreakBeforeBinaryOperators, clang::format::FormatStyle::BreakBeforeBraces, clang::format::FormatStyle::BreakBeforeInheritanceComma, clang::format::FormatStyle::BreakBeforeTernaryOperators, clang::format::FormatStyle::BreakConstructorInitializers, clang::format::FormatStyle::BreakStringLiterals, clang::format::FormatStyle::ColumnLimit, clang::format::FormatStyle::CommentPragmas, clang::format::FormatStyle::CompactNamespaces, clang::format::FormatStyle::ConstructorInitializerAllOnOneLineOrOnePerLine, clang::format::FormatStyle::ConstructorInitializerIndentWidth, clang::format::FormatStyle::ContinuationIndentWidth, clang::format::FormatStyle::Cpp11BracedListStyle, clang::format::FormatStyle::DerivePointerAlignment, clang::format::FormatStyle::DisableFormat, clang::format::FormatStyle::ExperimentalAutoDetectBinPacking, clang::format::FormatStyle::FixNamespaceComments, clang::format::FormatStyle::ForEachMacros, clang::format::FormatStyle::IncludeCategories, clang::format::FormatStyle::IncludeIsMainRegex, clang::format::FormatStyle::IndentCaseLabels, clang::format::FormatStyle::IndentPPDirectives, clang::format::FormatStyle::IndentWidth, clang::format::FormatStyle::IndentWrappedFunctionNames, clang::format::FormatStyle::JavaScriptQuotes, clang::format::FormatStyle::JavaScriptWrapImports, clang::format::FormatStyle::KeepEmptyLinesAtTheStartOfBlocks, clang::format::FormatStyle::Language, clang::format::FormatStyle::MaxEmptyLinesToKeep, clang::format::FormatStyle::NamespaceIndentation, clang::format::FormatStyle::ObjCBlockIndentWidth, clang::format::FormatStyle::ObjCSpaceAfterProperty, clang::format::FormatStyle::ObjCSpaceBeforeProtocolList, clang::format::FormatStyle::PenaltyBreakAssignment, clang::format::FormatStyle::PenaltyBreakBeforeFirstCallParameter, clang::format::FormatStyle::PenaltyBreakComment, clang::format::FormatStyle::PenaltyBreakFirstLessLess, clang::format::FormatStyle::PenaltyBreakString, clang::format::FormatStyle::PenaltyExcessCharacter, clang::format::FormatStyle::PenaltyReturnTypeOnItsOwnLine, clang::format::FormatStyle::PointerAlignment, clang::format::FormatStyle::ReflowComments, clang::format::FormatStyle::SortIncludes, clang::format::FormatStyle::SortUsingDeclarations, clang::format::FormatStyle::SpaceAfterCStyleCast, clang::format::FormatStyle::SpaceAfterTemplateKeyword, clang::format::FormatStyle::SpaceBeforeAssignmentOperators, clang::format::FormatStyle::SpaceBeforeParens, clang::format::FormatStyle::SpaceInEmptyParentheses, clang::format::FormatStyle::SpacesBeforeTrailingComments, clang::format::FormatStyle::SpacesInAngles, clang::format::FormatStyle::SpacesInContainerLiterals, clang::format::FormatStyle::SpacesInCStyleCastParentheses, clang::format::FormatStyle::SpacesInParentheses, clang::format::FormatStyle::SpacesInSquareBrackets, clang::format::FormatStyle::Standard, clang::format::FormatStyle::TabWidth, and clang::format::FormatStyle::UseTab.

Referenced by getGoogleStyle(), getMozillaStyle(), getNoStyle(), and clang::format::FormatStyle::operator==().

◆ getMozillaStyle()

FormatStyle clang::format::getMozillaStyle ( )

◆ getNoStyle()

FormatStyle clang::format::getNoStyle ( )

Returns style indicating formatting should be not applied at all.

Definition at line 801 of file Format.cpp.

References clang::format::FormatStyle::DisableFormat, getLLVMStyle(), clang::format::FormatStyle::SortIncludes, and clang::format::FormatStyle::SortUsingDeclarations.

Referenced by clang::format::FormatStyle::operator==().

◆ getParseCategory()

const std::error_category & clang::format::getParseCategory ( )

Definition at line 475 of file Format.cpp.

Referenced by make_error_code().

◆ getPredefinedStyle()

bool clang::format::getPredefinedStyle ( StringRef  Name,
FormatStyle::LanguageKind  Language,
FormatStyle Style 
)

Gets a predefined style for the specified language by name.

Currently supported names: LLVM, Google, Chromium, Mozilla. Names are compared case-insensitively.

Returns true if the Style has been set.

Definition at line 809 of file Format.cpp.

Referenced by clang::format::FormatStyle::operator==().

◆ getSplit()

virtual Split clang::format::getSplit ( unsigned  LineIndex,
unsigned  TailOffset,
unsigned  ColumnLimit,
llvm::Regex &  CommentPragmasRegex 
) const
pure virtual

Returns a range (offset, length) at which to break the line at LineIndex, if previously broken at TailOffset.

If possible, do not violate ColumnLimit.

◆ getSplitAfterLastLine()

virtual Split clang::format::getSplitAfterLastLine ( unsigned  TailOffset,
unsigned  ColumnLimit 
) const
virtual

Returns a whitespace range (offset, length) of the content at the last line that needs to be reformatted after the last line has been reformatted.

A result having offset == StringRef::npos means that no reformat is necessary.

Definition at line 164 of file BreakableToken.h.

◆ getSplitBefore()

virtual Split clang::format::getSplitBefore ( unsigned  LineIndex,
unsigned  PreviousEndColumn,
unsigned  ColumnLimit,
llvm::Regex &  CommentPragmasRegex 
) const
virtual

Returns a whitespace range (offset, length) of the content at LineIndex such that the content preceding this range needs to be reformatted before any breaks are made to this line.

PreviousEndColumn is the end column of the previous line after formatting.

A result having offset == StringRef::npos means that no piece of the line needs to be reformatted before any breaks are made.

Definition at line 132 of file BreakableToken.h.

◆ getStringSplit()

static BreakableToken::Split clang::format::getStringSplit ( StringRef  Text,
unsigned  UsedColumns,
unsigned  ColumnLimit,
unsigned  TabWidth,
encoding::Encoding  Encoding 
)
static

◆ getStyle()

llvm::Expected< FormatStyle > clang::format::getStyle ( StringRef  StyleName,
StringRef  FileName,
StringRef  FallbackStyle,
StringRef  Code = "",
vfs::FileSystem FS = nullptr 
)

Construct a FormatStyle based on StyleName.

StyleName can take several forms:

  • "{<key>: <value>, ...}" - Set specic style parameters.
  • "<style name>" - One of the style names supported by getPredefinedStyle().
  • "file" - Load style configuration from a file called .clang-format located in one of the parent directories of FileName or the current directory if FileName is empty.
Parameters
[in]StyleNameStyle name to interpret according to the description above.
[in]FileNamePath to start search for .clang-format if StyleName == "file".
[in]FallbackStyleThe name of a predefined style used to fallback to in case StyleName is "file" and no file can be found.
[in]CodeThe actual code to be formatted. Used to determine the language if the filename isn't sufficient.
[in]FSThe underlying file system, in which the file resides. By default, the file system is the real file system.
Returns
FormatStyle as specified by StyleName. If StyleName is "file" and no file is found, returns FallbackStyle. If no style could be determined, returns an Error.

Definition at line 2053 of file Format.cpp.

◆ getTokenTypeName()

const char * clang::format::getTokenTypeName ( TokenType  Type)

Determines the name of a token type.

Definition at line 25 of file FormatToken.cpp.

References LIST_TOKEN_TYPES, NUM_TOKEN_TYPES, and TokNames.

◆ getWebKitStyle()

FormatStyle clang::format::getWebKitStyle ( )

Returns a format style complying with Webkit's style guide: http://www.webkit.org/coding/coding-style.html.

Definition at line 766 of file Format.cpp.

Referenced by clang::format::FormatStyle::operator==().

◆ hash_combine()

template<class T >
static void clang::format::hash_combine ( std::size_t seed,
const T &  v 
)
inlinestatic

◆ insertBreak()

virtual void clang::format::insertBreak ( unsigned  LineIndex,
unsigned  TailOffset,
Split  Split,
WhitespaceManager Whitespaces 
)
pure virtual

Emits the previously retrieved Split via Whitespaces.

Referenced by replaceWhitespaceAfterLastLine().

◆ isAllmanBrace()

static bool clang::format::isAllmanBrace ( const FormatToken Tok)
static

◆ IsBlank()

static bool clang::format::IsBlank ( char  C)
static

Definition at line 30 of file BreakableToken.cpp.

Referenced by getStringSplit().

◆ isFunctionDeclarationName()

static bool clang::format::isFunctionDeclarationName ( const FormatToken Current,
const AnnotatedLine Line 
)
static

Definition at line 1784 of file TokenAnnotator.cpp.

◆ isGoogScope()

static bool clang::format::isGoogScope ( const UnwrappedLine Line)
static

Definition at line 541 of file UnwrappedLineParser.cpp.

References clang::format::UnwrappedLine::Tokens.

◆ isIIFE()

static bool clang::format::isIIFE ( const UnwrappedLine Line,
const AdditionalKeywords Keywords 
)
static

Definition at line 559 of file UnwrappedLineParser.cpp.

References clang::format::UnwrappedLine::Tokens.

◆ isJSDeclOrStmt()

static bool clang::format::isJSDeclOrStmt ( const AdditionalKeywords Keywords,
const FormatToken FormatTok 
)
static

◆ isLikelyXml()

bool clang::format::isLikelyXml ( StringRef  Code)

Definition at line 1556 of file Format.cpp.

◆ isMpegTS()

bool clang::format::isMpegTS ( StringRef  Code)

Definition at line 1549 of file Format.cpp.

◆ make_error_code()

std::error_code clang::format::make_error_code ( ParseError  e)

Definition at line 479 of file Format.cpp.

References getParseCategory().

◆ make_string_error()

llvm::Error clang::format::make_string_error ( const llvm::Twine &  Message)
inline

◆ maxNestingDepth()

static unsigned clang::format::maxNestingDepth ( const AnnotatedLine Line)
static

◆ mayReflowContent()

static bool clang::format::mayReflowContent ( StringRef  Content)
static

◆ mustBeJSIdent()

static bool clang::format::mustBeJSIdent ( const AdditionalKeywords Keywords,
const FormatToken FormatTok 
)
static

◆ mustBeJSIdentOrValue()

static bool clang::format::mustBeJSIdentOrValue ( const AdditionalKeywords Keywords,
const FormatToken FormatTok 
)
static

◆ opensProtoMessageField()

static bool clang::format::opensProtoMessageField ( const FormatToken LessTok,
const FormatStyle Style 
)
static

◆ operator<()

bool clang::format::operator< ( const JsModuleReference LHS,
const JsModuleReference RHS 
)

◆ parseConfiguration()

std::error_code clang::format::parseConfiguration ( StringRef  Text,
FormatStyle Style 
)

Parse configuration from YAML-formatted text.

Style->Language is used to get the base style, if the BasedOnStyle option is present.

When BasedOnStyle is not present, options not present in the YAML document, are retained in Style.

Definition at line 833 of file Format.cpp.

◆ printDebugInfo()

static LLVM_ATTRIBUTE_UNUSED void clang::format::printDebugInfo ( const UnwrappedLine Line,
StringRef  Prefix = "" 
)
static

◆ processReplacements()

template<typename T >
static llvm::Expected<tooling::Replacements> clang::format::processReplacements ( ProcessFunc,
StringRef  Code,
const tooling::Replacements Replaces,
const FormatStyle Style 
)
static

Definition at line 1577 of file Format.cpp.

◆ reformat() [1/2]

tooling::Replacements clang::format::reformat ( const FormatStyle Style,
StringRef  Code,
ArrayRef< tooling::Range Ranges,
StringRef  FileName = "<stdin>",
FormattingAttemptStatus Status = nullptr 
)

Reformats the given Ranges in Code.

Each range is extended on either end to its next bigger logic unit, i.e. everything that might influence its formatting or might be influenced by its formatting.

Returns the Replacements necessary to make all Ranges comply with Style.

If Status is non-null, its value will be populated with the status of this formatting attempt. See FormattingAttemptStatus.

Definition at line 1908 of file Format.cpp.

◆ reformat() [2/2]

tooling::Replacements clang::format::reformat ( const FormatStyle Style,
StringRef  Code,
ArrayRef< tooling::Range Ranges,
StringRef  FileName,
bool IncompleteFormat 
)

Same as above, except if IncompleteFormat is non-null, its value will be set to true if any of the affected ranges were not formatted due to a non-recoverable syntax error.

Definition at line 1980 of file Format.cpp.

◆ replaceWhitespaceAfterLastLine()

virtual void clang::format::replaceWhitespaceAfterLastLine ( unsigned  TailOffset,
Split  SplitAfterLastLine,
WhitespaceManager Whitespaces 
)
virtual

Replaces the whitespace from SplitAfterLastLine on the last line after the last line has been formatted by performing a reformatting.

Definition at line 183 of file BreakableToken.h.

References getLineCount(), and insertBreak().

◆ replaceWhitespaceBefore()

virtual void clang::format::replaceWhitespaceBefore ( unsigned  LineIndex,
unsigned  PreviousEndColumn,
unsigned  ColumnLimit,
Split  SplitBefore,
WhitespaceManager Whitespaces 
)
virtual

Replaces the whitespace between LineIndex-1 and LineIndex.

Performs a reformatting of the content at LineIndex preceding the whitespace range SplitBefore.

Definition at line 153 of file BreakableToken.h.

◆ ShouldBreakBeforeBrace()

static bool clang::format::ShouldBreakBeforeBrace ( const FormatStyle Style,
const FormatToken InitialToken 
)
static

◆ sortCppIncludes() [1/2]

static void clang::format::sortCppIncludes ( const FormatStyle Style,
const SmallVectorImpl< IncludeDirective > &  Includes,
ArrayRef< tooling::Range Ranges,
StringRef  FileName,
tooling::Replacements Replaces,
unsigned *  Cursor 
)
static

Definition at line 1369 of file Format.cpp.

◆ sortCppIncludes() [2/2]

tooling::Replacements clang::format::sortCppIncludes ( const FormatStyle Style,
StringRef  Code,
ArrayRef< tooling::Range Ranges,
StringRef  FileName,
tooling::Replacements Replaces,
unsigned *  Cursor 
)

Definition at line 1489 of file Format.cpp.

◆ sortIncludes()

tooling::Replacements clang::format::sortIncludes ( const FormatStyle Style,
StringRef  Code,
ArrayRef< tooling::Range Ranges,
StringRef  FileName,
unsigned *  Cursor = nullptr 
)

Returns the replacements necessary to sort all #include blocks that are affected by Ranges.

Definition at line 1558 of file Format.cpp.

Referenced by clang::tooling::applyAtomicChanges().

◆ sortJavaScriptImports()

tooling::Replacements clang::format::sortJavaScriptImports ( const FormatStyle Style,
StringRef  Code,
ArrayRef< tooling::Range Ranges,
StringRef  FileName 
)

Definition at line 444 of file SortJavaScriptImports.cpp.

◆ sortUsingDeclarations()

tooling::Replacements clang::format::sortUsingDeclarations ( const FormatStyle Style,
StringRef  Code,
ArrayRef< tooling::Range Ranges,
StringRef  FileName = "<stdin>" 
)

Sort consecutive using declarations in the given Ranges in Code.

Returns the Replacements that sort the using declarations in all Ranges in Code.

Definition at line 2000 of file Format.cpp.

◆ startsNextParameter()

static bool clang::format::startsNextParameter ( const FormatToken Current,
const FormatStyle Style 
)
static

Definition at line 53 of file ContinuationIndenter.cpp.

◆ startsSegmentOfBuilderTypeCall()

static bool clang::format::startsSegmentOfBuilderTypeCall ( const FormatToken Tok)
static

◆ switchesFormatting()

*p Token must be a comment *bool clang::format::switchesFormatting ( const FormatToken Token)

◆ tokenCanStartNewLine()

static bool clang::format::tokenCanStartNewLine ( const clang::Token Tok)
static

Definition at line 800 of file UnwrappedLineParser.cpp.

References clang::Token::isNot().

◆ updateNextToken()

virtual void clang::format::updateNextToken ( LineState State) const
virtual

Updates the next token of State to the next token after this one.

This can be used when this token manages a set of underlying tokens as a unit and is responsible for the formatting of the them.

Definition at line 193 of file BreakableToken.h.

◆ ~BreakableToken()

virtual clang::format::~BreakableToken ( )
virtual

Definition at line 85 of file BreakableToken.h.

References getLineCount(), and getLineLengthAfterSplit().

Variable Documentation

◆ Blanks

const char* const clang::format::Blanks = " \t\v\f\r"
static

Definition at line 29 of file BreakableToken.cpp.

◆ Encoding

const encoding::Encoding clang::format::Encoding
protected

◆ getLineLengthAfterSplitAfterLastLine

to be on a line of there are analogous operations* that might be executed after the last line has been for finding a split after the last line that needs* to be * clang::format::getLineLengthAfterSplitAfterLastLine

Definition at line 34 of file BreakableToken.h.

◆ InPPDirective

const bool clang::format::InPPDirective
protected

◆ itself

to be on a line of clang::format::itself

Base class for strategies on how to break tokens.

This is organised around the concept of a Split, which is a whitespace range that signifies a position of the content of a token where a reformatting might be done. Operating with splits is divided into 3 operations:

  • getSplit, for finding a split starting at a position,
  • getLineLengthAfterSplit, for calculating the size in columns of the rest of the content after a split has been used for breaking, and
  • insertBreak, for executing the split using a whitespace manager.

There is a pair of operations that are used to compress a long whitespace range with a single space if that will bring the line lenght under the column limit:

  • getLineLengthAfterCompression, for calculating the size in columns of the line after a whitespace range has been compressed, and
  • compressWhitespace, for executing the whitespace compression using a whitespace manager; note that the compressed whitespace may be in the middle of the original line and of the reformatted line.

For tokens where the whitespace before each line needs to be also reformatted, for example for tokens supporting reflow, there are analogous operations that might be executed before the main line breaking occurs:

  • getSplitBefore, for finding a split such that the content preceding it needs to be specially reflown,
  • getLineLengthAfterSplitBefore, for calculating the line length in columns of the remainder of the content after the beginning of the content has been reformatted, and
  • replaceWhitespaceBefore, for executing the reflow using a whitespace manager.

For tokens that require the whitespace after the last line to be reformatted, for example in multiline jsdoc comments that require the trailing '

Definition at line 34 of file BreakableToken.h.

◆ reflown

to be on a line of there are analogous operations* that might be executed after the last line has been for finding a split after the last line that needs* to be clang::format::reflown

Definition at line 34 of file BreakableToken.h.

◆ reformatted

to be on a line of there are analogous operations* that might be executed after the last line has been clang::format::reformatted

Definition at line 34 of file BreakableToken.h.

◆ replaceWhitespaceAfterLastLine

to be on a line of there are analogous operations* that might be executed after the last line has been for finding a split after the last line that needs* to be for calculating the line length in* columns of the remainder of the and* clang::format::replaceWhitespaceAfterLastLine

Definition at line 34 of file BreakableToken.h.

◆ Style

const FormatStyle& clang::format::Style
protected

◆ StyleOptionHelpDescription

const char * clang::format::StyleOptionHelpDescription
Initial value:
=
"Coding style, currently supports:\n"
" LLVM, Google, Chromium, Mozilla, WebKit.\n"
"Use -style=file to load style configuration from\n"
".clang-format file located in one of the parent\n"
"directories of the source file (or current\n"
"directory for stdin).\n"
"Use -style=\"{key: value, ...}\" to set specific\n"
"parameters, e.g.:\n"
" -style=\"{BasedOnStyle: llvm, IndentWidth: 8}\""

Description to be used for help text for a llvm::cl option for specifying format style.

The description is closely related to the operation of getStyle().

Definition at line 2027 of file Format.cpp.

◆ Tok

const FormatToken& clang::format::Tok
protected

Definition at line 201 of file BreakableToken.h.

Referenced by clang::Sema::ActOnStringLiteral(), AuditedType(), clang::format::BreakableBlockComment::BreakableBlockComment(), clang::format::BreakableLineCommentSection::BreakableLineCommentSection(), clang::CacheTokens(), clang::Preprocessor::CheckEndOfDirective(), compareModuleHeaders(), diagnoseUnknownAttributeSubjectSubRule(), DoPrintMacros(), clang::DoPrintPreprocessedInput(), clang::Preprocessor::EnterMacro(), clang::Preprocessor::EnterToken(), EvaluateDirectiveSubExpr(), EvaluateFeatureLikeBuiltinMacro(), clang::DumpTokensAction::ExecuteAction(), clang::PreprocessOnlyAction::ExecuteAction(), ExpectFeatureIdentifierInfo(), findDirectives(), clang::Lexer::findLocationAfterToken(), clang::Lexer::getBufferLocation(), clang::format::FormatTokenLexer::getKeywords(), clang::ModuleMapParser::getLocation(), clang::MacroInfo::getReplacementToken(), clang::StringLiteralParser::getUDSuffixOffset(), clang::PragmaNamespace::HandlePragma(), clang::Preprocessor::HandlePragmaPoison(), clang::html::HighlightMacros(), isConfigurationPattern(), IsStringPrefix(), clang::format::FormatTokenLexer::lex(), clang::PTHLexer::Lex(), clang::TokenLexer::Lex(), clang::Preprocessor::LexOnOffSwitch(), clang::Preprocessor::LexUnexpandedNonComment(), LocPropertyAttribute(), maxNestingDepth(), clang::format::BreakableBlockComment::mayReflow(), clang::format::BreakableLineCommentSection::mayReflow(), ParseAlignPragma(), parseDeclareSimdClauses(), ParseLoopHintValue(), clang::ModuleMapParser::parseModuleMapFile(), ParseOpenMPDirectiveKind(), clang::Parser::ParseOpenMPParensExpr(), parseOpenMPReductionId(), clang::Parser::ParseOpenMPVarList(), clang::Preprocessor::ParsePragmaPushOrPopMacro(), PragmaLoopHintString(), ReadLineMarkerFlags(), clang::Lexer::ReadToEndOfLine(), clang::ASTReader::ReadToken(), resyncUTF8(), clang::RewriteIncludesInInput(), shouldAddRequirement(), clang::MacroArgs::StringifyArgument(), clang::html::SyntaxHighlight(), clang::format::BreakableComment::tokenAt(), clang::TokenLexer::TokenLexer(), clang::TokenRewriter::TokenRewriter(), UseNSOptionsMacro(), clang::format::WhitespaceManager::WhitespaceManager(), and clang::PTHLexer::~PTHLexer().

◆ token

to be on a line of there are analogous operations* that might be executed after the last line has been for finding a split after the last line that needs* to be for calculating the line length in* columns of the remainder of the clang::format::token