clang 17.0.0git
Classes | Namespaces | Macros | Functions
Format.cpp File Reference

This file implements functions declared in Format.h. More...

#include "clang/Format/Format.h"
#include "AffectedRangeManager.h"
#include "BreakableToken.h"
#include "ContinuationIndenter.h"
#include "DefinitionBlockSeparator.h"
#include "FormatInternal.h"
#include "FormatToken.h"
#include "FormatTokenLexer.h"
#include "IntegerLiteralSeparatorFixer.h"
#include "NamespaceEndCommentsFixer.h"
#include "QualifierAlignmentFixer.h"
#include "SortJavaScriptImports.h"
#include "TokenAnalyzer.h"
#include "TokenAnnotator.h"
#include "UnwrappedLineFormatter.h"
#include "UnwrappedLineParser.h"
#include "UsingDeclarationsSorter.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 "clang/Tooling/Inclusions/HeaderIncludes.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/Sequence.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/Allocator.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/Regex.h"
#include "llvm/Support/VirtualFileSystem.h"
#include "llvm/Support/YAMLTraits.h"
#include <algorithm>
#include <memory>
#include <mutex>
#include <optional>
#include <string>
#include <unordered_map>
Include dependency graph for Format.cpp:

Go to the source code of this file.

Classes

struct  llvm::yaml::MappingTraits< FormatStyle::AlignConsecutiveStyle >
 
struct  llvm::yaml::ScalarEnumerationTraits< FormatStyle::AttributeBreakingStyle >
 
struct  llvm::yaml::ScalarEnumerationTraits< FormatStyle::ArrayInitializerAlignmentStyle >
 
struct  llvm::yaml::ScalarEnumerationTraits< FormatStyle::BinaryOperatorStyle >
 
struct  llvm::yaml::ScalarEnumerationTraits< FormatStyle::BinPackStyle >
 
struct  llvm::yaml::ScalarEnumerationTraits< FormatStyle::BitFieldColonSpacingStyle >
 
struct  llvm::yaml::ScalarEnumerationTraits< FormatStyle::BraceBreakingStyle >
 
struct  llvm::yaml::MappingTraits< FormatStyle::BraceWrappingFlags >
 
struct  llvm::yaml::ScalarEnumerationTraits< FormatStyle::BracketAlignmentStyle >
 
struct  llvm::yaml::ScalarEnumerationTraits< FormatStyle::BraceWrappingAfterControlStatementStyle >
 
struct  llvm::yaml::ScalarEnumerationTraits< FormatStyle::BreakBeforeConceptDeclarationsStyle >
 
struct  llvm::yaml::ScalarEnumerationTraits< FormatStyle::BreakBeforeInlineASMColonStyle >
 
struct  llvm::yaml::ScalarEnumerationTraits< FormatStyle::BreakConstructorInitializersStyle >
 
struct  llvm::yaml::ScalarEnumerationTraits< FormatStyle::BreakInheritanceListStyle >
 
struct  llvm::yaml::ScalarEnumerationTraits< FormatStyle::BreakTemplateDeclarationsStyle >
 
struct  llvm::yaml::ScalarEnumerationTraits< FormatStyle::DefinitionReturnTypeBreakingStyle >
 
struct  llvm::yaml::ScalarEnumerationTraits< FormatStyle::EscapedNewlineAlignmentStyle >
 
struct  llvm::yaml::ScalarEnumerationTraits< FormatStyle::EmptyLineAfterAccessModifierStyle >
 
struct  llvm::yaml::ScalarEnumerationTraits< FormatStyle::EmptyLineBeforeAccessModifierStyle >
 
struct  llvm::yaml::ScalarEnumerationTraits< FormatStyle::IndentExternBlockStyle >
 
struct  llvm::yaml::MappingTraits< FormatStyle::IntegerLiteralSeparatorStyle >
 
struct  llvm::yaml::ScalarEnumerationTraits< FormatStyle::JavaScriptQuoteStyle >
 
struct  llvm::yaml::ScalarEnumerationTraits< FormatStyle::LanguageKind >
 
