|
clang 23.0.0git
|
Classes | |
| class | CrossTranslationUnitContext |
| This class is used for tools that requires cross translation unit capability. More... | |
| class | IndexError |
Typedefs | |
| using | InvocationListTy = llvm::StringMap<llvm::SmallVector<std::string, 32>> |
Functions | |
| llvm::Expected< llvm::StringMap< std::string > > | parseCrossTUIndex (StringRef IndexPath) |
| This function parses an index file that determines which translation unit contains which definition. | |
| std::string | createCrossTUIndexString (const llvm::StringMap< std::string > &Index) |
| llvm::Expected< InvocationListTy > | parseInvocationList (StringRef FileContent, llvm::sys::path::Style PathStyle=llvm::sys::path::Style::posix, StringRef FilePath="") |
Parse the YAML formatted invocation list file content FileContent. | |
| bool | shouldImport (const VarDecl *VD, const ASTContext &ACtx) |
| Returns true if it makes sense to import a foreign variable definition. | |
| static std::string | getLangDescription (const LangOptions &LO) |
| Returns a human-readable language/dialect description for diagnostics. | |
| static bool | parseCrossTUIndexItem (StringRef LineRef, StringRef &LookupName, StringRef &FilePath) |
| Parse one line of the input CTU index file. | |
| static bool | hasBodyOrInit (const FunctionDecl *D, const FunctionDecl *&DefD) |
| static bool | hasBodyOrInit (const VarDecl *D, const VarDecl *&DefD) |
| template<typename T> | |
| static bool | hasBodyOrInit (const T *D) |
| using clang::cross_tu::InvocationListTy = llvm::StringMap<llvm::SmallVector<std::string, 32>> |
Definition at line 102 of file CrossTranslationUnit.h.
|
strong |
Definition at line 40 of file CrossTranslationUnit.h.
| std::string clang::cross_tu::createCrossTUIndexString | ( | const llvm::StringMap< std::string > & | Index | ) |
Definition at line 241 of file CrossTranslationUnit.cpp.
References clang::Result.
|
static |
Returns a human-readable language/dialect description for diagnostics.
Checks flags from highest to lowest standard since they are cumulative (e.g. CPlusPlus20 implies CPlusPlus17). This does not cover all possible languages (e.g. Obj-C or flavors of C), because CTU currently does not differentiate between them.
Definition at line 150 of file CrossTranslationUnit.cpp.
|
static |
Definition at line 254 of file CrossTranslationUnit.cpp.
References clang::FunctionDecl::hasBody().
Referenced by hasBodyOrInit().
|
static |
Definition at line 260 of file CrossTranslationUnit.cpp.
References hasBodyOrInit(), and clang::Unused.
Definition at line 257 of file CrossTranslationUnit.cpp.
References clang::VarDecl::getAnyInitializer().
| llvm::Expected< llvm::StringMap< std::string > > clang::cross_tu::parseCrossTUIndex | ( | StringRef | IndexPath | ) |
This function parses an index file that determines which translation unit contains which definition.
The IndexPath is not prefixed with CTUDir, so an absolute path is expected for consistent results.
The index file format is the following: each line consists of an USR and a filepath separated by a space.
Definition at line 208 of file CrossTranslationUnit.cpp.
References invalid_index_format, clang::Line, missing_index_file, multiple_definitions, parseCrossTUIndexItem(), and clang::Result.
|
static |
Parse one line of the input CTU index file.
| [in] | LineRef | The input CTU index item in format "<USR-Length>:<USR> <File-Path>". |
| [out] | LookupName | The lookup name in format "<USR-Length>:<USR>". |
| [out] | FilePath | The file path "<File-Path>". |
Definition at line 184 of file CrossTranslationUnit.cpp.
Referenced by parseCrossTUIndex().
| llvm::Expected< InvocationListTy > clang::cross_tu::parseInvocationList | ( | StringRef | FileContent, |
| llvm::sys::path::Style | PathStyle = llvm::sys::path::Style::posix, | ||
| StringRef | FilePath = "" ) |
Parse the YAML formatted invocation list file content FileContent.
The format is expected to be a mapping from absolute source file paths in the filesystem to a list of command-line parts, which constitute the invocation needed to compile that file. That invocation will be used to produce the AST of the TU.
LLVM YAML parser is used to extract information from invocation list file.
Only the first document is processed.
There has to be at least one document available.
According to the format specified the document must be a mapping, where the keys are paths to source files, and values are sequences of invocation parts.
The keys should be strings, which represent a source-file path.
The values should be sequences of strings, each representing a part of the invocation.
Every conversion starts with an empty working storage, as it is not clear if this is a requirement of the YAML parser.
Definition at line 737 of file CrossTranslationUnit.cpp.
References invocation_list_ambiguous, invocation_list_empty, invocation_list_wrong_format, and SM.
| bool clang::cross_tu::shouldImport | ( | const VarDecl * | VD, |
| const ASTContext & | ACtx ) |
Returns true if it makes sense to import a foreign variable definition.
For instance, we don't want to import variables that have non-trivial types because the constructor might have side-effects.
Definition at line 249 of file CrossTranslationUnit.cpp.
References clang::ASTContext::getCanonicalType(), clang::ValueDecl::getType(), clang::CanQual< T >::isConstQualified(), and clang::QualType::isTrivialType().