clang API Documentation
This file implements functions declared in Format.h. This will be split into separate files as we go. More...
#include "ContinuationIndenter.h"
#include "TokenAnnotator.h"
#include "UnwrappedLineParser.h"
#include "WhitespaceManager.h"
#include "clang/Basic/Diagnostic.h"
#include "clang/Basic/DiagnosticOptions.h"
#include "clang/Basic/SourceManager.h"
#include "clang/Format/Format.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/YAMLTraits.h"
#include <queue>
#include <string>
Go to the source code of this file.
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 33 of file Format.cpp.
llvm::SpecificBumpPtrAllocator<FormatToken> Allocator |
Definition at line 1333 of file Format.cpp.
Referenced by clang::CodeCompletionBuilder::addBriefComment(), and AddObjCKeyValueCompletions().
Definition at line 2079 of file Format.cpp.
Definition at line 1728 of file Format.cpp.
Referenced by clang::ASTUnit::CodeComplete(), clang::CodeGen::CodeGenFunction::EmitBuiltinExpr(), clang::CodeGen::CodeGenFunction::EmitCheckSourceLocation(), clang::BackendConsumer::EmitOptimizationMessage(), clang::format::CommaSeparatedList::formatAfterToken(), clang::BackendConsumer::InlineAsmDiagHandler2(), clang::format::CommaSeparatedList::precomputeFormattingInfos(), and printWordWrapped().
Definition at line 1736 of file Format.cpp.
Referenced by clang::format::getCommentSplit(), clang::SourceLocation::getFromRawEncoding(), and clang::format::getStringSplit().
Definition at line 1739 of file Format.cpp.
SmallVector<IdentifierInfo *, 8> ForEachMacros |
Definition at line 1741 of file Format.cpp.
Definition at line 1743 of file Format.cpp.
FormatToken* FormatTok |
Definition at line 1725 of file Format.cpp.
Definition at line 1727 of file Format.cpp.
FileID ID |
Definition at line 1732 of file Format.cpp.
IdentifierTable IdentTable |
Definition at line 1734 of file Format.cpp.
ContinuationIndenter* Indenter |
Definition at line 603 of file Format.cpp.
Definition at line 1726 of file Format.cpp.
LineJoiner Joiner |
Definition at line 1331 of file Format.cpp.
AdditionalKeywords Keywords |
Definition at line 1735 of file Format.cpp.
std::unique_ptr<Lexer> Lex |
Definition at line 1730 of file Format.cpp.
Referenced by clang::Lexer::LexFromRawLexer().
Definition at line 1030 of file Format.cpp.
Referenced by clang::format::CommaSeparatedList::formatAfterToken().
std::map<std::pair<const SmallVectorImpl<AnnotatedLine *> *, unsigned>, unsigned> PenaltyCache |
Definition at line 1339 of file Format.cpp.
StateNode* Previous |
Definition at line 1031 of file Format.cpp.
Referenced by clang::Sema::ActOnAliasDeclaration(), clang::Sema::ActOnExplicitInstantiation(), clang::Sema::ActOnFriendFunctionDecl(), clang::Sema::ActOnStartCategoryInterface(), clang::Sema::ActOnTag(), clang::Sema::addMethodToGlobalList(), clang::ASTDeclReader::attachPreviousDeclImpl(), clang::driver::Driver::BuildInputs(), clang::Sema::BuildUsingDeclaration(), clang::Sema::BuildVariableInstantiation(), clang::format::ContinuationIndenter::canBreak(), clang::Sema::CheckClassTemplate(), DiagnoseInvalidRedeclaration(), clang::Sema::HandleDeclarator(), clang::Sema::HandleField(), clang::Sema::HandleMSProperty(), clang::Sema::isAcceptableTagRedeclaration(), clang::format::ContinuationIndenter::mustBreak(), clang::format::startsNextParameter(), clang::TemplateDeclInstantiator::VisitCXXMethodDecl(), and clang::TemplateDeclInstantiator::VisitFunctionDecl().
SmallVector<CharSourceRange, 8> Ranges |
Definition at line 2075 of file Format.cpp.
Referenced by clang::DiagnosticRenderer::emitDiagnostic(), clang::ento::PathDiagnosticConsumer::HandlePathDiagnostic(), clang::ento::PathDiagnosticPiece::Profile(), and ReportEvent().
SourceManager& SourceMgr |
Definition at line 1731 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::format::WhitespaceManager::generateReplacements(), clang::ASTContext::getFullLoc(), clang::Preprocessor::getLastMacroWithSpelling(), clang::Sema::getLocForEndOfToken(), clang::ASTContext::getRawCommentForDeclNoCache(), clang::PreprocessingRecord::getSourceManager(), clang::ASTContext::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().
LineState State |
Definition at line 1029 of file Format.cpp.
Referenced by clang::ento::CheckerContext::addTransition(), assumeCollectionNonEmpty(), clang::ento::ExprEngine::bindReturnValue(), checkCollectionNonNil(), clang::ento::CheckerDocumentation::checkConstPointerEscape(), checkElementNonNil(), checkForFunctionCall(), clang::ento::CheckerDocumentation::checkPointerEscape(), clang::ento::CheckerDocumentation::checkRegionChanges(), clang::MaterializeTemporaryExpr::children(), clang::ento::CallEvent::cloneWithState(), clang::CodeGen::CodeGenFunction::EmitCondBrHints(), clang::ento::CheckerDocumentation::evalAssume(), clang::ento::CheckerContext::generateSink(), getArgumentValueString(), getAsPointeeSymbol(), clang::consumed::PropagationInfo::getAsState(), clang::ento::CheckerContext::getCalleeDecl(), clang::CallEventManager::getCaller(), clang::CallEventManager::getCXXAllocatorCall(), clang::CallEventManager::getCXXConstructorCall(), clang::CallEventManager::getCXXDestructorCall(), clang::MaterializeTemporaryExpr::getExtendingDecl(), clang::format::ContinuationIndenter::getInitialState(), clang::ento::ProgramStateManager::getInitialState(), clang::MaterializeTemporaryExpr::getManglingNumber(), clang::ento::StackHintGeneratorForSymbol::getMessage(), clang::CallEventManager::getObjCMethodCall(), clang::CallEventManager::getSimpleCall(), clang::ento::CallEvent::getState(), clang::consumed::PropagationInfo::getState(), clang::MaterializeTemporaryExpr::getTemporary(), handleLoopHintAttr(), clang::ento::ExprEngine::notifyCheckersOfPointerEscape(), clang::ento::ExprEngine::processPointerEscapedOnBind(), clang::ento::ExprEngine::ProcessTemporaryDtor(), recordFixedType(), REGISTER_TRAIT_WITH_PROGRAMSTATE(), clang::ento::CheckerManager::runCheckersForPointerEscape(), clang::MaterializeTemporaryExpr::setExtendingDecl(), clang::consumed::ConsumedStateMap::setState(), clang::consumed::setStateForVarOrTmp(), clang::serialization::ModuleManager::visit(), clang::ento::ExprEngine::VisitBlockExpr(), clang::ento::ExprEngine::VisitCompoundLiteralExpr(), clang::ento::UndefOrNullArgVisitor::VisitNode(), and clang::ento::ExprEngine::VisitObjCMessage().
Definition at line 858 of file Format.cpp.
Referenced by clang::format::configurationAsText(), clang::format::getGNUStyle(), clang::format::getStyle(), clang::format::getWebKitStyle(), and clang::VarDecl::setInitStyle().
SmallVector<FormatToken *, 16> Tokens |
Definition at line 1740 of file Format.cpp.
Referenced by clang::comments::Sema::checkDeprecatedCommand(), DiagnoseSwitchLabelsFallthrough(), and clang::Preprocessor::getLastMacroWithSpelling().
Definition at line 1729 of file Format.cpp.
SmallVector<SmallVector<UnwrappedLine, 16>, 2> UnwrappedLines |
Definition at line 2076 of file Format.cpp.
WhitespaceManager Whitespaces |
Definition at line 1329 of file Format.cpp.