struct  llvm::yaml::ScalarEnumerationTraits< FormatStyle::LanguageStandard >
 
struct  llvm::yaml::ScalarEnumerationTraits< FormatStyle::LambdaBodyIndentationKind >
 
struct  llvm::yaml::ScalarEnumerationTraits< FormatStyle::LineEndingStyle >
 
struct  llvm::yaml::ScalarEnumerationTraits< FormatStyle::NamespaceIndentationKind >
 
struct  llvm::yaml::ScalarEnumerationTraits< FormatStyle::OperandAlignmentStyle >
 
struct  llvm::yaml::ScalarEnumerationTraits< FormatStyle::PackConstructorInitializersStyle >
 
struct  llvm::yaml::ScalarEnumerationTraits< FormatStyle::PointerAlignmentStyle >
 
struct  llvm::yaml::ScalarEnumerationTraits< FormatStyle::PPDirectiveIndentStyle >
 
struct  llvm::yaml::ScalarEnumerationTraits< FormatStyle::QualifierAlignmentStyle >
 
struct  llvm::yaml::MappingTraits< FormatStyle::RawStringFormat >
 
struct  llvm::yaml::ScalarEnumerationTraits< FormatStyle::ReferenceAlignmentStyle >
 
struct  llvm::yaml::ScalarEnumerationTraits< FormatStyle::RequiresClausePositionStyle >
 
struct  llvm::yaml::ScalarEnumerationTraits< FormatStyle::RequiresExpressionIndentationKind >
 
struct  llvm::yaml::ScalarEnumerationTraits< FormatStyle::ReturnTypeBreakingStyle >
 
struct  llvm::yaml::ScalarEnumerationTraits< FormatStyle::SeparateDefinitionStyle >
 
struct  llvm::yaml::ScalarEnumerationTraits< FormatStyle::ShortBlockStyle >
 
struct  llvm::yaml::ScalarEnumerationTraits< FormatStyle::ShortFunctionStyle >
 
struct  llvm::yaml::ScalarEnumerationTraits< FormatStyle::ShortIfStyle >
 
struct  llvm::yaml::ScalarEnumerationTraits< FormatStyle::ShortLambdaStyle >
 
struct  llvm::yaml::ScalarEnumerationTraits< FormatStyle::SortIncludesOptions >
 
struct  llvm::yaml::ScalarEnumerationTraits< FormatStyle::SortJavaStaticImportOptions >
 
struct  llvm::yaml::ScalarEnumerationTraits< FormatStyle::SortUsingDeclarationsOptions >
 
struct  llvm::yaml::ScalarEnumerationTraits< FormatStyle::SpaceAroundPointerQualifiersStyle >
 
struct  llvm::yaml::MappingTraits< FormatStyle::SpaceBeforeParensCustom >
 
struct  llvm::yaml::ScalarEnumerationTraits< FormatStyle::SpaceBeforeParensStyle >
 
struct  llvm::yaml::ScalarEnumerationTraits< FormatStyle::SpacesInAnglesStyle >
 
struct  llvm::yaml::MappingTraits< FormatStyle::SpacesInLineComment >
 
struct  llvm::yaml::ScalarEnumerationTraits< FormatStyle::TrailingCommaStyle >
 
struct  llvm::yaml::ScalarEnumerationTraits< FormatStyle::TrailingCommentsAlignmentKinds >
 
struct  llvm::yaml::MappingTraits< FormatStyle::TrailingCommentsAlignmentStyle >
 
struct  llvm::yaml::ScalarEnumerationTraits< FormatStyle::UseTabStyle >
 
struct  llvm::yaml::MappingTraits< FormatStyle >
 
struct  llvm::yaml::DocumentListTraits< std::vector< FormatStyle > >
 

Namespaces

namespace  llvm
 YAML serialization mapping.
 
namespace  llvm::yaml
 
namespace  clang
 
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 llvm::Twine &Message)
 
static void clang::format::expandPresetsBraceWrapping (FormatStyle &Expanded)
 
static void clang::format::expandPresetsSpaceBeforeParens (FormatStyle &Expanded)
 
