clang 22.0.0git
|
This file implements functions declared in Format.h. More...
#include "clang/Format/Format.h"
#include "DefinitionBlockSeparator.h"
#include "IntegerLiteralSeparatorFixer.h"
#include "NamespaceEndCommentsFixer.h"
#include "NumericLiteralCaseFixer.h"
#include "ObjCPropertyAttributeOrderFixer.h"
#include "QualifierAlignmentFixer.h"
#include "SortJavaScriptImports.h"
#include "UnwrappedLineFormatter.h"
#include "UsingDeclarationsSorter.h"
#include "clang/Tooling/Inclusions/HeaderIncludes.h"
#include "llvm/ADT/Sequence.h"
#include <limits>
Go to the source code of this file.
Namespaces | |
namespace | llvm |
Diagnostic wrappers for TextAPI types for error reporting. | |
namespace | llvm::yaml |
namespace | clang |
The JSON file list parser is used to communicate input to InstallAPI. | |
namespace | clang::format |
namespace | clang::format::internal |
Macros | |
#define | DEBUG_TYPE "format-formatter" |
Functions | |
const std::error_category & | clang::format::getParseCategory () |
std::error_code | clang::format::make_error_code (ParseError e) |
llvm::Error | clang::format::make_string_error (const Twine &Message) |
static void | clang::format::expandPresetsBraceWrapping (FormatStyle &Expanded) |
static void | clang::format::expandPresetsSpaceBeforeParens (FormatStyle &Expanded) |
static void | clang::format::expandPresetsSpacesInParens (FormatStyle &Expanded) |
FormatStyle | clang::format::getLLVMStyle (FormatStyle::LanguageKind Language) |
FormatStyle | clang::format::getGoogleStyle (FormatStyle::LanguageKind Language) |
FormatStyle | clang::format::getChromiumStyle (FormatStyle::LanguageKind Language) |
FormatStyle | clang::format::getMozillaStyle () |
FormatStyle | clang::format::getWebKitStyle () |
FormatStyle | clang::format::getGNUStyle () |
FormatStyle | clang::format::getMicrosoftStyle (FormatStyle::LanguageKind Language) |
FormatStyle | clang::format::getClangFormatStyle () |
FormatStyle | clang::format::getNoStyle () |
bool | clang::format::getPredefinedStyle (StringRef Name, FormatStyle::LanguageKind Language, FormatStyle *Style) |
ParseError | clang::format::validateQualifierOrder (FormatStyle *Style) |
std::error_code | clang::format::parseConfiguration (llvm::MemoryBufferRef Config, FormatStyle *Style, bool AllowUnknownOptions, llvm::SourceMgr::DiagHandlerTy DiagHandler, void *DiagHandlerCtxt, bool IsDotHFile) |
std::string | clang::format::configurationAsText (const FormatStyle &Style) |
static bool | clang::format::affectsRange (ArrayRef< tooling::Range > Ranges, unsigned Start, unsigned End) |
static std::pair< unsigned, unsigned > | clang::format::FindCursorIndex (const ArrayRef< IncludeDirective > &Includes, const ArrayRef< unsigned > &Indices, unsigned Cursor) |
std::string | clang::format::replaceCRLF (const std::string &Code) |
static void | clang::format::sortCppIncludes (const FormatStyle &Style, const ArrayRef< IncludeDirective > &Includes, ArrayRef< tooling::Range > Ranges, StringRef FileName, StringRef Code, tooling::Replacements &Replaces, unsigned *Cursor) |
tooling::Replacements | clang::format::sortCppIncludes (const FormatStyle &Style, StringRef Code, ArrayRef< tooling::Range > Ranges, StringRef FileName, tooling::Replacements &Replaces, unsigned *Cursor) |
static unsigned | clang::format::findJavaImportGroup (const FormatStyle &Style, StringRef ImportIdentifier) |
static void | clang::format::sortJavaImports (const FormatStyle &Style, const ArrayRef< JavaImportDirective > &Imports, ArrayRef< tooling::Range > Ranges, StringRef FileName, StringRef Code, tooling::Replacements &Replaces) |
tooling::Replacements | clang::format::sortJavaImports (const FormatStyle &Style, StringRef Code, ArrayRef< tooling::Range > Ranges, StringRef FileName, tooling::Replacements &Replaces) |
bool | clang::format::isMpegTS (StringRef Code) |
bool | clang::format::isLikelyXml (StringRef Code) |
tooling::Replacements | clang::format::sortIncludes (const FormatStyle &Style, StringRef Code, ArrayRef< tooling::Range > Ranges, StringRef FileName, unsigned *Cursor) |
template<typename T> | |
static Expected< tooling::Replacements > | clang::format::processReplacements (T ProcessFunc, StringRef Code, const tooling::Replacements &Replaces, const FormatStyle &Style) |
Expected< tooling::Replacements > | clang::format::formatReplacements (StringRef Code, const tooling::Replacements &Replaces, const FormatStyle &Style) |
Expected< tooling::Replacements > | clang::format::cleanupAroundReplacements (StringRef Code, const tooling::Replacements &Replaces, const FormatStyle &Style) |
std::pair< tooling::Replacements, unsigned > | clang::format::internal::reformat (const FormatStyle &Style, StringRef Code, ArrayRef< tooling::Range > Ranges, unsigned FirstStartColumn, unsigned NextStartColumn, unsigned LastStartColumn, StringRef FileName, FormattingAttemptStatus *Status) |
Reformats the given Ranges in the code fragment Code . | |
tooling::Replacements | clang::format::reformat (const FormatStyle &Style, StringRef Code, ArrayRef< tooling::Range > Ranges, StringRef FileName, FormattingAttemptStatus *Status) |
tooling::Replacements | clang::format::cleanup (const FormatStyle &Style, StringRef Code, ArrayRef< tooling::Range > Ranges, StringRef FileName) |
tooling::Replacements | clang::format::reformat (const FormatStyle &Style, StringRef Code, ArrayRef< tooling::Range > Ranges, StringRef FileName, bool *IncompleteFormat) |
tooling::Replacements | clang::format::fixNamespaceEndComments (const FormatStyle &Style, StringRef Code, ArrayRef< tooling::Range > Ranges, StringRef FileName) |
tooling::Replacements | clang::format::sortUsingDeclarations (const FormatStyle &Style, StringRef Code, ArrayRef< tooling::Range > Ranges, StringRef FileName) |
LangOptions | clang::format::getFormattingLangOpts (const FormatStyle &Style) |
static FormatStyle::LanguageKind | clang::format::getLanguageByFileName (StringRef FileName) |
static FormatStyle::LanguageKind | clang::format::getLanguageByComment (const Environment &Env) |
FormatStyle::LanguageKind | clang::format::guessLanguage (StringRef FileName, StringRef Code) |
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) |
Expected< FormatStyle > | clang::format::getStyle (StringRef StyleName, StringRef FileName, StringRef FallbackStyleName, StringRef Code, llvm::vfs::FileSystem *FS, bool AllowUnknownOptions, llvm::SourceMgr::DiagHandlerTy DiagHandler) |
static bool | clang::format::isClangFormatOnOff (StringRef Comment, bool On) |
bool | clang::format::isClangFormatOn (StringRef Comment) |
bool | clang::format::isClangFormatOff (StringRef Comment) |
Variables | |
const char * | clang::format::StyleOptionHelpDescription |
const char * | clang::format::DefaultFormatStyle = "file" |
const char * | clang::format::DefaultFallbackStyle = "LLVM" |
This file implements functions declared in Format.h.
This will be split into separate files as we go.
Definition in file Format.cpp.
#define DEBUG_TYPE "format-formatter" |
Definition at line 29 of file Format.cpp.