clang  6.0.0svn
Classes | Enumerations | Functions
clang::cross_tu Namespace Reference

Classes

class  CrossTranslationUnitContext
 This class is used for tools that requires cross translation unit capability. More...
 
class  IndexError
 

Enumerations

enum  index_error_code {
  index_error_code::unspecified = 1, index_error_code::missing_index_file, index_error_code::invalid_index_format, index_error_code::multiple_definitions,
  index_error_code::missing_definition, index_error_code::failed_import, index_error_code::failed_to_get_external_ast, index_error_code::failed_to_generate_usr
}
 

Functions

llvm::Expected< llvm::StringMap< std::string > > parseCrossTUIndex (StringRef IndexPath, StringRef CrossTUDir)
 This function parses an index file that determines which translation unit contains which definition. More...
 
std::string createCrossTUIndexString (const llvm::StringMap< std::string > &Index)
 

Enumeration Type Documentation

◆ index_error_code

Enumerator
unspecified 
missing_index_file 
invalid_index_format 
multiple_definitions 
missing_definition 
failed_import 
failed_to_get_external_ast 
failed_to_generate_usr 

Definition at line 36 of file CrossTranslationUnit.h.

Function Documentation

◆ createCrossTUIndexString()

std::string clang::cross_tu::createCrossTUIndexString ( const llvm::StringMap< std::string > &  Index)

Definition at line 110 of file CrossTranslationUnit.cpp.

◆ parseCrossTUIndex()

llvm::Expected< llvm::StringMap< std::string > > clang::cross_tu::parseCrossTUIndex ( StringRef  IndexPath,
StringRef  CrossTUDir 
)

This function parses an index file that determines which translation unit contains which definition.

The index file format is the following: each line consists of an USR and a filepath separated by a space.

Returns
Returns a map where the USR is the key and the filepath is the value or an error.

Definition at line 77 of file CrossTranslationUnit.cpp.

References Line, missing_index_file, and multiple_definitions.

Referenced by clang::cross_tu::CrossTranslationUnitContext::loadExternalAST().