clang
8.0.0
|
Imports selected nodes from one AST context into another context, merging AST nodes where appropriate. More...
#include "clang/AST/ASTImporter.h"
Public Types | |
using | NonEquivalentDeclSet = llvm::DenseSet< std::pair< Decl *, Decl * > > |
using | ImportedCXXBaseSpecifierMap = llvm::DenseMap< const CXXBaseSpecifier *, CXXBaseSpecifier * > |
Public Member Functions | |
ASTImporter (ASTContext &ToContext, FileManager &ToFileManager, ASTContext &FromContext, FileManager &FromFileManager, bool MinimalImport, ASTImporterLookupTable *LookupTable=nullptr) | |
virtual | ~ASTImporter () |
bool | isMinimalImport () const |
Whether the importer will perform a minimal import, creating to-be-completed forward declarations when possible. More... | |
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_New (QualType FromT) |
Import the given type from the "from" context into the "to" context. More... | |
QualType | Import (QualType FromT) |
llvm::Expected< TypeSourceInfo * > | Import_New (TypeSourceInfo *FromTSI) |
Import the given type source information from the "from" context into the "to" context. More... | |
TypeSourceInfo * | Import (TypeSourceInfo *FromTSI) |
llvm::Expected< Attr * > | Import_New (const Attr *FromAttr) |
Import the given attribute from the "from" context into the "to" context. More... | |
Attr * | Import (const Attr *FromAttr) |
llvm::Expected< Decl * > | Import_New (Decl *FromD) |
Import the given declaration from the "from" context into the "to" context. More... | |
llvm::Expected< Decl * > | Import_New (const Decl *FromD) |
Decl * | Import (Decl *FromD) |
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... | |
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_New (Expr *FromE) |
Import the given expression from the "from" context into the "to" context. More... | |
Expr * | Import (Expr *FromE) |
llvm::Expected< Stmt * > | Import_New (Stmt *FromS) |
Import the given statement from the "from" context into the "to" context. More... | |
Stmt * | Import (Stmt *FromS) |
llvm::Expected< NestedNameSpecifier * > | Import_New (NestedNameSpecifier *FromNNS) |
Import the given nested-name-specifier from the "from" context into the "to" context. More... | |
NestedNameSpecifier * | Import (NestedNameSpecifier *FromNNS) |
llvm::Expected< NestedNameSpecifierLoc > | Import_New (NestedNameSpecifierLoc FromNNS) |
Import the given nested-name-specifier-loc from the "from" context into the "to" context. More... | |
NestedNameSpecifierLoc | Import (NestedNameSpecifierLoc FromNNS) |
llvm::Expected< TemplateName > | Import_New (TemplateName From) |
Import the given template name from the "from" context into the "to" context, or the import error. More... | |
TemplateName | Import (TemplateName From) |
llvm::Expected< SourceLocation > | Import_New (SourceLocation FromLoc) |
Import the given source location from the "from" context into the "to" context. More... | |
SourceLocation | Import (SourceLocation FromLoc) |
llvm::Expected< SourceRange > | Import_New (SourceRange FromRange) |
Import the given source range from the "from" context into the "to" context. More... | |
SourceRange | Import (SourceRange FromRange) |
llvm::Expected< DeclarationName > | Import_New (DeclarationName FromName) |
Import the given declaration name from the "from" context into the "to" context. More... | |
DeclarationName | Import (DeclarationName FromName) |
IdentifierInfo * | Import (const IdentifierInfo *FromId) |
Import the given identifier from the "from" context into the "to" context. More... | |
llvm::Expected< Selector > | Import_New (Selector FromSel) |
Import the given Objective-C selector from the "from" context into the "to" context. More... | |
Selector | Import (Selector FromSel) |
llvm::Expected< FileID > | Import_New (FileID) |
Import the given file ID from the "from" context into the "to" context. More... | |
FileID | Import (FileID) |
llvm::Expected< CXXCtorInitializer * > | Import_New (CXXCtorInitializer *FromInit) |
Import the given C++ constructor initializer from the "from" context into the "to" context. More... | |
CXXCtorInitializer * | Import (CXXCtorInitializer *FromInit) |
llvm::Expected< CXXBaseSpecifier * > | Import_New (const CXXBaseSpecifier *FromSpec) |
Import the given CXXBaseSpecifier from the "from" context into the "to" context. More... | |
CXXBaseSpecifier * | Import (const CXXBaseSpecifier *FromSpec) |
LLVM_NODISCARD llvm::Error | ImportDefinition_New (Decl *From) |
Import the definition of the given declaration, including all of the declarations it contains. More... | |
void | ImportDefinition (Decl *From) |
virtual 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 Decl * | Imported (Decl *From, Decl *To) |
Subclasses can override this function to observe all of the From -> To declaration mappings as they are imported. More... | |
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... | |
bool | IsStructurallyEquivalent (QualType From, QualType To, bool Complain=true) |
Determine whether the given types are structurally equivalent. More... | |
template<> | |
LLVM_NODISCARD Error | importInto (SourceLocation &To, const SourceLocation &From) |
template<> | |
LLVM_NODISCARD Error | importInto (QualType &To, const QualType &From) |
Static Public Member Functions | |
static llvm::Optional< unsigned > | getFieldIndex (Decl *F) |
Determine the index of a field in its parent record. More... | |
Friends | |
class | ASTNodeImporter |
Imports selected nodes from one AST context into another context, merging AST nodes where appropriate.
Definition at line 83 of file ASTImporter.h.
using clang::ASTImporter::ImportedCXXBaseSpecifierMap = llvm::DenseMap<const CXXBaseSpecifier *, CXXBaseSpecifier *> |
Definition at line 88 of file ASTImporter.h.
using clang::ASTImporter::NonEquivalentDeclSet = llvm::DenseSet<std::pair<Decl *, Decl *> > |
Definition at line 86 of file ASTImporter.h.
ASTImporter::ASTImporter | ( | ASTContext & | ToContext, |
FileManager & | ToFileManager, | ||
ASTContext & | FromContext, | ||
FileManager & | FromFileManager, | ||
bool | MinimalImport, | ||
ASTImporterLookupTable * | LookupTable = 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. |
LookupTable | 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 7613 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 8472 of file ASTImporter.cpp.
Referenced by ImportContext().
DiagnosticBuilder ASTImporter::FromDiag | ( | SourceLocation | Loc, |
unsigned | DiagID | ||
) |
Report a diagnostic in the "from" context.
Definition at line 8464 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 NULL.
Definition at line 7741 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 7634 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 400 of file ASTImporter.h.
|
inline |
Retrieve the file manager that AST nodes are being imported from.
Definition at line 406 of file ASTImporter.h.
|
inline |
Return the set of declarations that we know are not equivalent.
Definition at line 415 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 436 of file ASTImporter.h.
References IsStructurallyEquivalent().
|
inline |
Retrieve the context that AST nodes are being imported into.
Definition at line 397 of file ASTImporter.h.
|
inline |
Retrieve the file manager that AST nodes are being imported into.
Definition at line 403 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 8448 of file ASTImporter.cpp.
Definition at line 7685 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(), Import_New(), ImportContext(), ImportDefinition_New(), importSpecializations(), IsStructurallyEquivalent(), and setTypedefNameForAnonDecl().
TypeSourceInfo * ASTImporter::Import | ( | TypeSourceInfo * | FromTSI | ) |
Definition at line 7717 of file ASTImporter.cpp.
References clang::TypeLoc::getBeginLoc(), clang::ASTContext::getTrivialTypeSourceInfo(), clang::TypeSourceInfo::getType(), clang::TypeSourceInfo::getTypeLoc(), Import(), and clang::QualType::isNull().
Definition at line 7734 of file ASTImporter.cpp.
References clang::Attr::clone(), clang::Attr::getRange(), Import(), and clang::Attr::setRange().
Definition at line 7755 of file ASTImporter.cpp.
References GetAlreadyImportedOrNull(), Imported(), clang::updateFlags(), and clang::TypeVisitor< ImplClass, RetTy >::Visit().
Definition at line 224 of file ASTImporter.h.
References clang::Error.
Definition at line 7854 of file ASTImporter.cpp.
References Import().
Definition at line 7867 of file ASTImporter.cpp.
NestedNameSpecifier * ASTImporter::Import | ( | NestedNameSpecifier * | FromNNS | ) |
Definition at line 7909 of file ASTImporter.cpp.
References clang::NestedNameSpecifier::Create(), clang::NestedNameSpecifier::getAsIdentifier(), clang::NestedNameSpecifier::getAsNamespace(), clang::NestedNameSpecifier::getAsNamespaceAlias(), clang::NestedNameSpecifier::getAsRecordDecl(), clang::NestedNameSpecifier::getAsType(), clang::NestedNameSpecifier::getKind(), clang::NestedNameSpecifier::getPrefix(), clang::QualType::getTypePtr(), clang::NestedNameSpecifier::Global, clang::NestedNameSpecifier::GlobalSpecifier(), clang::NestedNameSpecifier::Identifier, Import(), clang::QualType::isNull(), clang::NestedNameSpecifier::Namespace, clang::NestedNameSpecifier::NamespaceAlias, clang::NestedNameSpecifier::Super, clang::NestedNameSpecifier::SuperSpecifier(), clang::NestedNameSpecifier::TypeSpec, and clang::NestedNameSpecifier::TypeSpecWithTemplate.
NestedNameSpecifierLoc ASTImporter::Import | ( | NestedNameSpecifierLoc | FromNNS | ) |
Definition at line 7967 of file ASTImporter.cpp.
References clang::NestedNameSpecifierLoc::getPrefix().
TemplateName ASTImporter::Import | ( | TemplateName | From | ) |
Definition at line 8044 of file ASTImporter.cpp.
References clang::UnresolvedSetImpl::addDecl(), clang::UnresolvedSetImpl::begin(), clang::TemplateName::DependentTemplate, clang::UnresolvedSetImpl::end(), clang::SubstTemplateTemplateParmPackStorage::getArgumentPack(), clang::TemplateName::getAsDependentTemplateName(), clang::TemplateName::getAsOverloadedTemplate(), clang::TemplateName::getAsQualifiedTemplateName(), clang::TemplateName::getAsSubstTemplateTemplateParm(), clang::TemplateName::getAsSubstTemplateTemplateParmPack(), clang::TemplateName::getAsTemplateDecl(), 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::isNull(), clang::TemplateName::OverloadedTemplate, clang::TemplateName::QualifiedTemplate, clang::TemplateName::SubstTemplateTemplateParm, clang::TemplateName::SubstTemplateTemplateParmPack, and clang::TemplateName::Template.
SourceLocation ASTImporter::Import | ( | SourceLocation | FromLoc | ) |
Definition at line 8140 of file ASTImporter.cpp.
References clang::SourceManager::getComposedLoc(), clang::SourceManager::getDecomposedLoc(), clang::ASTContext::getSourceManager(), Import(), clang::FileID::isInvalid(), and clang::SourceLocation::isInvalid().
SourceRange ASTImporter::Import | ( | SourceRange | FromRange | ) |
Definition at line 8158 of file ASTImporter.cpp.
References clang::SourceRange::getBegin(), clang::SourceRange::getEnd(), and Import().
DeclarationName ASTImporter::Import | ( | DeclarationName | FromName | ) |
Definition at line 8355 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::QualType::isNull(), 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 8419 of file ASTImporter.cpp.
References clang::IdentifierTable::get(), clang::IdentifierInfo::getBuiltinID(), clang::IdentifierInfo::getName(), clang::ASTContext::Idents, and clang::IdentifierInfo::setBuiltinID().
Definition at line 8437 of file ASTImporter.cpp.
References clang::Selector::getIdentifierInfoForSlot(), clang::Selector::getNumArgs(), clang::SelectorTable::getSelector(), Import(), clang::Selector::isNull(), and clang::ASTContext::Selectors.
Definition at line 8168 of file ASTImporter.cpp.
References clang::SourceManager::createExpansionLoc(), clang::SourceManager::createFileID(), clang::SourceManager::createMacroArgExpansionLoc(), clang::SrcMgr::FileInfo::getContentCache(), clang::ASTContext::getDiagnostics(), 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::ASTContext::getSourceManager(), clang::SrcMgr::ExpansionInfo::getSpellingLoc(), Import(), clang::SrcMgr::SLocEntry::isExpansion(), clang::SrcMgr::ExpansionInfo::isExpansionTokenRange(), and clang::SrcMgr::ExpansionInfo::isMacroArgExpansion().
CXXCtorInitializer * ASTImporter::Import | ( | CXXCtorInitializer * | FromInit | ) |
Definition at line 8232 of file ASTImporter.cpp.
References 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(), clang::CXXCtorInitializer::isBaseInitializer(), clang::CXXCtorInitializer::isBaseVirtual(), clang::CXXCtorInitializer::isDelegatingInitializer(), clang::CXXCtorInitializer::isIndirectMemberInitializer(), clang::CXXCtorInitializer::isMemberInitializer(), and clang::CXXCtorInitializer::isPackExpansion().
CXXBaseSpecifier * ASTImporter::Import | ( | const CXXBaseSpecifier * | FromSpec | ) |
Definition at line 8284 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().
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 7627 of file ASTImporter.cpp.
References Import(), and clang::QualType::isNull().
Expected< TypeSourceInfo * > ASTImporter::Import_New | ( | TypeSourceInfo * | FromTSI | ) |
Import the given type source information from the "from" context into the "to" context.
Definition at line 7711 of file ASTImporter.cpp.
References Import().
Import the given attribute from the "from" context into the "to" context.
Definition at line 7731 of file ASTImporter.cpp.
References Import().
Import the given declaration from the "from" context into the "to" context.
Definition at line 7749 of file ASTImporter.cpp.
References Import().
|
inline |
Definition at line 219 of file ASTImporter.h.
Import the given expression from the "from" context into the "to" context.
Definition at line 7848 of file ASTImporter.cpp.
References Import().
Import the given statement from the "from" context into the "to" context.
Definition at line 7861 of file ASTImporter.cpp.
References Import().
Expected< NestedNameSpecifier * > ASTImporter::Import_New | ( | NestedNameSpecifier * | FromNNS | ) |
Import the given nested-name-specifier from the "from" context into the "to" context.
Definition at line 7903 of file ASTImporter.cpp.
References Import().
Expected< NestedNameSpecifierLoc > ASTImporter::Import_New | ( | NestedNameSpecifierLoc | FromNNS | ) |
Import the given nested-name-specifier-loc from the "from" context into the "to" context.
Definition at line 7963 of file ASTImporter.cpp.
References Import().
Expected< TemplateName > ASTImporter::Import_New | ( | TemplateName | From | ) |
Import the given template name from the "from" context into the "to" context, or the import error.
Definition at line 8038 of file ASTImporter.cpp.
References Import(), and clang::TemplateName::isNull().
Expected< SourceLocation > ASTImporter::Import_New | ( | SourceLocation | FromLoc | ) |
Import the given source location from the "from" context into the "to" context.
Definition at line 8134 of file ASTImporter.cpp.
References Import(), and clang::SourceLocation::isInvalid().
Expected< SourceRange > ASTImporter::Import_New | ( | SourceRange | FromRange | ) |
Import the given source range from the "from" context into the "to" context.
Definition at line 8154 of file ASTImporter.cpp.
References Import().
Expected< DeclarationName > ASTImporter::Import_New | ( | DeclarationName | FromName | ) |
Import the given declaration name from the "from" context into the "to" context.
Definition at line 8349 of file ASTImporter.cpp.
References Import().
Import the given Objective-C selector from the "from" context into the "to" context.
Definition at line 8431 of file ASTImporter.cpp.
References Import(), and clang::Selector::isNull().
Import the given file ID from the "from" context into the "to" context.
Definition at line 8162 of file ASTImporter.cpp.
References Import(), clang::FileID::isInvalid(), and clang::FileID::isValid().
Expected< CXXCtorInitializer * > ASTImporter::Import_New | ( | CXXCtorInitializer * | FromInit | ) |
Import the given C++ constructor initializer from the "from" context into the "to" context.
Definition at line 8226 of file ASTImporter.cpp.
References Import().
Expected< CXXBaseSpecifier * > ASTImporter::Import_New | ( | const CXXBaseSpecifier * | FromSpec | ) |
Import the given CXXBaseSpecifier from the "from" context into the "to" context.
Definition at line 8278 of file ASTImporter.cpp.
References Import().
Expected< DeclContext * > ASTImporter::ImportContext | ( | DeclContext * | FromDC | ) |
Import the given declaration context from the "from" AST context into the "to" AST context.
Definition at line 7789 of file ASTImporter.cpp.
References ASTNodeImporter, CompleteDecl(), clang::Error, clang::ObjCInterfaceDecl::getDefinition(), clang::ObjCProtocolDecl::getDefinition(), clang::ASTNodeImporter::IDK_Basic, and Import().
void ASTImporter::ImportDefinition | ( | Decl * | From | ) |
Definition at line 8344 of file ASTImporter.cpp.
References clang::Error, and ImportDefinition_New().
Import the definition of the given declaration, including all of the declarations it contains.
Definition at line 8299 of file ASTImporter.cpp.
References clang::ASTNodeImporter::IDK_Everything, Import(), clang::ASTNodeImporter::ImportDeclContext(), and clang::ASTNodeImporter::ImportDefinition().
Referenced by clang::ExternalASTMerger::CompleteType(), and ImportDefinition().
Subclasses can override this function to observe all of the From
-> To
declaration mappings as they are imported.
Definition at line 425 of file ASTImporter.h.
Referenced by Import().
LLVM_NODISCARD Error clang::ASTImporter::importInto | ( | SourceLocation & | To, |
const SourceLocation & | From | ||
) |
Definition at line 141 of file ASTImporter.cpp.
References clang::ImportError::Error, clang::SourceLocation::isInvalid(), and clang::SourceLocation::isValid().
LLVM_NODISCARD Error clang::ASTImporter::importInto | ( | QualType & | To, |
const QualType & | From | ||
) |
Definition at line 150 of file ASTImporter.cpp.
References clang::QualType::isNull().
|
inline |
Import the given object, returns the result.
To | Import the object into this variable. |
From | Object to import. |
Definition at line 175 of file ASTImporter.h.
|
inline |
Whether the importer will perform a minimal import, creating to-be-completed forward declarations when possible.
Definition at line 167 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 8502 of file ASTImporter.cpp.
References getStructuralEquivalenceKind(), clang::QualType::getTypePtr(), clang::ASTContext::hasSameType(), Import(), and clang::StructuralEquivalenceContext::IsEquivalent().
Store and assign the imported declaration to its counterpart.
Definition at line 8492 of file ASTImporter.cpp.
Referenced by clang::ExternalASTMerger::CompleteType().
DiagnosticBuilder ASTImporter::ToDiag | ( | SourceLocation | Loc, |
unsigned | DiagID | ||
) |
Report a diagnostic in the "to" context.
Definition at line 8456 of file ASTImporter.cpp.
References clang::ASTContext::getDiagnostics(), clang::DiagnosticsEngine::notePriorDiagnosticFrom(), and clang::DiagnosticsEngine::Report().
|
friend |
Definition at line 84 of file ASTImporter.h.
Referenced by ImportContext().