14#ifndef LLVM_CLANG_AST_ASTIMPORTERSHAREDSTATE_H
15#define LLVM_CLANG_AST_ASTIMPORTERSHAREDSTATE_H
20#include "llvm/ADT/DenseMap.h"
25class TranslationUnitDecl;
32 std::unique_ptr<ASTImporterLookupTable> LookupTable;
40 llvm::DenseMap<Decl *, ASTImportError> ImportErrors;
43 llvm::DenseSet<Decl *> NewDecls;
52 LookupTable = std::make_unique<ASTImporterLookupTable>(ToTU);
59 if (
auto *ND = dyn_cast<NamedDecl>(
D))
65 if (
auto *ND = dyn_cast<NamedDecl>(
D))
66 LookupTable->remove(ND);
70 auto Pos = ImportErrors.find(ToD);
71 if (Pos != ImportErrors.end())
78 ImportErrors[To] = Error;
Importer specific state, which may be shared amongst several ASTImporter objects.
void setImportDeclError(Decl *To, ASTImportError Error)
ASTImporterSharedState()=default
void markAsNewDecl(Decl *ToD)
ASTImporterSharedState(TranslationUnitDecl &ToTU)
void removeDeclFromLookup(Decl *D)
void addDeclToLookup(Decl *D)
ASTImporterLookupTable * getLookupTable()
bool isNewDecl(const Decl *ToD) const
std::optional< ASTImportError > getImportDeclErrorIfAny(Decl *ToD) const
Decl - This represents one declaration (or definition), e.g.
The top declaration context.
The JSON file list parser is used to communicate input to InstallAPI.