clang
10.0.0git
|
Imports selected nodes from one AST context into another context, merging AST nodes where appropriate. More...
#include "clang/AST/ASTImporter.h"
Classes | |
class | ImportPathTy |
Public Types | |
enum | ODRHandlingType { ODRHandlingType::Conservative, ODRHandlingType::Liberal } |
using | NonEquivalentDeclSet = llvm::DenseSet< std::pair< Decl *, Decl * > > |
using | ImportedCXXBaseSpecifierMap = llvm::DenseMap< const CXXBaseSpecifier *, CXXBaseSpecifier * > |
using | FileIDImportHandlerType = std::function< void(FileID, FileID)> |
Public Member Functions | |
ASTImporter (ASTContext &ToContext, FileManager &ToFileManager, ASTContext &FromContext, FileManager &FromFileManager, bool MinimalImport, std::shared_ptr< ASTImporterSharedState > SharedState=nullptr) | |
virtual | ~ASTImporter () |
void | setFileIDImportHandler (FileIDImportHandlerType H) |
Set a callback function for FileID import handling. More... | |
bool | isMinimalImport () const |
Whether the importer will perform a minimal import, creating to-be-completed forward declarations when possible. More... | |
void | setODRHandling (ODRHandlingType T) |
template<typename ImportT > | |
LLVM_NODISCARD llvm::Error | importInto (ImportT &To, const ImportT &From) |
Import the given object, returns the result. More... | |
llvm::Expected< QualType > | Import (QualType FromT) |
Import the given type from the "from" context into the "to" context. More... | |
llvm::Expected< TypeSourceInfo * > | Import (TypeSourceInfo *FromTSI) |
Import the given type source information from the "from" context into the "to" context. More... | |
llvm::Expected< Attr * > | Import (const Attr *FromAttr) |
Import the given attribute from the "from" context into the "to" context. More... | |
llvm::Expected< Decl * > | Import (Decl *FromD) |
Import the given declaration from the "from" context into the "to" context. More... | |
llvm::Expected< const Decl * > | Import (const Decl *FromD) |
Decl * | GetAlreadyImportedOrNull (const Decl *FromD) const |
Return the copy of the given declaration in the "to" context if it has already been imported from the "from" context. More... | |
TranslationUnitDecl * | GetFromTU (Decl *ToD) |
Return the translation unit from where the declaration was imported. More... | |
template<typename DeclT > | |
llvm::Optional< DeclT * > | getImportedFromDecl (const DeclT *ToD) const |
Return the declaration in the "from" context from which the declaration in the "to" context was imported. More... | |
llvm::Expected< DeclContext * > | ImportContext (DeclContext *FromDC) |
Import the given declaration context from the "from" AST context into the "to" AST context. More... | |
llvm::Expected< Expr * > | Import (Expr *FromE) |
Import the given expression from the "from" context into the "to" context. More... | |
llvm::Expected< Stmt * > | Import (Stmt *FromS) |
Import the given statement from the "from" context into the "to" context. More... | |
llvm::Expected< NestedNameSpecifier * > | Import (NestedNameSpecifier *FromNNS) |
Import the given nested-name-specifier from the "from" context into the "to" context. More... | |
llvm::Expected< NestedNameSpecifierLoc > | Import (NestedNameSpecifierLoc FromNNS) |
Import the given nested-name-specifier-loc from the "from" context into the "to" context. More... | |
llvm::Expected< TemplateName > | Import (TemplateName From) |
Import the given template name from the "from" context into the "to" context, or the import error. More... | |
llvm::Expected< SourceLocation > | Import (SourceLocation FromLoc) |
Import the given source location from the "from" context into the "to" context. More... | |
llvm::Expected< SourceRange > | Import (SourceRange FromRange) |
Import the given source range from the "from" context into the "to" context. More... | |
llvm::Expected< DeclarationName > | Import (DeclarationName FromName) |
Import the given declaration name from the "from" context into the "to" context. More... | |
IdentifierInfo * | Import (const IdentifierInfo *FromId) |
Import the given identifier from the "from" context into the "to" context. More... | |
llvm::Expected< Selector > | Import (Selector FromSel) |
Import the given Objective-C selector from the "from" context into the "to" context. More... | |
llvm::Expected< FileID > | Import (FileID, bool IsBuiltin=false) |
Import the given file ID from the "from" context into the "to" context. More... | |
llvm::Expected< CXXCtorInitializer * > | Import (CXXCtorInitializer *FromInit) |
Import the given C++ constructor initializer from the "from" context into the "to" context. More... | |
llvm::Expected< CXXBaseSpecifier * > | Import (const CXXBaseSpecifier *FromSpec) |
Import the given CXXBaseSpecifier from the "from" context into the "to" context. More... | |
LLVM_NODISCARD llvm::Error | ImportDefinition (Decl *From) |
Import the definition of the given declaration, including all of the declarations it contains. More... | |
virtual Expected< DeclarationName > | HandleNameConflict (DeclarationName Name, DeclContext *DC, unsigned IDNS, NamedDecl **Decls, unsigned NumDecls) |
Cope with a name conflict when importing a declaration into the given context. More... | |
ASTContext & | getToContext () const |
Retrieve the context that AST nodes are being imported into. More... | |
ASTContext & | getFromContext () const |
Retrieve the context that AST nodes are being imported from. More... | |
FileManager & | getToFileManager () const |
Retrieve the file manager that AST nodes are being imported into. More... | |
FileManager & | getFromFileManager () const |
Retrieve the file manager that AST nodes are being imported from. More... | |
DiagnosticBuilder | ToDiag (SourceLocation Loc, unsigned DiagID) |
Report a diagnostic in the "to" context. More... | |
DiagnosticBuilder | FromDiag (SourceLocation Loc, unsigned DiagID) |
Report a diagnostic in the "from" context. More... | |
NonEquivalentDeclSet & | getNonEquivalentDecls () |
Return the set of declarations that we know are not equivalent. More... | |
virtual void | CompleteDecl (Decl *D) |
Called for ObjCInterfaceDecl, ObjCProtocolDecl, and TagDecl. More... | |
virtual void | Imported (Decl *From, Decl *To) |
Subclasses can override this function to observe all of the From -> To declaration mappings as they are imported. More... | |
void | RegisterImportedDecl (Decl *FromD, Decl *ToD) |
Decl * | MapImported (Decl *From, Decl *To) |
Store and assign the imported declaration to its counterpart. More... | |
virtual Decl * | GetOriginalDecl (Decl *To) |
Called by StructuralEquivalenceContext. More... | |
llvm::Optional< ImportError > | getImportDeclErrorIfAny (Decl *FromD) const |
Return if import of the given declaration has failed and if yes the kind of the problem. More... | |
void | setImportDeclError (Decl *From, ImportError Error) |
Mark (newly) imported declaration with error. More... | |
bool | IsStructurallyEquivalent (QualType From, QualType To, bool Complain=true) |
Determine whether the given types are structurally equivalent. More... | |
Static Public Member Functions | |
static llvm::Optional< unsigned > | getFieldIndex (Decl *F) |
Determine the index of a field in its parent record. More... | |
Protected Member Functions | |
virtual Expected< Decl * > | ImportImpl (Decl *From) |
Can be overwritten by subclasses to implement their own import logic. More... | |
virtual bool | returnWithErrorInTest () |
Used only in unittests to verify the behaviour of the error handling. More... | |
Friends | |
class | ASTNodeImporter |
Imports selected nodes from one AST context into another context, merging AST nodes where appropriate.
Definition at line 88 of file ASTImporter.h.
using clang::ASTImporter::FileIDImportHandlerType = std::function<void(FileID , FileID )> |
Definition at line 95 of file ASTImporter.h.
using clang::ASTImporter::ImportedCXXBaseSpecifierMap = llvm::DenseMap<const CXXBaseSpecifier *, CXXBaseSpecifier *> |
Definition at line 93 of file ASTImporter.h.
using clang::ASTImporter::NonEquivalentDeclSet = llvm::DenseSet<std::pair<Decl *, Decl *> > |
Definition at line 91 of file ASTImporter.h.
|
strong |
Enumerator | |
---|---|
Conservative | |
Liberal |
Definition at line 97 of file ASTImporter.h.
ASTImporter::ASTImporter | ( | ASTContext & | ToContext, |
FileManager & | ToFileManager, | ||
ASTContext & | FromContext, | ||
FileManager & | FromFileManager, | ||
bool | MinimalImport, | ||
std::shared_ptr< ASTImporterSharedState > | SharedState = nullptr |
||
) |
ToContext | The context we'll be importing into. |
ToFileManager | The file manager we'll be importing into. |
FromContext | The context we'll be importing from. |
FromFileManager | The file manager we'll be importing into. |
MinimalImport | If true, the importer will attempt to import as little as it can, e.g., by importing declarations as forward declarations that can be completed at a later point. |
SharedState | The importer specific lookup table which may be shared amongst several ASTImporter objects. If not set then the original C/C++ lookup is used. |
Definition at line 8014 of file ASTImporter.cpp.
References clang::ASTContext::getTranslationUnitDecl(), and ~ASTImporter().
|
virtualdefault |
Referenced by ASTImporter().
|
virtual |
Called for ObjCInterfaceDecl, ObjCProtocolDecl, and TagDecl.
Mark the Decl as complete, filling it in as much as possible.
D | A declaration in the "to" context. |
Definition at line 8982 of file ASTImporter.cpp.
Referenced by ImportContext().
DiagnosticBuilder ASTImporter::FromDiag | ( | SourceLocation | Loc, |
unsigned | DiagID | ||
) |
Report a diagnostic in the "from" context.
Definition at line 8974 of file ASTImporter.cpp.
References clang::ASTContext::getDiagnostics(), clang::DiagnosticsEngine::notePriorDiagnosticFrom(), and clang::DiagnosticsEngine::Report().
Return the copy of the given declaration in the "to" context if it has already been imported from the "from" context.
Otherwise return nullptr.
Definition at line 8152 of file ASTImporter.cpp.
Referenced by Import().
Determine the index of a field in its parent record.
F should be a field (or indirect field) declaration.
None
is returned (parent context is non-record). Definition at line 8033 of file ASTImporter.cpp.
References clang::Decl::getDeclContext(), and clang::None.
|
inline |
Retrieve the context that AST nodes are being imported from.
Definition at line 540 of file ASTImporter.h.
|
inline |
Retrieve the file manager that AST nodes are being imported from.
Definition at line 546 of file ASTImporter.h.
TranslationUnitDecl * ASTImporter::GetFromTU | ( | Decl * | ToD | ) |
Return the translation unit from where the declaration was imported.
If it does not exist nullptr is returned.
Definition at line 8160 of file ASTImporter.cpp.
llvm::Optional< ImportError > ASTImporter::getImportDeclErrorIfAny | ( | Decl * | FromD | ) | const |
Return if import of the given declaration has failed and if yes the kind of the problem.
This gives the first error encountered with the node.
Definition at line 9017 of file ASTImporter.cpp.
Referenced by Import().
|
inline |
Return the declaration in the "from" context from which the declaration in the "to" context was imported.
If it was not imported or of the wrong type a null value is returned.
Definition at line 395 of file ASTImporter.h.
References clang::Error.
|
inline |
Return the set of declarations that we know are not equivalent.
Definition at line 555 of file ASTImporter.h.
Called by StructuralEquivalenceContext.
If a RecordDecl is being compared to another RecordDecl as part of import, completing the other RecordDecl may trigger importation of the first RecordDecl. This happens especially for anonymous structs. If the original of the second RecordDecl can be found, we can complete it without the need for importation, eliminating this loop.
Definition at line 580 of file ASTImporter.h.
References clang::ImportError::Error, and IsStructurallyEquivalent().
|
inline |
Retrieve the context that AST nodes are being imported into.
Definition at line 537 of file ASTImporter.h.
|
inline |
Retrieve the file manager that AST nodes are being imported into.
Definition at line 543 of file ASTImporter.h.
|
virtual |
Cope with a name conflict when importing a declaration into the given context.
This routine is invoked whenever there is a name conflict while importing a declaration. The returned name will become the name of the imported declaration. By default, the returned name is the same as the original name, leaving the conflict unresolve such that name lookup for this name is likely to find an ambiguity later.
Subclasses may override this routine to resolve the conflict, e.g., by renaming the declaration being imported.
Name | the name of the declaration being imported, which conflicts with other declarations. |
DC | the declaration context (in the "to" AST context) in which the name is being imported. |
IDNS | the identifier namespace in which the name will be found. |
Decls | the set of declarations with the same name as the declaration being imported. |
NumDecls | the number of conflicting declarations in Decls . |
Definition at line 8953 of file ASTImporter.cpp.
References Conservative, and clang::ImportError::NameConflict.
Import the given type from the "from" context into the "to" context.
A null type is imported as a null type (no error).
Definition at line 8102 of file ASTImporter.cpp.
References clang::QualType::getLocalQualifiers(), clang::ASTContext::getQualifiedType(), clang::QualType::getTypePtr(), clang::QualType::isNull(), and clang::TypeVisitor< ImplClass, RetTy >::Visit().
Referenced by clang::ExternalASTMerger::FindExternalLexicalDecls(), clang::ExternalASTMerger::FindExternalVisibleDeclsByName(), Import(), ImportContext(), ImportDefinition(), importSpecializations(), IsStructurallyEquivalent(), and setTypedefNameForAnonDecl().
Expected< TypeSourceInfo * > ASTImporter::Import | ( | TypeSourceInfo * | FromTSI | ) |
Import the given type source information from the "from" context into the "to" context.
Definition at line 8126 of file ASTImporter.cpp.
References clang::TypeLoc::getBeginLoc(), clang::ASTContext::getTrivialTypeSourceInfo(), clang::TypeSourceInfo::getType(), clang::TypeSourceInfo::getTypeLoc(), and Import().
Import the given attribute from the "from" context into the "to" context.
Definition at line 8142 of file ASTImporter.cpp.
References clang::Attr::clone(), clang::AttributeCommonInfo::getRange(), Import(), and clang::AttributeCommonInfo::setRange().
Import the given declaration from the "from" context into the "to" context.
Definition at line 8167 of file ASTImporter.cpp.
References clang::ASTImporter::ImportPathTy::copyCycleAtBack(), clang::Error, GetAlreadyImportedOrNull(), getImportDeclErrorIfAny(), clang::ASTImporter::ImportPathTy::hasCycleAtBack(), Imported(), ImportImpl(), clang::ASTImporter::ImportPathTy::pop(), clang::ASTImporter::ImportPathTy::push(), setImportDeclError(), and clang::updateFlags().
|
inline |
Definition at line 378 of file ASTImporter.h.
Import the given expression from the "from" context into the "to" context.
Definition at line 8353 of file ASTImporter.cpp.
References Import().
Import the given statement from the "from" context into the "to" context.
Definition at line 8360 of file ASTImporter.cpp.
Expected< NestedNameSpecifier * > ASTImporter::Import | ( | NestedNameSpecifier * | FromNNS | ) |
Import the given nested-name-specifier from the "from" context into the "to" context.
Definition at line 8394 of file ASTImporter.cpp.
References clang::NestedNameSpecifier::Create(), clang::Error, clang::NestedNameSpecifier::getAsIdentifier(), clang::NestedNameSpecifier::getAsNamespace(), clang::NestedNameSpecifier::getAsNamespaceAlias(), clang::NestedNameSpecifier::getAsRecordDecl(), clang::NestedNameSpecifier::getAsType(), clang::NestedNameSpecifier::getKind(), clang::NestedNameSpecifier::getPrefix(), clang::NestedNameSpecifier::Global, clang::NestedNameSpecifier::GlobalSpecifier(), clang::NestedNameSpecifier::Identifier, Import(), importInto(), clang::NestedNameSpecifier::Namespace, clang::NestedNameSpecifier::NamespaceAlias, clang::NestedNameSpecifier::Super, clang::NestedNameSpecifier::SuperSpecifier(), clang::NestedNameSpecifier::TypeSpec, and clang::NestedNameSpecifier::TypeSpecWithTemplate.
Expected< NestedNameSpecifierLoc > ASTImporter::Import | ( | NestedNameSpecifierLoc | FromNNS | ) |
Import the given nested-name-specifier-loc from the "from" context into the "to" context.
Definition at line 8449 of file ASTImporter.cpp.
References clang::NestedNameSpecifierLoc::getPrefix().
Expected< TemplateName > ASTImporter::Import | ( | TemplateName | From | ) |
Import the given template name from the "from" context into the "to" context, or the import error.
Definition at line 8534 of file ASTImporter.cpp.
References clang::UnresolvedSetImpl::addDecl(), clang::TemplateName::AssumedTemplate, clang::UnresolvedSetImpl::begin(), clang::TemplateName::DependentTemplate, clang::UnresolvedSetImpl::end(), clang::SubstTemplateTemplateParmPackStorage::getArgumentPack(), clang::TemplateName::getAsAssumedTemplateName(), clang::TemplateName::getAsDependentTemplateName(), clang::TemplateName::getAsOverloadedTemplate(), clang::TemplateName::getAsQualifiedTemplateName(), clang::TemplateName::getAsSubstTemplateTemplateParm(), clang::TemplateName::getAsSubstTemplateTemplateParmPack(), clang::ASTContext::getAssumedTemplateName(), clang::TemplateName::getAsTemplateDecl(), clang::AssumedTemplateStorage::getDeclName(), clang::ASTContext::getDependentTemplateName(), clang::DependentTemplateName::getIdentifier(), clang::TemplateName::getKind(), clang::DependentTemplateName::getOperator(), clang::ASTContext::getOverloadedTemplateName(), clang::SubstTemplateTemplateParmStorage::getParameter(), clang::SubstTemplateTemplateParmPackStorage::getParameterPack(), clang::ASTContext::getQualifiedTemplateName(), clang::QualifiedTemplateName::getQualifier(), clang::DependentTemplateName::getQualifier(), clang::SubstTemplateTemplateParmStorage::getReplacement(), clang::ASTContext::getSubstTemplateTemplateParm(), clang::ASTContext::getSubstTemplateTemplateParmPack(), clang::QualifiedTemplateName::hasTemplateKeyword(), Import(), clang::ASTNodeImporter::ImportTemplateArgument(), clang::DependentTemplateName::isIdentifier(), clang::TemplateName::OverloadedTemplate, clang::TemplateName::QualifiedTemplate, clang::TemplateName::SubstTemplateTemplateParm, clang::TemplateName::SubstTemplateTemplateParmPack, and clang::TemplateName::Template.
Expected< SourceLocation > ASTImporter::Import | ( | SourceLocation | FromLoc | ) |
Import the given source location from the "from" context into the "to" context.
Definition at line 8628 of file ASTImporter.cpp.
References clang::SourceManager::getComposedLoc(), clang::SourceManager::getDecomposedLoc(), clang::ASTContext::getSourceManager(), Import(), clang::SourceLocation::isInvalid(), and clang::SourceManager::isWrittenInBuiltinFile().
Expected< SourceRange > ASTImporter::Import | ( | SourceRange | FromRange | ) |
Import the given source range from the "from" context into the "to" context.
Definition at line 8643 of file ASTImporter.cpp.
References clang::Error, clang::SourceRange::getBegin(), clang::SourceRange::getEnd(), and importInto().
Expected< DeclarationName > ASTImporter::Import | ( | DeclarationName | FromName | ) |
Import the given declaration name from the "from" context into the "to" context.
Definition at line 8866 of file ASTImporter.cpp.
References clang::DeclarationName::CXXConstructorName, clang::DeclarationName::CXXConversionFunctionName, clang::DeclarationName::CXXDeductionGuideName, clang::DeclarationName::CXXDestructorName, clang::DeclarationName::CXXLiteralOperatorName, clang::DeclarationName::CXXOperatorName, clang::DeclarationName::CXXUsingDirective, clang::ASTContext::DeclarationNames, clang::DeclarationName::getAsIdentifierInfo(), clang::ASTContext::getCanonicalType(), clang::DeclarationNameTable::getCXXConstructorName(), clang::DeclarationNameTable::getCXXConversionFunctionName(), clang::DeclarationNameTable::getCXXDeductionGuideName(), clang::DeclarationName::getCXXDeductionGuideTemplate(), clang::DeclarationNameTable::getCXXDestructorName(), clang::DeclarationName::getCXXLiteralIdentifier(), clang::DeclarationNameTable::getCXXLiteralOperatorName(), clang::DeclarationName::getCXXNameType(), clang::DeclarationNameTable::getCXXOperatorName(), clang::DeclarationName::getCXXOverloadedOperator(), clang::DeclarationName::getNameKind(), clang::DeclarationName::getObjCSelector(), clang::DeclarationName::getUsingDirectiveName(), clang::DeclarationName::Identifier, Import(), clang::DeclarationName::ObjCMultiArgSelector, clang::DeclarationName::ObjCOneArgSelector, and clang::DeclarationName::ObjCZeroArgSelector.
IdentifierInfo * ASTImporter::Import | ( | const IdentifierInfo * | FromId | ) |
Import the given identifier from the "from" context into the "to" context.
Definition at line 8930 of file ASTImporter.cpp.
References clang::IdentifierTable::get(), clang::IdentifierInfo::getBuiltinID(), clang::IdentifierInfo::getName(), clang::ASTContext::Idents, and clang::IdentifierInfo::setBuiltinID().
Import the given Objective-C selector from the "from" context into the "to" context.
Definition at line 8942 of file ASTImporter.cpp.
References clang::Selector::getIdentifierInfoForSlot(), clang::Selector::getNumArgs(), clang::SelectorTable::getSelector(), Import(), clang::Selector::isNull(), and clang::ASTContext::Selectors.
Import the given file ID from the "from" context into the "to" context.
Definition at line 8653 of file ASTImporter.cpp.
References clang::SourceManager::createExpansionLoc(), clang::SourceManager::createFileID(), clang::SourceManager::createMacroArgExpansionLoc(), clang::SrcMgr::ContentCache::getBuffer(), clang::SrcMgr::FileInfo::getContentCache(), clang::ASTContext::getDiagnostics(), clang::FileEntry::getDir(), clang::SrcMgr::SLocEntry::getExpansion(), clang::SrcMgr::ExpansionInfo::getExpansionLocEnd(), clang::SrcMgr::ExpansionInfo::getExpansionLocStart(), clang::FileManager::getFile(), clang::SrcMgr::SLocEntry::getFile(), clang::SrcMgr::FileInfo::getFileCharacteristic(), clang::SourceManager::getFileID(), clang::SrcMgr::FileInfo::getIncludeLoc(), clang::FileEntry::getName(), clang::ASTContext::getSourceManager(), clang::SrcMgr::ExpansionInfo::getSpellingLoc(), Import(), clang::SrcMgr::SLocEntry::isExpansion(), clang::SrcMgr::ExpansionInfo::isExpansionTokenRange(), clang::FileID::isInvalid(), clang::SrcMgr::ExpansionInfo::isMacroArgExpansion(), clang::FileID::isValid(), clang::SrcMgr::ContentCache::OrigEntry, and clang::ImportError::Unknown.
Expected< CXXCtorInitializer * > ASTImporter::Import | ( | CXXCtorInitializer * | FromInit | ) |
Import the given C++ constructor initializer from the "from" context into the "to" context.
Definition at line 8737 of file ASTImporter.cpp.
References clang::Error, clang::CXXCtorInitializer::getEllipsisLoc(), clang::CXXCtorInitializer::getIndirectMember(), clang::CXXCtorInitializer::getInit(), clang::CXXCtorInitializer::getLParenLoc(), clang::CXXCtorInitializer::getMember(), clang::CXXCtorInitializer::getMemberLocation(), clang::CXXCtorInitializer::getRParenLoc(), clang::CXXCtorInitializer::getTypeSourceInfo(), Import(), importInto(), clang::CXXCtorInitializer::isBaseInitializer(), clang::CXXCtorInitializer::isBaseVirtual(), clang::CXXCtorInitializer::isDelegatingInitializer(), clang::CXXCtorInitializer::isIndirectMemberInitializer(), clang::CXXCtorInitializer::isMemberInitializer(), and clang::CXXCtorInitializer::isPackExpansion().
Expected< CXXBaseSpecifier * > ASTImporter::Import | ( | const CXXBaseSpecifier * | FromSpec | ) |
Import the given CXXBaseSpecifier from the "from" context into the "to" context.
Definition at line 8802 of file ASTImporter.cpp.
References clang::CXXBaseSpecifier::getAccessSpecifierAsWritten(), clang::CXXBaseSpecifier::getEllipsisLoc(), clang::CXXBaseSpecifier::getSourceRange(), clang::CXXBaseSpecifier::getTypeSourceInfo(), Import(), Imported(), clang::CXXBaseSpecifier::isBaseOfClass(), and clang::CXXBaseSpecifier::isVirtual().
Expected< DeclContext * > ASTImporter::ImportContext | ( | DeclContext * | FromDC | ) |
Import the given declaration context from the "from" AST context into the "to" AST context.
Definition at line 8293 of file ASTImporter.cpp.
References ASTNodeImporter, CompleteDecl(), clang::Error, clang::ObjCInterfaceDecl::getDefinition(), clang::ObjCProtocolDecl::getDefinition(), clang::ASTNodeImporter::IDK_Basic, and Import().
Import the definition of the given declaration, including all of the declarations it contains.
Definition at line 8823 of file ASTImporter.cpp.
References clang::ASTNodeImporter::IDK_Everything, and Import().
Referenced by clang::ExternalASTMerger::CompleteType().
Subclasses can override this function to observe all of the From
-> To
declaration mappings as they are imported.
Definition at line 565 of file ASTImporter.h.
Referenced by Import().
Can be overwritten by subclasses to implement their own import logic.
The overwritten method should call this method if it didn't import the decl on its own.
Definition at line 8092 of file ASTImporter.cpp.
References clang::TypeVisitor< ImplClass, RetTy >::Visit().
Referenced by Import().
|
inline |
Import the given object, returns the result.
To | Import the object into this variable. |
From | Object to import. |
Definition at line 345 of file ASTImporter.h.
Referenced by Import().
|
inline |
Whether the importer will perform a minimal import, creating to-be-completed forward declarations when possible.
Definition at line 335 of file ASTImporter.h.
References clang::Minimal.
Referenced by getStructuralEquivalenceKind(), and clang::ASTNodeImporter::shouldForceImportDeclContext().
Determine whether the given types are structurally equivalent.
Definition at line 9033 of file ASTImporter.cpp.
References getStructuralEquivalenceKind(), clang::QualType::getTypePtr(), clang::ASTContext::hasSameType(), and Import().
Store and assign the imported declaration to its counterpart.
It may happen that several decls from the 'from' context are mapped to the same decl in the 'to' context.
Definition at line 9002 of file ASTImporter.cpp.
Referenced by clang::ExternalASTMerger::CompleteType(), and RegisterImportedDecl().
Definition at line 8098 of file ASTImporter.cpp.
References MapImported().
|
inlineprotectedvirtual |
Used only in unittests to verify the behaviour of the error handling.
Definition at line 299 of file ASTImporter.h.
|
inline |
Set a callback function for FileID import handling.
The function is invoked when a FileID is imported from the From context. The imported FileID in the To context and the original FileID in the From context is passed to it.
Definition at line 329 of file ASTImporter.h.
Referenced by clang::cross_tu::CrossTranslationUnitContext::importDefinition().
void ASTImporter::setImportDeclError | ( | Decl * | From, |
ImportError | Error | ||
) |
Mark (newly) imported declaration with error.
Definition at line 9025 of file ASTImporter.cpp.
References clang::ImportError::Error.
Referenced by Import().
|
inline |
Definition at line 337 of file ASTImporter.h.
DiagnosticBuilder ASTImporter::ToDiag | ( | SourceLocation | Loc, |
unsigned | DiagID | ||
) |
Report a diagnostic in the "to" context.
Definition at line 8966 of file ASTImporter.cpp.
References clang::ASTContext::getDiagnostics(), clang::DiagnosticsEngine::notePriorDiagnosticFrom(), and clang::DiagnosticsEngine::Report().
|
friend |
Definition at line 89 of file ASTImporter.h.
Referenced by ImportContext().