|
clang
3.8.0
|
This file implements functions declared in Format.h. More...
#include "clang/Format/Format.h"#include "ContinuationIndenter.h"#include "TokenAnnotator.h"#include "UnwrappedLineFormatter.h"#include "UnwrappedLineParser.h"#include "WhitespaceManager.h"#include "clang/Basic/Diagnostic.h"#include "clang/Basic/DiagnosticOptions.h"#include "clang/Basic/SourceManager.h"#include "clang/Lex/Lexer.h"#include "llvm/ADT/STLExtras.h"#include "llvm/Support/Allocator.h"#include "llvm/Support/Debug.h"#include "llvm/Support/Path.h"#include "llvm/Support/Regex.h"#include "llvm/Support/YAMLTraits.h"#include <queue>#include <string>Go to the source code of this file.
Namespaces | |
| llvm | |
| DominatorTree GraphTraits specialization so the DominatorTree can be iterable by generic graph iterators. | |
| llvm::yaml | |
| clang | |
| Dataflow Directional Tag Classes. | |
| clang::format | |
Macros | |
| #define | DEBUG_TYPE "format-formatter" |
Functions | |
| const std::error_category & | clang::format::getParseCategory () |
| std::error_code | clang::format::make_error_code (ParseError e) |
| static FormatStyle | clang::format::expandPresets (const FormatStyle &Style) |
| FormatStyle | clang::format::getLLVMStyle () |
| Returns a format style complying with the LLVM coding standards: http://llvm.org/docs/CodingStandards.html. More... | |
| 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. More... | |
| FormatStyle | clang::format::getChromiumStyle (FormatStyle::LanguageKind Language) |
| Returns a format style complying with Chromium's style guide: http://www.chromium.org/developers/coding-style. More... | |
| FormatStyle | clang::format::getMozillaStyle () |
| Returns a format style complying with Mozilla's style guide: https://developer.mozilla.org/en-US/docs/Developer_Guide/Coding_Style. More... | |
| FormatStyle | clang::format::getWebKitStyle () |
| Returns a format style complying with Webkit's style guide: http://www.webkit.org/coding/coding-style.html. More... | |
| FormatStyle | clang::format::getGNUStyle () |
| Returns a format style complying with GNU Coding Standards: http://www.gnu.org/prep/standards/standards.html. More... | |
| FormatStyle | clang::format::getNoStyle () |
| Returns style indicating formatting should be not applied at all. More... | |
| bool | clang::format::getPredefinedStyle (StringRef Name, FormatStyle::LanguageKind Language, FormatStyle *Style) |
| Gets a predefined style for the specified language by name. More... | |
| std::error_code | clang::format::parseConfiguration (StringRef Text, FormatStyle *Style) |
| Parse configuration from YAML-formatted text. More... | |
| std::string | clang::format::configurationAsText (const FormatStyle &Style) |
| Gets configuration in a YAML string. More... | |
| static bool | clang::format::affectsRange (ArrayRef< tooling::Range > Ranges, unsigned Start, unsigned End) |
| static void | clang::format::sortIncludes (const FormatStyle &Style, const SmallVectorImpl< IncludeDirective > &Includes, ArrayRef< tooling::Range > Ranges, StringRef FileName, tooling::Replacements &Replaces, unsigned *Cursor) |
| 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'. More... | |
| tooling::Replacements | clang::format::reformat (const FormatStyle &Style, SourceManager &SourceMgr, FileID ID, ArrayRef< CharSourceRange > Ranges, bool *IncompleteFormat=nullptr) |
Reformats the given Ranges in the file ID. More... | |
| tooling::Replacements | clang::format::reformat (const FormatStyle &Style, StringRef Code, ArrayRef< tooling::Range > Ranges, StringRef FileName="<stdin>", bool *IncompleteFormat=nullptr) |
Reformats the given Ranges in Code. More... | |
| LangOptions | clang::format::getFormattingLangOpts (const FormatStyle &Style=getLLVMStyle()) |
Returns the LangOpts that the formatter expects you to set. More... | |
| static FormatStyle::LanguageKind | clang::format::getLanguageByFileName (StringRef FileName) |
| FormatStyle | clang::format::getStyle (StringRef StyleName, StringRef FileName, StringRef FallbackStyle) |
Construct a FormatStyle based on StyleName. More... | |
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 35 of file Format.cpp.
| llvm::SpecificBumpPtrAllocator<FormatToken> Allocator |
Definition at line 1358 of file Format.cpp.
Referenced by clang::CodeCompletionBuilder::addBriefComment(), and AddObjCKeyValueCompletions().
| bool BinPackInconclusiveFunctions |
Definition at line 1719 of file Format.cpp.
| int Category |
Definition at line 1726 of file Format.cpp.
Referenced by clang::Sema::ActOnPropertyImplDecl(), clang::Sema::ActOnStartCategoryInterface(), AddObjCProperties(), checkAtomicPropertyMismatch(), CheckForIncompatibleAttributes(), clang::Sema::CodeCompleteObjCInterfaceCategory(), clang::Sema::CodeCompleteObjCMethodDecl(), clang::Sema::CodeCompleteObjCPropertyGetter(), clang::Sema::CodeCompleteObjCPropertySetter(), CollectOverriddenMethodsRecurse(), clang::ento::BugReporter::EmitBasicReport(), FindImplementableMethods(), clang::ObjCMethodDecl::findPropertyDecl(), hasWrittenStorageAttribute(), clang::CodeGen::CodeGenModule::isInSanitizerBlacklist(), LookupVisibleDecls(), clang::ento::PathDiagnostic::Profile(), clang::format::sortIncludes(), and clang::ASTNodeImporter::VisitObjCCategoryImplDecl().
| unsigned Column |
Definition at line 1349 of file Format.cpp.
Referenced by clang::ASTUnit::CodeComplete(), clang::createOffloadEntriesAndInfoMetadata(), clang::CodeGen::CodeGenFunction::EmitCheckSourceLocation(), clang::BackendConsumer::EmitOptimizationMessage(), clang::emitTargetOutlinedFunction(), clang::format::CommaSeparatedList::formatAfterToken(), clang::BackendConsumer::InlineAsmDiagHandler2(), clang::format::CommaSeparatedList::precomputeFormattingInfos(), printWordWrapped(), and clang::scanForTargetRegionsFunctions().
| encoding::Encoding Encoding |
Definition at line 1357 of file Format.cpp.
Referenced by clang::format::getCommentSplit(), clang::SourceLocation::getFromRawEncoding(), and clang::format::getStringSplit().
| StringRef Filename |
Definition at line 1723 of file Format.cpp.
Referenced by adjustFilenameForRelocatableAST(), clang::ast_matchers::AST_POLYMORPHIC_MATCHER_P(), clang::FrontendAction::BeginSourceFile(), clang::GenerateModuleAction::BeginSourceFileAction(), clang::ModuleMap::diagnoseHeaderInclusion(), clang::CodeGen::CodeGenFunction::EmitCheckSourceLocation(), clang::BackendConsumer::EmitOptimizationMessage(), EnableCodeCompletion(), EvaluateHasIncludeCommon(), clang::LineEntry::get(), clang::FileManager::getBufferForFile(), clang::SourceManager::getPresumedLoc(), clang::Preprocessor::HandlePragmaDependency(), isSpecialFilename(), clang::HeaderSearch::LookupFile(), MakeCLOutputFilename(), clang::tooling::newFrontendActionFactory(), ParseDirective(), PrintFilename(), clang::serialization::reader::HeaderFileInfoTrait::ReadData(), clang::ASTReader::ReadPath(), clang::format::sortIncludes(), clang::CXXRecordDecl::viewInheritance(), and clang::FixItRewriter::WriteFixedFiles().
| unsigned FirstInLineIndex |
Definition at line 1360 of file Format.cpp.
| SmallVector<IdentifierInfo *, 8> ForEachMacros |
Definition at line 1362 of file Format.cpp.
| bool FormattingDisabled |
Definition at line 1364 of file Format.cpp.
| FormatToken* FormatTok |
Definition at line 1346 of file Format.cpp.
| bool GreaterStashed |
Definition at line 1348 of file Format.cpp.
| FileID ID |
Definition at line 1353 of file Format.cpp.
| IdentifierTable IdentTable |
Definition at line 1355 of file Format.cpp.
| bool IsFirstToken |
Definition at line 1347 of file Format.cpp.
| AdditionalKeywords Keywords |
Definition at line 1356 of file Format.cpp.
| bool LessStashed |
Definition at line 1348 of file Format.cpp.
| std::unique_ptr<Lexer> Lex |
Definition at line 1351 of file Format.cpp.
Referenced by clang::Lexer::LexFromRawLexer().
| llvm::Regex MacroBlockBeginRegex |
Definition at line 1366 of file Format.cpp.
| llvm::Regex MacroBlockEndRegex |
Definition at line 1367 of file Format.cpp.
Definition at line 1725 of file Format.cpp.
| SmallVector<CharSourceRange, 8> Ranges |
Definition at line 1715 of file Format.cpp.
Referenced by clang::DiagnosticRenderer::emitDiagnostic(), clang::ento::BugReporterVisitor::getDefaultEndPath(), clang::ento::PathDiagnosticConsumer::HandlePathDiagnostic(), clang::ento::PathDiagnosticPiece::Profile(), and ReportEvent().
| SourceManager& SourceMgr |
Definition at line 1352 of file Format.cpp.
Referenced by clang::tooling::applyAllReplacements(), clang::GenerateModuleAction::BeginSourceFileAction(), checkConfigMacro(), compileModuleImpl(), ConvertBackendLocation(), clang::CompilerInstance::createSourceManager(), clang::Preprocessor::CreateString(), clang::Sema::DiagnoseUnusedExprResult(), clang::Preprocessor::DumpLocation(), clang::Preprocessor::DumpToken(), clang::BackendConsumer::EmitOptimizationMessage(), clang::Preprocessor::EnterMainSourceFile(), clang::ASTReader::findPreprocessedEntitiesInRange(), clang::Preprocessor::getLastMacroWithSpelling(), clang::Sema::getLocForEndOfToken(), clang::ASTContext::getRawCommentForDeclNoCache(), clang::PreprocessingRecord::getSourceManager(), clang::ASTUnit::getSourceManager(), clang::ASTReader::isPreprocessedEntityInFileID(), PrintUnexpected(), clang::ASTReader::ReadAST(), clang::ASTReader::ReadPragmaDiagnosticMappings(), clang::ASTReader::ReadSLocEntry(), clang::format::reformat(), clang::Preprocessor::SetCodeCompletionPoint(), and clang::CompilerInstance::setSourceManager().
| FormatStyle Style |
Definition at line 1354 of file Format.cpp.
Referenced by clang::format::expandPresets(), clang::format::getGNUStyle(), clang::format::getStyle(), clang::format::getWebKitStyle(), and clang::VarDecl::setInitStyle().
| StringRef Text |
Definition at line 1724 of file Format.cpp.
Referenced by clang::format::encoding::columnWidthWithTabs(), clang::format::configurationAsText(), clang::VerifyDiagnosticConsumer::Directive::create(), clang::ASTContext::getRawCommentForDeclNoCache(), clang::format::BreakableBlockComment::insertBreak(), ParseDirective(), clang::comments::Parser::parseVerbatimLine(), clang::format::BreakableBlockComment::replaceWhitespace(), shouldWarnOnMacroDef(), and shouldWarnOnMacroUndef().
| SmallVector<FormatToken *, 16> Tokens |
Definition at line 1361 of file Format.cpp.
Referenced by clang::comments::Sema::checkDeprecatedCommand(), DiagnoseSwitchLabelsFallthrough(), clang::Preprocessor::getLastMacroWithSpelling(), and clang::format::AnnotatedLine::startsWith().
| unsigned TrailingWhitespace |
Definition at line 1350 of file Format.cpp.
| SmallVector<SmallVector<UnwrappedLine, 16>, 2> UnwrappedLines |
Definition at line 1716 of file Format.cpp.
| WhitespaceManager Whitespaces |
Definition at line 1714 of file Format.cpp.
Referenced by NormalizeLine().
1.8.6