class CrossTranslationUnitContext::ASTLoader

Declaration

class CrossTranslationUnitContext::ASTLoader { /* full declaration omitted */ };

Description

Loads ASTUnits from AST-dumps or source-files.

Declared at: clang/include/clang/CrossTU/CrossTranslationUnit.h:233

Member Variables

private const llvm::sys::path::Style PathStyle = llvm::sys::path::Style::posix
The style used for storage and lookup of filesystem paths. Defaults to posix.
private clang::CompilerInstance& CI
private llvm::StringRef CTUDir
private llvm::StringRef InvocationListFilePath
The path to the file containing the invocation list, which is in YAML format, and contains a mapping from source files to compiler invocations that produce the AST used for analysis.
private llvm::Optional<InvocationListTy> InvocationList
In case of on-demand parsing, the invocations for parsing the source files is stored.
private clang::cross_tu::index_error_code PreviousParsingResult = index_error_code::success

Method Overview

  • public ASTLoader(clang::CompilerInstance & CI, llvm::StringRef CTUDir, llvm::StringRef InvocationListFilePath)
  • public llvm::Error lazyInitInvocationList()
  • public clang::cross_tu::CrossTranslationUnitContext::LoadResultTy load(llvm::StringRef Identifier)
  • private clang::cross_tu::CrossTranslationUnitContext::LoadResultTy loadFromDump(llvm::StringRef Identifier)
  • private clang::cross_tu::CrossTranslationUnitContext::LoadResultTy loadFromSource(llvm::StringRef Identifier)

Methods

ASTLoader(clang::CompilerInstance& CI,
          llvm::StringRef CTUDir,
          llvm::StringRef InvocationListFilePath)

Declared at: clang/include/clang/CrossTU/CrossTranslationUnit.h:235

Parameters

clang::CompilerInstance& CI
llvm::StringRef CTUDir
llvm::StringRef InvocationListFilePath

llvm::Error lazyInitInvocationList()

Description

Lazily initialize the invocation list information, which is needed for on-demand parsing.

Declared at: clang/include/clang/CrossTU/CrossTranslationUnit.h:246

clang::cross_tu::CrossTranslationUnitContext::
    LoadResultTy
    load(llvm::StringRef Identifier)

Description

Load the ASTUnit by its identifier found in the index file. If the identifier is suffixed with '.ast' it is considered a dump. Otherwise it is treated as source-file, and on-demand parsed. Relative paths are prefixed with CTUDir.

Declared at: clang/include/clang/CrossTU/CrossTranslationUnit.h:242

Parameters

llvm::StringRef Identifier

clang::cross_tu::CrossTranslationUnitContext::
    LoadResultTy
    loadFromDump(llvm::StringRef Identifier)

Description

Loads an AST from a pch-dump.

Declared at: clang/include/clang/CrossTU/CrossTranslationUnit.h:254

Parameters

llvm::StringRef Identifier

clang::cross_tu::CrossTranslationUnitContext::
    LoadResultTy
    loadFromSource(llvm::StringRef Identifier)

Description

Loads an AST from a source-file.

Declared at: clang/include/clang/CrossTU/CrossTranslationUnit.h:256

Parameters

llvm::StringRef Identifier