1 //===--- ExternalASTMerger.h - Merging External AST Interface ---*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file declares the ExternalASTMerger, which vends a combination of ASTs
11 // from several different ASTContext/FileManager pairs
13 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_CLANG_AST_EXTERNALASTMERGER_H
15 #define LLVM_CLANG_AST_EXTERNALASTMERGER_H
17 #include "clang/AST/ASTImporter.h"
18 #include "clang/AST/ExternalASTSource.h"
22 class ExternalASTMerger : public ExternalASTSource {
25 std::unique_ptr<ASTImporter> Forward;
26 std::unique_ptr<ASTImporter> Reverse;
30 std::vector<ImporterPair> Importers;
33 struct ImporterEndpoint {
37 ExternalASTMerger(const ImporterEndpoint &Target,
38 llvm::ArrayRef<ImporterEndpoint> Sources);
40 bool FindExternalVisibleDeclsByName(const DeclContext *DC,
41 DeclarationName Name) override;
44 FindExternalLexicalDecls(const DeclContext *DC,
45 llvm::function_ref<bool(Decl::Kind)> IsKindWeWant,
46 SmallVectorImpl<Decl *> &Result) override;
48 void CompleteType(TagDecl *Tag) override;
51 } // end namespace clang