clang 8.0.0

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, index_error_code::triple_mismatch, index_error_code::lang_mismatch }

## 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

enum clang::cross_tu::index_error_code
| strong

Enumerator
unspecified |
missing_index_file |
invalid_index_format |
multiple_definitions |
missing_definition |
failed_import |
failed_to_get_external_ast |
failed_to_generate_usr |
triple_mismatch |
lang_mismatch |

Definition at line 37 of file CrossTranslationUnit.h.

## Function Documentation

## ◆ createCrossTUIndexString()

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

Definition at line 152 of file CrossTranslationUnit.cpp.

Referenced by clang::cross_tu::IndexError::getTripleFromName().

## ◆ 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 122 of file CrossTranslationUnit.cpp.

References invalid_index_format, Line, missing_index_file, and multiple_definitions.

Referenced by clang::cross_tu::IndexError::getTripleFromName(), and clang::cross_tu::CrossTranslationUnitContext::loadExternalAST().