15 #ifndef LLVM_CLANG_CROSSTU_CROSSTRANSLATIONUNIT_H 16 #define LLVM_CLANG_CROSSTU_CROSSTRANSLATIONUNIT_H 19 #include "llvm/ADT/DenseMap.h" 20 #include "llvm/ADT/SmallPtrSet.h" 21 #include "llvm/ADT/StringMap.h" 22 #include "llvm/Support/Error.h" 25 class CompilerInstance;
32 class TranslationUnitDecl;
52 : Code(C), FileName(
std::move(FileName)), LineNo(LineNo) {}
53 void log(raw_ostream &OS)
const override;
54 std::error_code convertToErrorCode()
const override;
110 getCrossTUDefinition(
const FunctionDecl *FD, StringRef CrossTUDir,
111 StringRef IndexName);
126 StringRef CrossTUDir,
127 StringRef IndexName);
137 static std::string getLookupName(
const NamedDecl *ND);
140 void emitCrossTUDiagnostics(
const IndexError &IE);
145 StringRef LookupFnName);
147 llvm::StringMap<std::unique_ptr<clang::ASTUnit>> FileASTUnitMap;
148 llvm::StringMap<clang::ASTUnit *> FunctionASTUnitMap;
149 llvm::StringMap<std::string> FunctionFileMap;
150 llvm::DenseMap<TranslationUnitDecl *, std::unique_ptr<ASTImporter>>
159 #endif // LLVM_CLANG_CROSSTU_CROSSTRANSLATIONUNIT_H An instance of this class is created to represent a function declaration or definition.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified...
std::string createCrossTUIndexString(const llvm::StringMap< std::string > &Index)
std::string getFileName() const
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...
CompilerInstance - Helper class for managing a single instance of the Clang compiler.
Dataflow Directional Tag Classes.
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
This class is used for tools that requires cross translation unit capability.
index_error_code getCode() const
Imports selected nodes from one AST context into another context, merging AST nodes where appropriate...
IndexError(index_error_code C, std::string FileName, int LineNo=0)
NamedDecl - This represents a decl with a name.
IndexError(index_error_code C)