13#ifndef LLVM_CLANG_AST_EXTERNALASTMERGER_H
14#define LLVM_CLANG_AST_EXTERNALASTMERGER_H
19#include "llvm/Support/raw_ostream.h"
57 typedef std::map<const DeclContext *, DCOrigin>
OriginMap;
66 llvm::raw_ostream *LogStream;
97 : AST(AST), FM(FM), OM(OM), Temporary(Temporary), Merger(Merger) {}
112 std::shared_ptr<ASTImporterSharedState> SharedState;
149 llvm::function_ref<
bool(
Decl::Kind)> IsKindWeWant,
182 void SetLogStream(llvm::raw_string_ostream &Stream) { LogStream = &Stream; }
185 void RecordOriginImpl(
const DeclContext *ToDC, DCOrigin Origin,
190 template <
typename CallbackType>
191 void ForEachMatchingDC(
const DeclContext *DC, CallbackType Callback);
195 llvm::raw_ostream &
logs() {
return *LogStream; }
llvm::MachO::Target Target
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Imports selected nodes from one AST context into another context, merging AST nodes where appropriate...
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
Decl - This represents one declaration (or definition), e.g.
Kind
Lists the kind of concrete classes of Decl.
The name of a declaration.
A source for an ExternalASTMerger.
FileManager & getFileManager() const
ImporterSource(ASTContext &AST, FileManager &FM, const OriginMap &OM, bool Temporary=false, ExternalASTMerger *Merger=nullptr)
const OriginMap & getOriginMap() const
ASTContext & getASTContext() const
ExternalASTMerger * getMerger() const
ExternalASTSource implementation that merges information from several ASTContexts.
llvm::raw_ostream & logs()
Log something if there is a logging callback installed.
void AddSources(llvm::ArrayRef< ImporterSource > Sources)
Add a set of ASTContexts as possible origins.
bool FindExternalVisibleDeclsByName(const DeclContext *DC, DeclarationName Name) override
Implementation of the ExternalASTSource API.
ASTImporter & ImporterForOrigin(ASTContext &OriginContext)
Returns a reference to the ASTImporter from Importers whose origin is OriginContext.
Decl * FindOriginalDecl(Decl *D)
Asks all connected ASTImporters if any of them imported the given declaration.
void CompleteType(TagDecl *Tag) override
Implementation of the ExternalASTSource API.
const OriginMap & GetOrigins()
Get a read-only view of the Origins map, for use in constructing an ImporterSource for another Extern...
void MaybeRecordOrigin(const DeclContext *ToDC, DCOrigin Origin)
Records an origin in Origins only if name lookup would find something different or nothing at all.
void RemoveSources(llvm::ArrayRef< ImporterSource > Sources)
Remove a set of ASTContexts as possible origins.
std::map< const DeclContext *, DCOrigin > OriginMap
void ForceRecordOrigin(const DeclContext *ToDC, DCOrigin Origin)
Regardless of any checks, override the Origin for a DeclContext.
bool CanComplete(DeclContext *DC)
Returns true if DC can be found in any source AST context.
std::vector< std::unique_ptr< ASTImporter > > ImporterVector
bool LoggingEnabled()
True if the log stream is not llvm::nulls();.
bool HasImporterForOrigin(ASTContext &OriginContext)
Returns true if Importers contains an ASTImporter whose source is OriginContext.
void FindExternalLexicalDecls(const DeclContext *DC, llvm::function_ref< bool(Decl::Kind)> IsKindWeWant, SmallVectorImpl< Decl * > &Result) override
Implementation of the ExternalASTSource API.
void SetLogStream(llvm::raw_string_ostream &Stream)
Sets the current log stream.
Abstract interface for external sources of AST nodes.
Implements support for file system lookup, file system caching, and directory search management.
Represents an ObjC class declaration.
Represents the declaration of a struct/union/class/enum.
The JSON file list parser is used to communicate input to InstallAPI.
@ Result
The result type of a method or function.
@ Interface
The "__interface" keyword introduces the elaborated-type-specifier.
A single origin for a DeclContext.
The target for an ExternalASTMerger.