FormatStyle clang::format::getLLVMStyle (FormatStyle::LanguageKind Language=FormatStyle::LanguageKind::LK_Cpp)
 Returns a format style complying with the LLVM coding standards: http://llvm.org/docs/CodingStandards.html.
 
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.
 
FormatStyle clang::format::getChromiumStyle (FormatStyle::LanguageKind Language)
 Returns a format style complying with Chromium's style guide: http://www.chromium.org/developers/coding-style.
 
FormatStyle clang::format::getMozillaStyle ()
 Returns a format style complying with Mozilla's style guide: https://firefox-source-docs.mozilla.org/code-quality/coding-style/index.html.
 
FormatStyle clang::format::getWebKitStyle ()
 Returns a format style complying with Webkit's style guide: http://www.webkit.org/coding/coding-style.html.
 
FormatStyle clang::format::getGNUStyle ()
 Returns a format style complying with GNU Coding Standards: http://www.gnu.org/prep/standards/standards.html.
 
FormatStyle clang::format::getMicrosoftStyle (FormatStyle::LanguageKind Language)
 Returns a format style complying with Microsoft style guide: https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference?view=vs-2017.
 
FormatStyle clang::format::getNoStyle ()
 Returns style indicating formatting should be not applied at all.
 
bool clang::format::getPredefinedStyle (StringRef Name, FormatStyle::LanguageKind Language, FormatStyle *Style)
 Gets a predefined style for the specified language by name.
 
ParseError clang::format::validateQualifierOrder (FormatStyle *Style)
 
std::error_code clang::format::parseConfiguration (llvm::MemoryBufferRef Config, FormatStyle *Style, bool AllowUnknownOptions=false, llvm::SourceMgr::DiagHandlerTy DiagHandler=nullptr, void *DiagHandlerCtx=nullptr)
 Parse configuration from YAML-formatted text.
 
std::string clang::format::configurationAsText (const FormatStyle &Style)
 Gets configuration in a YAML string.
 
static bool clang::format::affectsRange (ArrayRef< tooling::Range > Ranges, unsigned Start, unsigned End)
 
static std::pair< unsigned, unsignedclang::format::FindCursorIndex (const SmallVectorImpl< IncludeDirective > &Includes, const SmallVectorImpl< unsigned > &Indices, unsigned Cursor)
 
std::string clang::format::replaceCRLF (const std::string &Code)
 
static void clang::format::sortCppIncludes (const FormatStyle &Style, const SmallVectorImpl< 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 SmallVectorImpl< 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=nullptr)
 Returns the replacements necessary to sort all #include blocks that are affected by Ranges.
 
template<typename T >
static llvm::Expected< tooling::Replacements > clang::format::processReplacements (T ProcessFunc, StringRef Code, const tooling::Replacements &Replaces, const FormatStyle &Style)
 
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.
 
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.
 
std::pair< tooling::Replacements, unsignedclang::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="<stdin>", FormattingAttemptStatus *Status=nullptr)
 Reformats the given Ranges in Code.
 
tooling::Replacements clang::format::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.
 
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.
 
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.
 
tooling::Replacements clang::format::separateDefinitionBlocks (const FormatStyle &Style, StringRef Code, ArrayRef< tooling::Range > Ranges, StringRef FileName="<stdin>")
 Inserts or removes empty lines separating definition blocks including classes, structs, functions, namespaces, and enums in the given Ranges in Code.
 
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.
 
LangOptions clang::format::getFormattingLangOpts (const FormatStyle &Style=getLLVMStyle())
 Returns the LangOpts that the formatter expects you to set.
 
static FormatStyle::LanguageKind clang::format::getLanguageByFileName (StringRef FileName)
 
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::Expected< FormatStyleclang::format::getStyle (StringRef StyleName, StringRef FileName, StringRef FallbackStyle, StringRef Code="", llvm::vfs::FileSystem *FS=nullptr, bool AllowUnknownOptions=false)
 Construct a FormatStyle based on StyleName.
 
