14 #ifndef LLVM_CLANG_AST_EXTERNALASTMERGER_H 15 #define LLVM_CLANG_AST_EXTERNALASTMERGER_H 19 #include "llvm/Support/raw_ostream.h" 57 typedef std::map<const DeclContext *, DCOrigin>
OriginMap;
61 ImporterVector Importers;
66 llvm::raw_ostream *LogStream;
122 llvm::function_ref<
bool(
Decl::Kind)> IsKindWeWant,
155 void SetLogStream(llvm::raw_string_ostream &Stream) { LogStream = &Stream; }
163 template <
typename CallbackType>
164 void ForEachMatchingDC(
const DeclContext *DC, CallbackType Callback);
168 llvm::raw_ostream &
logs() {
return *LogStream; }
void MaybeRecordOrigin(const DeclContext *ToDC, DCOrigin Origin)
Records an origin in Origins only if name lookup would find something different or nothing at all...
const OriginMap & GetOrigins()
Get a read-only view of the Origins map, for use in constructing an ImporterSource for another Extern...
Implements support for file system lookup, file system caching, and directory search management...
bool HasImporterForOrigin(ASTContext &OriginContext)
Returns true if Importers contains an ASTImporter whose source is OriginContext.
void SetLogStream(llvm::raw_string_ostream &Stream)
Sets the current log stream.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
void AddSources(llvm::ArrayRef< ImporterSource > Sources)
Add a set of ASTContexts as possible origins.
The target for an ExternalASTMerger.
Represents an ObjC class declaration.
bool LoggingEnabled()
True if the log stream is not llvm::nulls();.
A single origin for a DeclContext.
bool FindExternalVisibleDeclsByName(const DeclContext *DC, DeclarationName Name) override
Implementation of the ExternalASTSource API.
The result type of a method or function.
Abstract interface for external sources of AST nodes.
ASTImporter & ImporterForOrigin(ASTContext &OriginContext)
Returns a reference to the ASTRImporter from Importers whose origin is OriginContext.
Represents the declaration of a struct/union/class/enum.
std::map< const DeclContext *, DCOrigin > OriginMap
std::vector< std::unique_ptr< ASTImporter > > ImporterVector
A source for an ExternalASTMerger.
Dataflow Directional Tag Classes.
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
bool CanComplete(DeclContext *DC)
Returns true if DC can be found in any source AST context.
The name of a declaration.
void RemoveSources(llvm::ArrayRef< ImporterSource > Sources)
Remove a set of ASTContexts as possible origins.
llvm::raw_ostream & logs()
Log something if there is a logging callback installed.
Imports selected nodes from one AST context into another context, merging AST nodes where appropriate...
void FindExternalLexicalDecls(const DeclContext *DC, llvm::function_ref< bool(Decl::Kind)> IsKindWeWant, SmallVectorImpl< Decl *> &Result) override
Implementation of the ExternalASTSource API.
void CompleteType(TagDecl *Tag) override
Implementation of the ExternalASTSource API.
void ForceRecordOrigin(const DeclContext *ToDC, DCOrigin Origin)
Regardless of any checks, override the Origin for a DeclContext.
Kind
Lists the kind of concrete classes of Decl.
ExternalASTSource implementation that merges information from several ASTContexts.
ExternalASTMerger(const ImporterTarget &Target, llvm::ArrayRef< ImporterSource > Sources)