|
clang
5.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 | |
| typedef llvm::DenseSet < std::pair< Decl *, Decl * > > | NonEquivalentDeclSet |
| typedef llvm::DenseMap< const CXXBaseSpecifier *, CXXBaseSpecifier * > | ImportedCXXBaseSpecifierMap |
Public Member Functions | |
| ASTImporter (ASTContext &ToContext, FileManager &ToFileManager, ASTContext &FromContext, FileManager &FromFileManager, bool MinimalImport) | |
| Create a new AST importer. More... | |
| virtual | ~ASTImporter () |
| bool | isMinimalImport () const |
| Whether the importer will perform a minimal import, creating to-be-completed forward declarations when possible. More... | |
| QualType | Import (QualType FromT) |
| Import the given type from the "from" context into the "to" context. More... | |
| TypeSourceInfo * | Import (TypeSourceInfo *FromTSI) |
| Import the given type source information from the "from" context into the "to" context. More... | |
| Decl * | Import (Decl *FromD) |
| Import the given declaration from the "from" context into the "to" context. More... | |
| Decl * | GetAlreadyImportedOrNull (Decl *FromD) |
| Return the copy of the given declaration in the "to" context if it has already been imported from the "from" context. More... | |
| DeclContext * | ImportContext (DeclContext *FromDC) |
| Import the given declaration context from the "from" AST context into the "to" AST context. More... | |
| Expr * | Import (Expr *FromE) |
| Import the given expression from the "from" context into the "to" context. More... | |
| Stmt * | Import (Stmt *FromS) |
| Import the given statement from the "from" context into the "to" context. More... | |
| NestedNameSpecifier * | Import (NestedNameSpecifier *FromNNS) |
| Import the given nested-name-specifier from the "from" context into the "to" context. More... | |
| NestedNameSpecifierLoc | Import (NestedNameSpecifierLoc FromNNS) |
| Import the given nested-name-specifier from the "from" context into the "to" context. More... | |
| TemplateName | Import (TemplateName From) |
| Import the goven template name from the "from" context into the "to" context. More... | |
| SourceLocation | Import (SourceLocation FromLoc) |
| Import the given source location from the "from" context into the "to" context. More... | |
| SourceRange | Import (SourceRange FromRange) |
| Import the given source range from the "from" context into the "to" context. More... | |
| 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... | |
| Selector | Import (Selector FromSel) |
| Import the given Objective-C selector from the "from" context into the "to" context. More... | |
| FileID | Import (FileID) |
| Import the given file ID from the "from" context into the "to" context. More... | |
| CXXCtorInitializer * | Import (CXXCtorInitializer *FromInit) |
| Import the given C++ constructor initializer from the "from" context into the "to" context. More... | |
| CXXBaseSpecifier * | Import (const CXXBaseSpecifier *FromSpec) |
| Import the given CXXBaseSpecifier from the "from" context into the "to" context. More... | |
| void | ImportDefinition (Decl *From) |
| Import the definition of the given declaration, including all of the declarations it contains. More... | |
| 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) |
| Note that we have imported the "from" declaration by mapping it to the (potentially-newly-created) "to" declaration. 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... | |
Imports selected nodes from one AST context into another context, merging AST nodes where appropriate.
Definition at line 40 of file ASTImporter.h.
| typedef llvm::DenseMap<const CXXBaseSpecifier *, CXXBaseSpecifier *> clang::ASTImporter::ImportedCXXBaseSpecifierMap |
Definition at line 44 of file ASTImporter.h.
| typedef llvm::DenseSet<std::pair<Decl *, Decl *> > clang::ASTImporter::NonEquivalentDeclSet |
Definition at line 42 of file ASTImporter.h.
| ASTImporter::ASTImporter | ( | ASTContext & | ToContext, |
| FileManager & | ToFileManager, | ||
| ASTContext & | FromContext, | ||
| FileManager & | FromFileManager, | ||
| bool | MinimalImport | ||
| ) |
Create a new AST importer.
| 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. |
Definition at line 5521 of file ASTImporter.cpp.
References clang::ASTContext::getTranslationUnitDecl().
|
virtual |
Definition at line 5532 of file ASTImporter.cpp.
|
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 6209 of file ASTImporter.cpp.
References ID.
Referenced by ImportContext().
| DiagnosticBuilder ASTImporter::FromDiag | ( | SourceLocation | Loc, |
| unsigned | DiagID | ||
| ) |
Report a diagnostic in the "from" context.
Definition at line 6201 of file ASTImporter.cpp.
References clang::ASTContext::getDiagnostics(), clang::DiagnosticsEngine::notePriorDiagnosticFrom(), and clang::DiagnosticsEngine::Report().
Referenced by clang::ASTNodeImporter::ImportDefinition(), clang::ASTNodeImporter::VisitDecl(), clang::ASTNodeImporter::VisitExpr(), clang::ASTNodeImporter::VisitObjCImplementationDecl(), clang::ASTNodeImporter::VisitObjCMethodDecl(), clang::ASTNodeImporter::VisitObjCPropertyImplDecl(), clang::ASTNodeImporter::VisitStmt(), clang::ASTNodeImporter::VisitType(), and clang::ASTNodeImporter::VisitVarDecl().
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 5572 of file ASTImporter.cpp.
References clang::ASTNodeImporter::ImportDefinitionIfNeeded().
Referenced by clang::ASTNodeImporter::ImportDeclParts(), and clang::ASTNodeImporter::VisitClassTemplateDecl().
|
inline |
Retrieve the context that AST nodes are being imported from.
Definition at line 272 of file ASTImporter.h.
Referenced by clang::ASTNodeImporter::ImportDefinition(), clang::ASTNodeImporter::IsStructuralMatch(), clang::ASTNodeImporter::VisitFriendDecl(), clang::ASTNodeImporter::VisitFunctionDecl(), and clang::ASTNodeImporter::VisitTemplateSpecializationType().
|
inline |
Retrieve the file manager that AST nodes are being imported from.
Definition at line 278 of file ASTImporter.h.
|
inline |
Return the set of declarations that we know are not equivalent.
Definition at line 287 of file ASTImporter.h.
Referenced by clang::ASTNodeImporter::IsStructuralMatch(), and clang::ASTNodeImporter::VisitFriendDecl().
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 308 of file ASTImporter.h.
Referenced by clang::ASTNodeImporter::IsStructuralMatch().
|
inline |
Retrieve the context that AST nodes are being imported into.
Definition at line 269 of file ASTImporter.h.
Referenced by Import(), clang::ASTNodeImporter::ImportDeclGroup(), clang::ASTNodeImporter::ImportDefinition(), clang::ASTNodeImporter::ImportObjCTypeParamList(), clang::ASTNodeImporter::ImportTemplateArgument(), clang::ASTNodeImporter::ImportTemplateParameterList(), clang::ASTNodeImporter::IsStructuralMatch(), clang::ASTNodeImporter::VisitAccessSpecDecl(), clang::ASTNodeImporter::VisitAddrLabelExpr(), clang::ASTNodeImporter::VisitArrayInitIndexExpr(), clang::ASTNodeImporter::VisitArrayInitLoopExpr(), clang::ASTNodeImporter::VisitArraySubscriptExpr(), clang::ASTNodeImporter::VisitArrayTypeTraitExpr(), clang::ASTNodeImporter::VisitAtomicExpr(), clang::ASTNodeImporter::VisitAtomicType(), clang::ASTNodeImporter::VisitAttributedStmt(), clang::ASTNodeImporter::VisitAttributedType(), clang::ASTNodeImporter::VisitAutoType(), clang::ASTNodeImporter::VisitBinaryConditionalOperator(), clang::ASTNodeImporter::VisitBinaryOperator(), clang::ASTNodeImporter::VisitBlockPointerType(), clang::ASTNodeImporter::VisitBreakStmt(), clang::ASTNodeImporter::VisitBuiltinType(), clang::ASTNodeImporter::VisitCallExpr(), clang::ASTNodeImporter::VisitCaseStmt(), clang::ASTNodeImporter::VisitCharacterLiteral(), clang::ASTNodeImporter::VisitClassTemplateDecl(), clang::ASTNodeImporter::VisitClassTemplateSpecializationDecl(), clang::ASTNodeImporter::VisitComplexType(), clang::ASTNodeImporter::VisitCompoundAssignOperator(), clang::ASTNodeImporter::VisitCompoundLiteralExpr(), clang::ASTNodeImporter::VisitCompoundStmt(), clang::ASTNodeImporter::VisitConditionalOperator(), clang::ASTNodeImporter::VisitConstantArrayType(), clang::ASTNodeImporter::VisitContinueStmt(), clang::ASTNodeImporter::VisitCXXBindTemporaryExpr(), clang::ASTNodeImporter::VisitCXXBoolLiteralExpr(), clang::ASTNodeImporter::VisitCXXCatchStmt(), clang::ASTNodeImporter::VisitCXXConstructExpr(), clang::ASTNodeImporter::VisitCXXDefaultArgExpr(), clang::ASTNodeImporter::VisitCXXDefaultInitExpr(), clang::ASTNodeImporter::VisitCXXDeleteExpr(), clang::ASTNodeImporter::VisitCXXForRangeStmt(), clang::ASTNodeImporter::VisitCXXMemberCallExpr(), clang::ASTNodeImporter::VisitCXXNamedCastExpr(), clang::ASTNodeImporter::VisitCXXNewExpr(), clang::ASTNodeImporter::VisitCXXNoexceptExpr(), clang::ASTNodeImporter::VisitCXXNullPtrLiteralExpr(), clang::ASTNodeImporter::VisitCXXScalarValueInitExpr(), clang::ASTNodeImporter::VisitCXXTemporaryObjectExpr(), clang::ASTNodeImporter::VisitCXXThisExpr(), clang::ASTNodeImporter::VisitCXXThrowExpr(), clang::ASTNodeImporter::VisitCXXTryStmt(), clang::ASTNodeImporter::VisitDecayedType(), clang::ASTNodeImporter::VisitDeclRefExpr(), clang::ASTNodeImporter::VisitDeclStmt(), clang::ASTNodeImporter::VisitDecltypeType(), clang::ASTNodeImporter::VisitDefaultStmt(), clang::ASTNodeImporter::VisitDesignatedInitExpr(), clang::ASTNodeImporter::VisitDoStmt(), clang::ASTNodeImporter::VisitElaboratedType(), clang::ASTNodeImporter::VisitEnumConstantDecl(), clang::ASTNodeImporter::VisitEnumDecl(), clang::ASTNodeImporter::VisitEnumType(), clang::ASTNodeImporter::VisitExplicitCastExpr(), clang::ASTNodeImporter::VisitExpressionTraitExpr(), clang::ASTNodeImporter::VisitExprWithCleanups(), clang::ASTNodeImporter::VisitExtVectorType(), clang::ASTNodeImporter::VisitFieldDecl(), clang::ASTNodeImporter::VisitFloatingLiteral(), clang::ASTNodeImporter::VisitForStmt(), clang::ASTNodeImporter::VisitFriendDecl(), clang::ASTNodeImporter::VisitFunctionDecl(), clang::ASTNodeImporter::VisitFunctionNoProtoType(), clang::ASTNodeImporter::VisitFunctionProtoType(), clang::ASTNodeImporter::VisitGCCAsmStmt(), clang::ASTNodeImporter::VisitGNUNullExpr(), clang::ASTNodeImporter::VisitGotoStmt(), clang::ASTNodeImporter::VisitIfStmt(), clang::ASTNodeImporter::VisitImplicitCastExpr(), clang::ASTNodeImporter::VisitImplicitParamDecl(), clang::ASTNodeImporter::VisitImplicitValueInitExpr(), clang::ASTNodeImporter::VisitIncompleteArrayType(), clang::ASTNodeImporter::VisitIndirectFieldDecl(), clang::ASTNodeImporter::VisitIndirectGotoStmt(), clang::ASTNodeImporter::VisitInitListExpr(), clang::ASTNodeImporter::VisitInjectedClassNameType(), clang::ASTNodeImporter::VisitIntegerLiteral(), clang::ASTNodeImporter::VisitLabelDecl(), clang::ASTNodeImporter::VisitLabelStmt(), clang::ASTNodeImporter::VisitLinkageSpecDecl(), clang::ASTNodeImporter::VisitLValueReferenceType(), clang::ASTNodeImporter::VisitMaterializeTemporaryExpr(), clang::ASTNodeImporter::VisitMemberExpr(), clang::ASTNodeImporter::VisitMemberPointerType(), clang::ASTNodeImporter::VisitNamespaceDecl(), clang::ASTNodeImporter::VisitNonTypeTemplateParmDecl(), clang::ASTNodeImporter::VisitNullStmt(), clang::ASTNodeImporter::VisitObjCAtCatchStmt(), clang::ASTNodeImporter::VisitObjCAtFinallyStmt(), clang::ASTNodeImporter::VisitObjCAtThrowStmt(), clang::ASTNodeImporter::VisitObjCAtTryStmt(), clang::ASTNodeImporter::VisitObjCCategoryDecl(), clang::ASTNodeImporter::VisitObjCCategoryImplDecl(), clang::ASTNodeImporter::VisitObjCForCollectionStmt(), clang::ASTNodeImporter::VisitObjCImplementationDecl(), clang::ASTNodeImporter::VisitObjCInterfaceDecl(), clang::ASTNodeImporter::VisitObjCInterfaceType(), clang::ASTNodeImporter::VisitObjCIvarDecl(), clang::ASTNodeImporter::VisitObjCMethodDecl(), clang::ASTNodeImporter::VisitObjCObjectPointerType(), clang::ASTNodeImporter::VisitObjCObjectType(), clang::ASTNodeImporter::VisitObjCPropertyDecl(), clang::ASTNodeImporter::VisitObjCPropertyImplDecl(), clang::ASTNodeImporter::VisitObjCProtocolDecl(), clang::ASTNodeImporter::VisitObjCTypeParamDecl(), clang::ASTNodeImporter::VisitOffsetOfExpr(), clang::ASTNodeImporter::VisitOpaqueValueExpr(), clang::ASTNodeImporter::VisitParenExpr(), clang::ASTNodeImporter::VisitParenListExpr(), clang::ASTNodeImporter::VisitParenType(), clang::ASTNodeImporter::VisitParmVarDecl(), clang::ASTNodeImporter::VisitPointerType(), clang::ASTNodeImporter::VisitPredefinedExpr(), clang::ASTNodeImporter::VisitRecordDecl(), clang::ASTNodeImporter::VisitRecordType(), clang::ASTNodeImporter::VisitReturnStmt(), clang::ASTNodeImporter::VisitRValueReferenceType(), clang::ASTNodeImporter::VisitStaticAssertDecl(), clang::ASTNodeImporter::VisitStmtExpr(), clang::ASTNodeImporter::VisitStringLiteral(), clang::ASTNodeImporter::VisitSubstNonTypeTemplateParmExpr(), clang::ASTNodeImporter::VisitSubstTemplateTypeParmType(), clang::ASTNodeImporter::VisitSwitchStmt(), clang::ASTNodeImporter::VisitTemplateSpecializationType(), clang::ASTNodeImporter::VisitTemplateTemplateParmDecl(), clang::ASTNodeImporter::VisitTemplateTypeParmDecl(), clang::ASTNodeImporter::VisitTemplateTypeParmType(), clang::ASTNodeImporter::VisitTranslationUnitDecl(), clang::ASTNodeImporter::VisitTypedefNameDecl(), clang::ASTNodeImporter::VisitTypedefType(), clang::ASTNodeImporter::VisitTypeOfExprType(), clang::ASTNodeImporter::VisitTypeOfType(), clang::ASTNodeImporter::VisitUnaryExprOrTypeTraitExpr(), clang::ASTNodeImporter::VisitUnaryOperator(), clang::ASTNodeImporter::VisitUnaryTransformType(), clang::ASTNodeImporter::VisitVAArgExpr(), clang::ASTNodeImporter::VisitVarDecl(), clang::ASTNodeImporter::VisitVariableArrayType(), clang::ASTNodeImporter::VisitVarTemplateDecl(), clang::ASTNodeImporter::VisitVarTemplateSpecializationDecl(), clang::ASTNodeImporter::VisitVectorType(), and clang::ASTNodeImporter::VisitWhileStmt().
|
inline |
Retrieve the file manager that AST nodes are being imported into.
Definition at line 275 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 6185 of file ASTImporter.cpp.
References Name.
Referenced by clang::ASTNodeImporter::VisitClassTemplateDecl(), clang::ASTNodeImporter::VisitEnumConstantDecl(), clang::ASTNodeImporter::VisitEnumDecl(), clang::ASTNodeImporter::VisitFunctionDecl(), clang::ASTNodeImporter::VisitNamespaceDecl(), clang::ASTNodeImporter::VisitRecordDecl(), clang::ASTNodeImporter::VisitTypedefNameDecl(), clang::ASTNodeImporter::VisitVarDecl(), and clang::ASTNodeImporter::VisitVarTemplateDecl().
Import the given type from the "from" context into the "to" context.
Definition at line 5534 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 Import(), clang::ASTNodeImporter::ImportArray(), clang::ASTNodeImporter::ImportArrayChecked(), clang::ASTNodeImporter::ImportCastPath(), ImportContext(), clang::ASTNodeImporter::ImportDeclarationNameLoc(), clang::ASTNodeImporter::ImportDeclContext(), clang::ASTNodeImporter::ImportDeclParts(), clang::ASTNodeImporter::ImportDefinition(), ImportDefinition(), clang::ASTNodeImporter::ImportDefinitionIfNeeded(), clang::ASTNodeImporter::ImportDesignator(), clang::ASTNodeImporter::ImportObjCTypeParamList(), clang::ASTNodeImporter::ImportOverrides(), clang::ASTNodeImporter::ImportTemplateArgument(), clang::ASTNodeImporter::ImportTemplateArgumentLoc(), clang::ASTNodeImporter::ImportTemplateParameterList(), IsStructurallyEquivalent(), clang::ASTNodeImporter::VisitAccessSpecDecl(), clang::ASTNodeImporter::VisitAddrLabelExpr(), clang::ASTNodeImporter::VisitArrayInitIndexExpr(), clang::ASTNodeImporter::VisitArrayInitLoopExpr(), clang::ASTNodeImporter::VisitArraySubscriptExpr(), clang::ASTNodeImporter::VisitArrayTypeTraitExpr(), clang::ASTNodeImporter::VisitAtomicExpr(), clang::ASTNodeImporter::VisitAtomicType(), clang::ASTNodeImporter::VisitAttributedStmt(), clang::ASTNodeImporter::VisitAttributedType(), clang::ASTNodeImporter::VisitAutoType(), clang::ASTNodeImporter::VisitBinaryConditionalOperator(), clang::ASTNodeImporter::VisitBinaryOperator(), clang::ASTNodeImporter::VisitBlockPointerType(), clang::ASTNodeImporter::VisitBreakStmt(), clang::ASTNodeImporter::VisitCallExpr(), clang::ASTNodeImporter::VisitCaseStmt(), clang::ASTNodeImporter::VisitCharacterLiteral(), clang::ASTNodeImporter::VisitClassTemplateDecl(), clang::ASTNodeImporter::VisitClassTemplateSpecializationDecl(), clang::ASTNodeImporter::VisitComplexType(), clang::ASTNodeImporter::VisitCompoundAssignOperator(), clang::ASTNodeImporter::VisitCompoundLiteralExpr(), clang::ASTNodeImporter::VisitCompoundStmt(), clang::ASTNodeImporter::VisitConditionalOperator(), clang::ASTNodeImporter::VisitConstantArrayType(), clang::ASTNodeImporter::VisitContinueStmt(), clang::ASTNodeImporter::VisitCXXBindTemporaryExpr(), clang::ASTNodeImporter::VisitCXXBoolLiteralExpr(), clang::ASTNodeImporter::VisitCXXCatchStmt(), clang::ASTNodeImporter::VisitCXXConstructExpr(), clang::ASTNodeImporter::VisitCXXDefaultArgExpr(), clang::ASTNodeImporter::VisitCXXDefaultInitExpr(), clang::ASTNodeImporter::VisitCXXDeleteExpr(), clang::ASTNodeImporter::VisitCXXForRangeStmt(), clang::ASTNodeImporter::VisitCXXMemberCallExpr(), clang::ASTNodeImporter::VisitCXXNamedCastExpr(), clang::ASTNodeImporter::VisitCXXNewExpr(), clang::ASTNodeImporter::VisitCXXNoexceptExpr(), clang::ASTNodeImporter::VisitCXXNullPtrLiteralExpr(), clang::ASTNodeImporter::VisitCXXScalarValueInitExpr(), clang::ASTNodeImporter::VisitCXXTemporaryObjectExpr(), clang::ASTNodeImporter::VisitCXXThisExpr(), clang::ASTNodeImporter::VisitCXXThrowExpr(), clang::ASTNodeImporter::VisitCXXTryStmt(), clang::ASTNodeImporter::VisitDecayedType(), clang::ASTNodeImporter::VisitDeclRefExpr(), clang::ASTNodeImporter::VisitDeclStmt(), clang::ASTNodeImporter::VisitDecltypeType(), clang::ASTNodeImporter::VisitDefaultStmt(), clang::ASTNodeImporter::VisitDesignatedInitExpr(), clang::ASTNodeImporter::VisitDoStmt(), clang::ASTNodeImporter::VisitElaboratedType(), clang::ASTNodeImporter::VisitEnumConstantDecl(), clang::ASTNodeImporter::VisitEnumDecl(), clang::ASTNodeImporter::VisitEnumType(), clang::ASTNodeImporter::VisitExplicitCastExpr(), clang::ASTNodeImporter::VisitExpressionTraitExpr(), clang::ASTNodeImporter::VisitExprWithCleanups(), clang::ASTNodeImporter::VisitExtVectorType(), clang::ASTNodeImporter::VisitFieldDecl(), clang::ASTNodeImporter::VisitFloatingLiteral(), clang::ASTNodeImporter::VisitForStmt(), clang::ASTNodeImporter::VisitFriendDecl(), clang::ASTNodeImporter::VisitFunctionDecl(), clang::ASTNodeImporter::VisitFunctionNoProtoType(), clang::ASTNodeImporter::VisitFunctionProtoType(), clang::ASTNodeImporter::VisitGCCAsmStmt(), clang::ASTNodeImporter::VisitGNUNullExpr(), clang::ASTNodeImporter::VisitGotoStmt(), clang::ASTNodeImporter::VisitIfStmt(), clang::ASTNodeImporter::VisitImplicitCastExpr(), clang::ASTNodeImporter::VisitImplicitParamDecl(), clang::ASTNodeImporter::VisitImplicitValueInitExpr(), clang::ASTNodeImporter::VisitIncompleteArrayType(), clang::ASTNodeImporter::VisitIndirectFieldDecl(), clang::ASTNodeImporter::VisitIndirectGotoStmt(), clang::ASTNodeImporter::VisitInitListExpr(), clang::ASTNodeImporter::VisitInjectedClassNameType(), clang::ASTNodeImporter::VisitIntegerLiteral(), clang::ASTNodeImporter::VisitLabelDecl(), clang::ASTNodeImporter::VisitLabelStmt(), clang::ASTNodeImporter::VisitLinkageSpecDecl(), clang::ASTNodeImporter::VisitLValueReferenceType(), clang::ASTNodeImporter::VisitMaterializeTemporaryExpr(), clang::ASTNodeImporter::VisitMemberExpr(), clang::ASTNodeImporter::VisitMemberPointerType(), clang::ASTNodeImporter::VisitNamespaceDecl(), clang::ASTNodeImporter::VisitNonTypeTemplateParmDecl(), clang::ASTNodeImporter::VisitNullStmt(), clang::ASTNodeImporter::VisitObjCAtCatchStmt(), clang::ASTNodeImporter::VisitObjCAtFinallyStmt(), clang::ASTNodeImporter::VisitObjCAtThrowStmt(), clang::ASTNodeImporter::VisitObjCAtTryStmt(), clang::ASTNodeImporter::VisitObjCCategoryDecl(), clang::ASTNodeImporter::VisitObjCCategoryImplDecl(), clang::ASTNodeImporter::VisitObjCForCollectionStmt(), clang::ASTNodeImporter::VisitObjCImplementationDecl(), clang::ASTNodeImporter::VisitObjCInterfaceDecl(), clang::ASTNodeImporter::VisitObjCInterfaceType(), clang::ASTNodeImporter::VisitObjCIvarDecl(), clang::ASTNodeImporter::VisitObjCMethodDecl(), clang::ASTNodeImporter::VisitObjCObjectPointerType(), clang::ASTNodeImporter::VisitObjCObjectType(), clang::ASTNodeImporter::VisitObjCPropertyDecl(), clang::ASTNodeImporter::VisitObjCPropertyImplDecl(), clang::ASTNodeImporter::VisitObjCProtocolDecl(), clang::ASTNodeImporter::VisitObjCTypeParamDecl(), clang::ASTNodeImporter::VisitOffsetOfExpr(), clang::ASTNodeImporter::VisitOpaqueValueExpr(), clang::ASTNodeImporter::VisitParenExpr(), clang::ASTNodeImporter::VisitParenListExpr(), clang::ASTNodeImporter::VisitParenType(), clang::ASTNodeImporter::VisitParmVarDecl(), clang::ASTNodeImporter::VisitPointerType(), clang::ASTNodeImporter::VisitPredefinedExpr(), clang::ASTNodeImporter::VisitRecordDecl(), clang::ASTNodeImporter::VisitRecordType(), clang::ASTNodeImporter::VisitReturnStmt(), clang::ASTNodeImporter::VisitRValueReferenceType(), clang::ASTNodeImporter::VisitStaticAssertDecl(), clang::ASTNodeImporter::VisitStmtExpr(), clang::ASTNodeImporter::VisitStringLiteral(), clang::ASTNodeImporter::VisitSubstNonTypeTemplateParmExpr(), clang::ASTNodeImporter::VisitSubstTemplateTypeParmType(), clang::ASTNodeImporter::VisitSwitchStmt(), clang::ASTNodeImporter::VisitTemplateSpecializationType(), clang::ASTNodeImporter::VisitTemplateTemplateParmDecl(), clang::ASTNodeImporter::VisitTemplateTypeParmDecl(), clang::ASTNodeImporter::VisitTemplateTypeParmType(), clang::ASTNodeImporter::VisitTypedefNameDecl(), clang::ASTNodeImporter::VisitTypedefType(), clang::ASTNodeImporter::VisitTypeOfExprType(), clang::ASTNodeImporter::VisitTypeOfType(), clang::ASTNodeImporter::VisitUnaryExprOrTypeTraitExpr(), clang::ASTNodeImporter::VisitUnaryOperator(), clang::ASTNodeImporter::VisitUnaryTransformType(), clang::ASTNodeImporter::VisitVAArgExpr(), clang::ASTNodeImporter::VisitVarDecl(), clang::ASTNodeImporter::VisitVariableArrayType(), clang::ASTNodeImporter::VisitVarTemplateDecl(), clang::ASTNodeImporter::VisitVarTemplateSpecializationDecl(), clang::ASTNodeImporter::VisitVectorType(), and clang::ASTNodeImporter::VisitWhileStmt().
| TypeSourceInfo * ASTImporter::Import | ( | TypeSourceInfo * | FromTSI | ) |
Import the given type source information from the "from" context into the "to" context.
Definition at line 5558 of file ASTImporter.cpp.
References clang::TypeLoc::getLocStart(), clang::ASTContext::getTrivialTypeSourceInfo(), clang::TypeSourceInfo::getType(), clang::TypeSourceInfo::getTypeLoc(), Import(), and clang::QualType::isNull().
Import the given declaration from the "from" context into the "to" context.
Definition at line 5583 of file ASTImporter.cpp.
References Import(), clang::ASTNodeImporter::ImportDefinitionIfNeeded(), and clang::TypeVisitor< ImplClass, RetTy >::Visit().
Import the given expression from the "from" context into the "to" context.
Definition at line 5685 of file ASTImporter.cpp.
References Import().
Import the given statement from the "from" context into the "to" context.
Definition at line 5692 of file ASTImporter.cpp.
| NestedNameSpecifier * ASTImporter::Import | ( | NestedNameSpecifier * | FromNNS | ) |
Import the given nested-name-specifier from the "from" context into the "to" context.
Definition at line 5712 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 | ) |
Import the given nested-name-specifier from the "from" context into the "to" context.
Definition at line 5765 of file ASTImporter.cpp.
References Builder, clang::NestedNameSpecifierLocBuilder::Extend(), clang::NestedNameSpecifier::getAsIdentifier(), clang::NestedNameSpecifier::getAsNamespace(), clang::NestedNameSpecifier::getAsNamespaceAlias(), clang::NestedNameSpecifier::getAsRecordDecl(), clang::NestedNameSpecifier::getAsType(), clang::SourceRange::getBegin(), clang::SourceRange::getEnd(), clang::NestedNameSpecifier::getKind(), clang::NestedNameSpecifierLoc::getLocalBeginLoc(), clang::NestedNameSpecifierLoc::getLocalEndLoc(), clang::NestedNameSpecifierLoc::getNestedNameSpecifier(), clang::NestedNameSpecifierLoc::getPrefix(), clang::NestedNameSpecifierLoc::getSourceRange(), getToContext(), clang::ASTContext::getTrivialTypeSourceInfo(), clang::TypeSourceInfo::getTypeLoc(), clang::NestedNameSpecifierLocBuilder::getWithLocInContext(), clang::NestedNameSpecifier::Global, clang::NestedNameSpecifier::Identifier, Import(), clang::NestedNameSpecifierLocBuilder::MakeGlobal(), clang::NestedNameSpecifierLocBuilder::MakeSuper(), clang::NestedNameSpecifier::Namespace, clang::NestedNameSpecifier::NamespaceAlias, clang::NestedNameSpecifier::Super, clang::NestedNameSpecifier::TypeSpec, and clang::NestedNameSpecifier::TypeSpecWithTemplate.
| TemplateName ASTImporter::Import | ( | TemplateName | From | ) |
Import the goven template name from the "from" context into the "to" context.
Definition at line 5836 of file ASTImporter.cpp.
References clang::UnresolvedSetImpl::addDecl(), clang::UnresolvedSetImpl::begin(), clang::OverloadedTemplateStorage::begin(), clang::TemplateName::DependentTemplate, E, clang::UnresolvedSetImpl::end(), clang::OverloadedTemplateStorage::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(), I, Import(), clang::ASTNodeImporter::ImportTemplateArgument(), clang::DependentTemplateName::isIdentifier(), clang::TemplateArgument::isNull(), clang::TemplateName::isNull(), clang::TemplateName::OverloadedTemplate, clang::TemplateName::QualifiedTemplate, clang::TemplateName::SubstTemplateTemplateParm, clang::TemplateName::SubstTemplateTemplateParmPack, and clang::TemplateName::Template.
| SourceLocation ASTImporter::Import | ( | SourceLocation | FromLoc | ) |
Import the given source location from the "from" context into the "to" context.
Definition at line 5925 of file ASTImporter.cpp.
References clang::SourceManager::getDecomposedLoc(), clang::SourceManager::getFileLoc(), clang::SourceManager::getLocForStartOfFile(), clang::SourceLocation::getLocWithOffset(), clang::ASTContext::getSourceManager(), Import(), clang::FileID::isInvalid(), and clang::SourceLocation::isInvalid().
| SourceRange ASTImporter::Import | ( | SourceRange | FromRange | ) |
Import the given source range from the "from" context into the "to" context.
Definition at line 5945 of file ASTImporter.cpp.
References clang::SourceRange::getBegin(), clang::SourceRange::getEnd(), and Import().
| DeclarationName ASTImporter::Import | ( | DeclarationName | FromName | ) |
Import the given declaration name from the "from" context into the "to" context.
Definition at line 6098 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 6162 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 6174 of file ASTImporter.cpp.
References clang::Selector::getIdentifierInfoForSlot(), clang::Selector::getNumArgs(), clang::SelectorTable::getSelector(), I, Import(), clang::Selector::isNull(), and clang::ASTContext::Selectors.
Import the given file ID from the "from" context into the "to" context.
Definition at line 5949 of file ASTImporter.cpp.
References clang::SourceManager::createFileID(), clang::SrcMgr::ContentCache::getBuffer(), clang::SrcMgr::FileInfo::getContentCache(), clang::ASTContext::getDiagnostics(), clang::FileEntry::getDir(), clang::FileManager::getFile(), clang::SrcMgr::SLocEntry::getFile(), clang::SrcMgr::FileInfo::getFileCharacteristic(), clang::SrcMgr::FileInfo::getIncludeLoc(), clang::FileEntry::getName(), clang::ASTContext::getSourceManager(), Import(), clang::SrcMgr::SLocEntry::isFile(), and clang::SrcMgr::ContentCache::OrigEntry.
| CXXCtorInitializer * ASTImporter::Import | ( | CXXCtorInitializer * | FromInit | ) |
Import the given C++ constructor initializer from the "from" context into the "to" context.
Definition at line 5992 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 | ) |
Import the given CXXBaseSpecifier from the "from" context into the "to" context.
Definition at line 6039 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().
| DeclContext * ASTImporter::ImportContext | ( | DeclContext * | FromDC | ) |
Import the given declaration context from the "from" AST context into the "to" AST context.
Definition at line 5630 of file ASTImporter.cpp.
References CompleteDecl(), clang::ObjCInterfaceDecl::getDefinition(), clang::ObjCProtocolDecl::getDefinition(), clang::ASTNodeImporter::IDK_Basic, Import(), clang::ASTNodeImporter::ImportDefinition(), and clang::TagDecl::isCompleteDefinition().
Referenced by clang::ASTNodeImporter::ImportDeclContext(), clang::ASTNodeImporter::ImportDeclParts(), clang::ASTNodeImporter::VisitAccessSpecDecl(), clang::ASTNodeImporter::VisitClassTemplateSpecializationDecl(), clang::ASTNodeImporter::VisitFriendDecl(), clang::ASTNodeImporter::VisitLinkageSpecDecl(), clang::ASTNodeImporter::VisitObjCCategoryImplDecl(), clang::ASTNodeImporter::VisitObjCImplementationDecl(), clang::ASTNodeImporter::VisitObjCPropertyImplDecl(), clang::ASTNodeImporter::VisitStaticAssertDecl(), and clang::ASTNodeImporter::VisitVarTemplateSpecializationDecl().
| void ASTImporter::ImportDefinition | ( | Decl * | From | ) |
Import the definition of the given declaration, including all of the declarations it contains.
This routine is intended to be used
Definition at line 6054 of file ASTImporter.cpp.
References clang::ASTNodeImporter::IDK_Everything, Import(), clang::ASTNodeImporter::ImportDeclContext(), and clang::ASTNodeImporter::ImportDefinition().
Note that we have imported the "from" declaration by mapping it to the (potentially-newly-created) "to" declaration.
Subclasses can override this function to observe all of the From -> To declaration mappings as they are imported.
Definition at line 6229 of file ASTImporter.cpp.
References clang::Decl::addAttr(), clang::Decl::getASTContext(), clang::Decl::getAttrs(), clang::Decl::hasAttrs(), clang::Decl::isImplicit(), clang::Decl::isUsed(), clang::Decl::setImplicit(), and clang::Decl::setIsUsed().
Referenced by Import(), clang::ASTNodeImporter::VisitClassTemplateDecl(), clang::ASTNodeImporter::VisitClassTemplateSpecializationDecl(), clang::ASTNodeImporter::VisitEnumConstantDecl(), clang::ASTNodeImporter::VisitEnumDecl(), clang::ASTNodeImporter::VisitFieldDecl(), clang::ASTNodeImporter::VisitFriendDecl(), clang::ASTNodeImporter::VisitFunctionDecl(), clang::ASTNodeImporter::VisitImplicitParamDecl(), clang::ASTNodeImporter::VisitIndirectFieldDecl(), clang::ASTNodeImporter::VisitLabelDecl(), clang::ASTNodeImporter::VisitLinkageSpecDecl(), clang::ASTNodeImporter::VisitNamespaceDecl(), clang::ASTNodeImporter::VisitObjCCategoryDecl(), clang::ASTNodeImporter::VisitObjCCategoryImplDecl(), clang::ASTNodeImporter::VisitObjCImplementationDecl(), clang::ASTNodeImporter::VisitObjCInterfaceDecl(), clang::ASTNodeImporter::VisitObjCIvarDecl(), clang::ASTNodeImporter::VisitObjCMethodDecl(), clang::ASTNodeImporter::VisitObjCPropertyDecl(), clang::ASTNodeImporter::VisitObjCPropertyImplDecl(), clang::ASTNodeImporter::VisitObjCProtocolDecl(), clang::ASTNodeImporter::VisitObjCTypeParamDecl(), clang::ASTNodeImporter::VisitParmVarDecl(), clang::ASTNodeImporter::VisitRecordDecl(), clang::ASTNodeImporter::VisitStaticAssertDecl(), clang::ASTNodeImporter::VisitTranslationUnitDecl(), clang::ASTNodeImporter::VisitTypedefNameDecl(), clang::ASTNodeImporter::VisitVarDecl(), clang::ASTNodeImporter::VisitVarTemplateDecl(), and clang::ASTNodeImporter::VisitVarTemplateSpecializationDecl().
|
inline |
Whether the importer will perform a minimal import, creating to-be-completed forward declarations when possible.
Definition at line 110 of file ASTImporter.h.
Referenced by clang::ASTNodeImporter::ImportDeclContext(), and clang::ASTNodeImporter::shouldForceImportDeclContext().
Determine whether the given types are structurally equivalent.
Definition at line 6244 of file ASTImporter.cpp.
References clang::QualType::getTypePtr(), clang::ASTContext::hasSameType(), Import(), and clang::StructuralEquivalenceContext::IsStructurallyEquivalent().
Referenced by clang::ASTNodeImporter::VisitFieldDecl(), clang::ASTNodeImporter::VisitFriendDecl(), clang::ASTNodeImporter::VisitFunctionDecl(), clang::ASTNodeImporter::VisitIndirectFieldDecl(), clang::ASTNodeImporter::VisitObjCIvarDecl(), clang::ASTNodeImporter::VisitObjCMethodDecl(), clang::ASTNodeImporter::VisitObjCPropertyDecl(), clang::ASTNodeImporter::VisitTypedefNameDecl(), and clang::ASTNodeImporter::VisitVarDecl().
| DiagnosticBuilder ASTImporter::ToDiag | ( | SourceLocation | Loc, |
| unsigned | DiagID | ||
| ) |
Report a diagnostic in the "to" context.
Definition at line 6193 of file ASTImporter.cpp.
References clang::ASTContext::getDiagnostics(), clang::DiagnosticsEngine::notePriorDiagnosticFrom(), and clang::DiagnosticsEngine::Report().
Referenced by clang::ASTNodeImporter::ImportDefinition(), clang::ASTNodeImporter::VisitFieldDecl(), clang::ASTNodeImporter::VisitFunctionDecl(), clang::ASTNodeImporter::VisitIndirectFieldDecl(), clang::ASTNodeImporter::VisitObjCImplementationDecl(), clang::ASTNodeImporter::VisitObjCIvarDecl(), clang::ASTNodeImporter::VisitObjCMethodDecl(), clang::ASTNodeImporter::VisitObjCPropertyDecl(), clang::ASTNodeImporter::VisitObjCPropertyImplDecl(), and clang::ASTNodeImporter::VisitVarDecl().
1.8.6