static bool clang::format::isClangFormatOnOff (StringRef Comment, bool On)
 
bool clang::format::isClangFormatOn (StringRef Comment)
 
bool clang::format::isClangFormatOff (StringRef Comment)
 

Detailed Description

This file implements functions declared in Format.h.

This will be split into separate files as we go.

Definition in file Format.cpp.

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "format-formatter"

Definition at line 54 of file Format.cpp.

Variable Documentation

◆ AssociatedCommentLines

SmallVector<StringRef> AssociatedCommentLines

Definition at line 2785 of file Format.cpp.

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

◆ Category

int Category

Definition at line 2777 of file Format.cpp.

Referenced by clang::Sema::ActOnPropertyImplDecl(), AddObjCProperties(), clang::ento::BugType::BugType(), checkAtomicPropertyMismatch(), CheckForIncompatibleAttributes(), clang::Sema::CodeCompleteObjCInterfaceCategory(), clang::Sema::CodeCompleteObjCMethodDecl(), clang::Sema::CodeCompleteObjCPropertyGetter(), clang::Sema::CodeCompleteObjCPropertySetter(), CollectOverriddenMethodsRecurse(), clang::NoSanitizeList::containsFile(), clang::NoSanitizeList::containsGlobal(), clang::NoSanitizeList::containsLocation(), clang::NoSanitizeList::containsMainFile(), clang::NoSanitizeList::containsType(), clang::cross_tu::IndexError::convertToErrorCode(), clang::tooling::CommonOptionsParser::create(), clang::tooling::createExecutorFromCommandLineArgs(), clang::tooling::internal::createExecutorFromCommandLineArgsImpl(), clang::ento::BugReporter::EmitBasicReport(), FindImplementableMethods(), clang::ObjCMethodDecl::findPropertyDecl(), clang::ento::PathDiagnostic::getCategory(), clang::ento::BugType::getCategory(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForObjCCategory(), hasWrittenStorageAttribute(), clang::tooling::HeaderIncludes::HeaderIncludes(), clang::CodeGen::CodeGenModule::imbueXRayAttrs(), clang::tooling::IncludeCategoryManager::IncludeCategoryManager(), clang::SanitizerSpecialCaseList::inSection(), clang::CodeGen::CodeGenModule::isInNoSanitizeList(), clang::cross_tu::IndexError::log(), LookupMemberExpr(), clang::ento::PathDiagnostic::Profile(), clang::XRayFunctionFilter::shouldImbueFunctionsInFile(), clang::XRayFunctionFilter::shouldImbueLocation(), clang::format::sortCppIncludes(), clang::JSONNodeDumper::Visit(), and clang::ASTNodeImporter::VisitObjCCategoryImplDecl().

◆ Filename

StringRef Filename

Definition at line 2774 of file Format.cpp.

Referenced by clang::InMemoryModuleCache::addBuiltPCM(), clang::DependencyCollector::addDependency(), clang::ModuleDependencyCollector::addFile(), clang::index::PathPool::addFilePath(), clang::InMemoryModuleCache::addPCM(), clang::Module::addTopHeaderFilename(), adjustFilenameForRelocatableAST(), clang::ast_matchers::AST_POLYMORPHIC_MATCHER_REGEX(), clang::FrontendAction::BeginSourceFile(), clang::PrecompiledPreamble::Build(), clang::ASTUnit::CodeComplete(), clang::Sema::CodeCompleteIncludedFile(), clang::driver::tools::Clang::ConstructJob(), clang::driver::tools::NVPTX::Assembler::ConstructJob(), clang::driver::tools::NVPTX::Linker::ConstructJob(), clang::CompilerInstance::createCodeCompletionConsumer(), clang::ModuleMap::diagnoseHeaderInclusion(), clang::ento::ExprEngine::DumpGraph(), clang::BackendConsumer::EmitOptimizationMessage(), EnableCodeCompletion(), clang::tooling::dependencies::EntryRef::EntryRef(), EvaluateHasIncludeCommon(), fileNameToURI(), clang::InMemoryModuleCache::finalizePCM(), clang::tooling::dependencies::DependencyScanningFilesystemSharedCache::CacheShard::findEntryByFilename(), clang::tooling::dependencies::DependencyScanningFilesystemLocalCache::findEntryByFilename(), clang::SrcMgr::FileInfo::get(), clang::LineEntry::get(), clang::BackendConsumer::getBestLocationFromDebugLoc(), clang::FileManager::getBufferForFile(), clang::ASTUnit::getBufferForFile(), getDirectoryFromFile(), clang::FileManager::getFile(), clang::PresumedLoc::getFilename(), getFileName(), clang::FileManager::getFileRef(), clang::driver::toolchains::CudaToolChain::getInputFilename(), clang::FileManager::getOptionalFileRef(), clang::tooling::dependencies::DependencyScanningWorkerFilesystem::getOrCreateFileSystemEntry(), clang::tooling::dependencies::DependencyScanningFilesystemSharedCache::CacheShard::getOrEmplaceEntryForFilename(), clang::tooling::dependencies::DependencyScanningFilesystemSharedCache::CacheShard::getOrInsertEntryForFilename(), clang::tooling::dependencies::DependencyScanningTool::getP1689ModuleDependencyFile(), clang::InMemoryModuleCache::getPCMState(), clang::tooling::dependencies::getPolicy(), clang::SourceManager::getPresumedLoc(), getPrivateModuleMap(), getPublicModuleMap(), clang::tooling::dependencies::DependencyScanningFilesystemSharedCache::getShardForFilename(), clang::tooling::dependencies::EntryRef::getStatus(), clang::FileManager::getVirtualFile(), clang::FileManager::getVirtualFileRef(), clang::Preprocessor::HandlePragmaDependency(), clang::tooling::dependencies::DependencyScanningFilesystemLocalCache::insertEntryForFilename(), clang::ModuleDependencyCollector::insertSeen(), clang::ASTReader::isAcceptableASTFile(), clang::FilenamePatternConstraint::isAutoGenerated(), clang::PresumedLoc::isInvalid(), clang::InMemoryModuleCache::isPCMFinal(), isSpecialFilename(), clang::PresumedLoc::isValid(), clang::SourceManager::isWrittenInBuiltinFile(), clang::SourceManager::isWrittenInCommandLineFile(), clang::SourceManager::isWrittenInScratchSpace(), clang::LayoutOverrideSource::LayoutOverrideSource(), clang::tooling::dependencies::ModuleDepCollectorPP::LexedFileChanged(), clang::ASTUnit::LoadFromASTFile(), clang::Preprocessor::LookupFile(), clang::DirectoryLookup::LookupFile(), clang::HeaderSearch::LookupFile(), clang::HeaderMapImpl::lookupFilename(), clang::InMemoryModuleCache::lookupPCM(), clang::HeaderSearch::LookupSubframeworkHeader(), MakeCLOutputFilename(), clang::DependencyCollector::maybeAddDependency(), clang::BackendConsumer::MisExpectDiagHandler(), clang::tooling::dependencies::DependencyScanningWorkerFilesystem::openFileForRead(), ParseDependencyOutputArgs(), ParseDirective(), clang::PresumedLoc::PresumedLoc(), PrintFilename(), PrintHeaderInfo(), clang::ASTReader::readASTFileControlBlock(), clang::serialization::reader::HeaderFileInfoTrait::ReadData(), clang::ASTReader::ReadPath(), clang::ASTReader::ResolveImportedPath(), clang::DependencyCollector::sawDependency(), clang::DependencyFileGenerator::sawDependency(), clang::InMemoryModuleCache::shouldBuildPCM(), clang::XRayFunctionFilter::shouldImbueFunctionsInFile(), clang::format::sortCppIncludes(), clang::tooling::dependencies::DependencyScanningWorkerFilesystem::status(), clang::HeaderSearch::suggestPathToFileForDiagnostics(), clang::TestAST::TestAST(), clang::tooling::transferCompileCommand(), clang::InMemoryModuleCache::tryToDropPCM(), clang::BackendConsumer::UnsupportedDiagHandler(), clang::ento::ExprEngine::ViewGraph(), clang::CXXRecordDecl::viewInheritance(), clang::ChainedASTReaderListener::visitInputFile(), clang::ChainedASTReaderListener::visitModuleFile(), clang::RewriteIncludesAction::RewriteImportsListener::visitModuleFile(), clang::FixItRewriter::WriteFixedFiles(), and clang::driver::XRayArgs::XRayArgs().

◆ Identifier

StringRef Identifier

◆ IsStatic

bool IsStatic

◆ Offset

unsigned Offset
Examples
/home/buildbot/as-worker-4/publish-doxygen-docs/llvm-project/clang/lib/StaticAnalyzer/Core/RegionStore.cpp.

Definition at line 2776 of file Format.cpp.

Referenced by clang::index::StringPool::add(), clang::index::FileIndexRecord::addDeclOccurence(), clang::ASTUnit::addFileLevelDecl(), clang::LineTableInfo::AddLineNote(), clang::index::FileIndexRecord::addMacroOccurence(), clang::interp::AddOffset(), addOrSubLValueAsInteger(), clang::CodeGen::CodeGenModule::AddVTableTypeMetadata(), clang::interp::ArrayElemPtr(), clang::interp::ArrayElemPtrPop(), calculateOffset(), checkFormatStringExpr(), clang::OMPAffinityClause::children(), clang::CodeGen::CodeGenModule::computeNonVirtualBaseClassOffset(), computeOffsetHint(), clang::driver::tools::Clang::ConstructJob(), clang::syntax::FileRange::contains(), ConvertBackendLocation(), convertOffsetsFromSvalToUnsigneds(), clang::CodeGen::CGBuilderTy::CreateConstByteGEP(), clang::CodeGen::CGBuilderTy::CreateConstInBoundsByteGEP(), clang::CodeGen::CGBuilderTy::CreateConstInBoundsGEP2_32(), clang::CodeGen::CGBuilderTy::CreatePreserveStructAccessIndex(), clang::CodeGen::CGBuilderTy::CreateStructGEP(), llvm::yaml::MappingTraits< clang::tooling::Replacement >::NormalizedReplacement::denormalize(), DerefSimplePtrArithFixableGadget::DerefSimplePtrArithFixableGadget(), DiagnoseReinterpretUpDownCast(), DumpRecordLayout(), clang::ASTRecordWriter::Emit(), emitAddrOfZeroSizeField(), clang::interp::ByteCodeEmitter::emitLabel(), clang::CodeGen::CGObjCRuntime::EmitValueForIvarAtOffset(), EmitX86_64VAArgFromMemory(), EncodeBitField(), clang::RopePieceBTree::erase(), clang::RewriteRope::erase(), evaluateCDTSize(), findBeginningOfLine(), clang::ASTUnit::findFileRegionDecls(), clang::MultiplexExternalSemaSource::FindFileRegionDecls(), clang::ASTReader::FindFileRegionDecls(), clang::LineTableInfo::FindNearestLineEntry(), findPathsToSubobject(), clang::SrcMgr::SLocEntry::get(), clang::tooling::Replacements::getAffectedRanges(), getAlignmentAndOffsetFromBinAddOrSub(), getBaseAlignmentAndOffsetFromLValue(), clang::RawCommentList::getCommentBeginLine(), clang::RawCommentList::getCommentEndOffset(), clang::SourceManager::getComposedLoc(), clang::ASTContext::getDeclAlign(), clang::SourceManager::getDecomposedExpansionLoc(), clang::SourceManager::getDecomposedSpellingLoc(), getDerivedToBaseAlignmentAndOffset(), GetDiagInfo(), clang::CodeGen::ABIArgInfo::getDirect(), clang::MultiplexExternalSemaSource::GetExternalCXXBaseSpecifiers(), clang::ASTReader::GetExternalCXXBaseSpecifiers(), clang::MultiplexExternalSemaSource::GetExternalCXXCtorInitializers(), clang::ASTReader::GetExternalCXXCtorInitializers(), clang::MultiplexExternalSemaSource::GetExternalDeclStmt(), clang::ASTReader::GetExternalDeclStmt(), clang::interp::InterpFrame::getLocal(), clang::interp::InterpFrame::getLocalPointer(), clang::NestedNameSpecifierLoc::getLocalSourceRange(), clang::ASTUnit::getLocation(), clang::StringLiteral::getLocationOfByte(), clang::Lexer::getLocForEndOfToken(), clang::Preprocessor::getLocForEndOfToken(), clang::Sema::getLocForEndOfToken(), clang::SourceLocation::getLocWithOffset(), clang::ento::StoreManager::getLValueElement(), clang::SourceManager::getMacroArgExpandedLocation(), clang::CodeGen::CodeGenModule::GetNonVirtualBaseClassOffset(), clang::ento::RegionOffset::getOffset(), clang::ento::RegionRawOffset::getOffset(), clang::CodeGen::CGBlockInfo::Capture::getOffset(), clang::ento::iterator::IteratorPosition::getOffset(), clang::ASTContext::getOffsetOfBaseWithVBPtr(), getOffsetOfFullPath(), clang::interp::InterpFrame::getParam(), clang::interp::Function::getParamDescriptor(), clang::format::BreakableBlockComment::getRangeLength(), clang::format::BreakableLineCommentSection::getRangeLength(), clang::format::BreakableToken::getRemainingLength(), clang::format::BreakableStringLiteral::getRemainingLength(), clang::format::BreakableBlockComment::getRemainingLength(), clang::tooling::Replacements::getShiftedCodePosition(), clang::interp::Function::getSource(), clang::NestedNameSpecifierLoc::getTypeLoc(), getUDSuffixLoc(), clang::targets::WindowsARMTargetInfo::getVisualStudioDefines(), clang::consumed::ConsumedStmtVisitor::handleCall(), handlePatchableFunctionEntryAttr(), clang::ento::RegionOffset::hasSymbolicOffset(), clang::tooling::HeaderIncludes::HeaderIncludes(), clang::ASTNodeImporter::ImportAPValue(), initializeForBlockHeader(), clang::RewriteRope::insert(), clang::RopePieceBTree::insert(), clang::ento::iterator::IteratorPosition::invalidate(), clang::SourceManager::isInTheSameTranslationUnit(), Jf(), Jmp(), Jt(), clang::LayoutOverrideSource::LayoutOverrideSource(), clang::LazyOffsetPtr< T, OffsT, Get >::LazyOffsetPtr(), clang::HeaderSearch::loadModuleMapFile(), loadModuleMapForModuleBuild(), LoadPointer(), LoadSourceLocation(), clang::Sema::LookupInlineAsmField(), clang::VTableComponent::MakeOffsetToTop(), makeStandaloneRange(), clang::VTableComponent::MakeVBaseOffset(), clang::VTableComponent::MakeVCallOffset(), clang::interp::OffsetHelper(), clang::interp::CodePtr::operator+=(), clang::operator<(), clang::interp::Pointer::operator=(), clang::LazyOffsetPtr< T, OffsT, Get >::operator=(), clang::ento::iterator::IteratorPosition::operator==(), clang::RopePiece::operator[](), clang::ModuleMap::parseModuleMapFile(), parseName(), performTypeAdjustment(), PrintBitFieldOffset(), PrintOffset(), clang::ento::iterator::IteratorPosition::Profile(), clang::tooling::Range::Range(), clang::ASTReader::ReadAST(), clang::ASTReader::ReadBlockAbbrevs(), clang::ASTRecordReader::readLexicalDeclContextStorage(), clang::ASTReader::ReadMacroRecord(), clang::ASTReader::ReadPragmaDiagnosticMappings(), clang::ASTReader::ReadSLocEntry(), clang::ASTRecordReader::readVisibleDeclContextStorage(), clang::ento::iterator::IteratorPosition::reAssign(), clang::Sema::RefersToMemberWithReducedAlignment(), clang::format::BreakableLineCommentSection::reflow(), clang::ento::RegionOffset::RegionOffset(), REGISTER_MAP_WITH_PROGRAMSTATE(), RenderSSPOptions(), clang::format::WhitespaceManager::replaceWhitespaceInToken(), clang::Lexer::seek(), clang::serialization::UnderalignedInt64::setBitOffset(), clang::serialization::DeclOffset::setBitOffset(), clang::CodeGen::ABIArgInfo::setDirectOffset(), clang::ASTWriter::SetIdentifierOffset(), clang::FunctionDecl::setLazyBody(), clang::ObjCMethodDecl::setLazyBody(), clang::interp::InterpFrame::setLocal(), clang::detail::SarifArtifact::setOffset(), clang::interp::InterpFrame::setParam(), clang::ASTWriter::SetSelectorOffset(), setUsedBits(), shuffleAndStore(), structSubobjectsHaveUniqueObjectRepresentations(), clang::interp::SubOffset(), sumOffsets(), clang::interp::Pointer::toAPValue(), clang::syntax::FileRange::touches(), clang::interp::ByteCodeExprGen< Emitter >::VisitDeclRefExpr(), and clang::interp::ByteCodeExprGen< Emitter >::visitVarDecl().

◆ Priority

int Priority

◆ SM

const SourceManager& SM

Definition at line 2629 of file Format.cpp.

◆ Text

StringRef Text

Definition at line 2775 of file Format.cpp.

Referenced by clang::comments::Sema::actOnText(), clang::comments::Sema::actOnVerbatimBlockLine(), clang::comments::Sema::actOnVerbatimLine(), clang::CodeCompletionBuilder::AddChunk(), clang::CodeCompletionBuilder::AddInformativeChunk(), clang::CodeCompletionBuilder::AddTextChunk(), clang::CodeCompletionBuilder::AddTypedTextChunk(), clang::format::BreakableBlockComment::BreakableBlockComment(), buildAccessForPointer(), buildAccessForValue(), clang::tooling::buildAddressOf(), clang::tooling::buildDereference(), clang::tooling::buildParens(), clang::Sema::CodeCompleteAttribute(), clang::format::encoding::columnWidth(), clang::format::encoding::columnWidthWithTabs(), clang::format::BreakableComment::compressWhitespace(), clang::format::configurationAsText(), clang::index::CommentToXMLConverter::convertHTMLTagNodeToText(), clang::format::countLeadingWhitespace(), clang::VerifyDiagnosticConsumer::Directive::create(), createMessage(), clang::tooling::createRenameAtomicChanges(), clang::CodeCompletionString::Chunk::CreateText(), clang::format::encoding::detectEncoding(), clang::format::FindCursorIndex(), clang::format::getCommentSplit(), clang::format::encoding::getEscapeSequenceLength(), clang::format::getLastLineEndColumn(), clang::ASTContext::getRawCommentForDeclNoCacheImpl(), clang::format::getStringSplit(), clang::format::getStyle(), clang::comments::TextComment::getText(), clang::comments::VerbatimBlockLineComment::getText(), clang::format::WhitespaceManager::inputUsesCRLF(), clang::tooling::AtomicChange::insert(), clang::format::BreakableBlockComment::insertBreak(), clang::format::BreakableLineCommentSection::insertBreak(), clang::ast_matchers::internal::isTokenAtLoc(), clang::comments::TextTokenRetokenizer::lexDelimitedSeq(), clang::comments::TextTokenRetokenizer::lexWord(), clang::format::loadAndParseConfigFile(), clang::tooling::parseIWYUPragma(), clang::comments::Parser::parseVerbatimLine(), clang::format::IntegerLiteralSeparatorFixer::process(), clang::tooling::AtomicChange::replace(), clang::tooling::replaceStmtWithText(), clang::comments::Token::setText(), clang::comments::Token::setVerbatimBlockText(), clang::comments::Token::setVerbatimLineText(), shouldWarnOnMacroDef(), clang::syntax::FileRange::text(), clang::comments::TextComment::TextComment(), and clang::comments::VerbatimBlockLineComment::VerbatimBlockLineComment().