clang 22.0.0git
clang::ASTImporter Class Reference

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 class  ODRHandlingType { Conservative , Liberal }
using NonEquivalentDeclSet
using ImportedCXXBaseSpecifierMap

Public Member Functions

 ASTImporter (ASTContext &ToContext, FileManager &ToFileManager, ASTContext &FromContext, FileManager &FromFileManager, bool MinimalImport, std::shared_ptr< ASTImporterSharedState > SharedState=nullptr)
virtual ~ASTImporter ()
bool isMinimalImport () const
 Whether the importer will perform a minimal import, creating to-be-completed forward declarations when possible.
void setODRHandling (ODRHandlingType T)
template<typename ImportT>
llvm::Error importInto (ImportT &To, const ImportT &From)
 Import the given object, returns the result.
llvm::Expected< ExprWithCleanups::CleanupObjectImport (ExprWithCleanups::CleanupObject From)
 Import cleanup objects owned by ExprWithCleanup.
llvm::Expected< const Type * > Import (const Type *FromT)
 Import the given type from the "from" context into the "to" context.
llvm::Expected< QualTypeImport (QualType FromT)
 Import the given qualified type from the "from" context into the "to" context.
llvm::Expected< TypeSourceInfo * > Import (TypeSourceInfo *FromTSI)
 Import the given type source information from the "from" context into the "to" context.
llvm::Expected< Attr * > Import (const Attr *FromAttr)
 Import the given attribute from the "from" context into the "to" context.
llvm::Expected< Decl * > Import (Decl *FromD)
 Import the given declaration from the "from" context into the "to" context.
llvm::Expected< const Decl * > Import (const Decl *FromD)
llvm::Expected< InheritedConstructorImport (const InheritedConstructor &From)
DeclGetAlreadyImportedOrNull (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.
TranslationUnitDeclGetFromTU (Decl *ToD)
 Return the translation unit from where the declaration was imported.
template<typename DeclT>
std::optional< DeclT * > getImportedFromDecl (const DeclT *ToD) const
 Return the declaration in the "from" context from which the declaration in the "to" context was imported.
llvm::Expected< DeclContext * > ImportContext (DeclContext *FromDC)
 Import the given declaration context from the "from" AST context into the "to" AST context.
llvm::Expected< Expr * > Import (Expr *FromE)
 Import the given expression from the "from" context into the "to" context.
llvm::Expected< Stmt * > Import (Stmt *FromS)
 Import the given statement from the "from" context into the "to" context.
llvm::Expected< NestedNameSpecifierImport (NestedNameSpecifier FromNNS)
 Import the given nested-name-specifier from the "from" context into the "to" context.
llvm::Expected< NestedNameSpecifierLocImport (NestedNameSpecifierLoc FromNNS)
 Import the given nested-name-specifier-loc from the "from" context into the "to" context.
llvm::Expected< TemplateNameImport (TemplateName From)
 Import the given template name from the "from" context into the "to" context, or the import error.
llvm::Expected< SourceLocationImport (SourceLocation FromLoc)
 Import the given source location from the "from" context into the "to" context.
llvm::Expected< SourceRangeImport (SourceRange FromRange)
 Import the given source range from the "from" context into the "to" context.
llvm::Expected< DeclarationNameImport (DeclarationName FromName)
 Import the given declaration name from the "from" context into the "to" context.
IdentifierInfoImport (const IdentifierInfo *FromId)
 Import the given identifier from the "from" context into the "to" context.
IdentifierOrOverloadedOperator Import (IdentifierOrOverloadedOperator FromIO)
 Import the given identifier or overloaded operator from the "from" context into the "to" context.
llvm::Expected< SelectorImport (Selector FromSel)
 Import the given Objective-C selector from the "from" context into the "to" context.
llvm::Expected< FileIDImport (FileID, bool IsBuiltin=false)
 Import the given file ID from the "from" context into the "to" context.
llvm::Expected< CXXCtorInitializer * > Import (CXXCtorInitializer *FromInit)
 Import the given C++ constructor initializer from the "from" context into the "to" context.
llvm::Expected< CXXBaseSpecifier * > Import (const CXXBaseSpecifier *FromSpec)
 Import the given CXXBaseSpecifier from the "from" context into the "to" context.
llvm::Expected< APValueImport (const APValue &FromValue)
 Import the given APValue from the "from" context into the "to" context.
llvm::Error ImportDefinition (Decl *From)
 Import the definition of the given declaration, including all of the declarations it contains.
llvm::Error ImportTemplateArguments (ArrayRef< TemplateArgument > FromArgs, SmallVectorImpl< TemplateArgument > &ToArgs)
Expected< TemplateArgumentImport (const TemplateArgument &From)
virtual Expected< DeclarationNameHandleNameConflict (DeclarationName Name, DeclContext *DC, unsigned IDNS, NamedDecl **Decls, unsigned NumDecls)
 Cope with a name conflict when importing a declaration into the given context.
ASTContextgetToContext () const
 Retrieve the context that AST nodes are being imported into.
ASTContextgetFromContext () const
 Retrieve the context that AST nodes are being imported from.
FileManagergetToFileManager () const
 Retrieve the file manager that AST nodes are being imported into.
FileManagergetFromFileManager () const
 Retrieve the file manager that AST nodes are being imported from.
DiagnosticBuilder ToDiag (SourceLocation Loc, unsigned DiagID)
 Report a diagnostic in the "to" context.
DiagnosticBuilder FromDiag (SourceLocation Loc, unsigned DiagID)
 Report a diagnostic in the "from" context.
NonEquivalentDeclSetgetNonEquivalentDecls ()
 Return the set of declarations that we know are not equivalent.
virtual void CompleteDecl (Decl *D)
 Called for ObjCInterfaceDecl, ObjCProtocolDecl, and TagDecl.
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.
void RegisterImportedDecl (Decl *FromD, Decl *ToD)
DeclMapImported (Decl *From, Decl *To)
 Store and assign the imported declaration to its counterpart.
virtual DeclGetOriginalDecl (Decl *To)
 Called by StructuralEquivalenceContext.
std::optional< ASTImportErrorgetImportDeclErrorIfAny (Decl *FromD) const
 Return if import of the given declaration has failed and if yes the kind of the problem.
void setImportDeclError (Decl *From, ASTImportError Error)
 Mark (newly) imported declaration with error.
bool IsStructurallyEquivalent (QualType From, QualType To, bool Complain=true)
 Determine whether the given types are structurally equivalent.

Static Public Member Functions

static UnsignedOrNone getFieldIndex (Decl *F)
 Determine the index of a field in its parent record.

Protected Member Functions

virtual Expected< Decl * > ImportImpl (Decl *From)
 Can be overwritten by subclasses to implement their own import logic.
virtual bool returnWithErrorInTest ()
 Used only in unittests to verify the behaviour of the error handling.

Friends

class ASTNodeImporter

Detailed Description

Imports selected nodes from one AST context into another context, merging AST nodes where appropriate.

Definition at line 62 of file ASTImporter.h.

Member Typedef Documentation

◆ ImportedCXXBaseSpecifierMap

Initial value:
llvm::DenseMap<const CXXBaseSpecifier *, CXXBaseSpecifier *>

Definition at line 67 of file ASTImporter.h.

◆ NonEquivalentDeclSet

Initial value:
llvm::DenseSet<std::tuple<Decl *, Decl *, int>>

Definition at line 65 of file ASTImporter.h.

Member Enumeration Documentation

◆ ODRHandlingType

Enumerator
Conservative 
Liberal 

Definition at line 70 of file ASTImporter.h.

Constructor & Destructor Documentation

◆ ASTImporter()

ASTImporter::ASTImporter ( ASTContext & ToContext,
FileManager & ToFileManager,
ASTContext & FromContext,
FileManager & FromFileManager,
bool MinimalImport,
std::shared_ptr< ASTImporterSharedState > SharedState = nullptr )
Parameters
ToContextThe context we'll be importing into.
ToFileManagerThe file manager we'll be importing into.
FromContextThe context we'll be importing from.
FromFileManagerThe file manager we'll be importing into.
MinimalImportIf 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.
SharedStateThe 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 9291 of file ASTImporter.cpp.

References Conservative.

◆ ~ASTImporter()

ASTImporter::~ASTImporter ( )
virtualdefault

Member Function Documentation

◆ CompleteDecl()

void ASTImporter::CompleteDecl ( Decl * D)
virtual

Called for ObjCInterfaceDecl, ObjCProtocolDecl, and TagDecl.

Mark the Decl as complete, filling it in as much as possible.

Parameters
DA declaration in the "to" context.

Definition at line 10709 of file ASTImporter.cpp.

Referenced by ImportContext().

◆ FromDiag()

DiagnosticBuilder ASTImporter::FromDiag ( SourceLocation Loc,
unsigned DiagID )

Report a diagnostic in the "from" context.

Definition at line 10701 of file ASTImporter.cpp.

◆ GetAlreadyImportedOrNull()

Decl * ASTImporter::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.

Otherwise return nullptr.

Definition at line 9713 of file ASTImporter.cpp.

Referenced by Import().

◆ getFieldIndex()

UnsignedOrNone ASTImporter::getFieldIndex ( Decl * F)
static

Determine the index of a field in its parent record.

F should be a field (or indirect field) declaration.

Returns
The index of the field in its parent context (starting from 0). On error std::nullopt is returned (parent context is non-record).

Definition at line 9310 of file ASTImporter.cpp.

References clang::Decl::getDeclContext(), and clang::isa().

Referenced by clang::ASTNodeImporter::VisitFieldDecl(), and clang::ASTNodeImporter::VisitIndirectFieldDecl().

◆ getFromContext()

ASTContext & clang::ASTImporter::getFromContext ( ) const
inline

Retrieve the context that AST nodes are being imported from.

Definition at line 536 of file ASTImporter.h.

◆ getFromFileManager()

FileManager & clang::ASTImporter::getFromFileManager ( ) const
inline

Retrieve the file manager that AST nodes are being imported from.

Definition at line 542 of file ASTImporter.h.

◆ GetFromTU()

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 9717 of file ASTImporter.cpp.

References clang::Decl::getTranslationUnitDecl().

◆ getImportDeclErrorIfAny()

std::optional< ASTImportError > 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 10747 of file ASTImporter.cpp.

Referenced by Import().

◆ getImportedFromDecl()

template<typename DeclT>
std::optional< DeclT * > clang::ASTImporter::getImportedFromDecl ( const DeclT * ToD) const
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 371 of file ASTImporter.h.

◆ getNonEquivalentDecls()

NonEquivalentDeclSet & clang::ASTImporter::getNonEquivalentDecls ( )
inline

Return the set of declarations that we know are not equivalent.

Definition at line 551 of file ASTImporter.h.

◆ GetOriginalDecl()

virtual Decl * clang::ASTImporter::GetOriginalDecl ( Decl * To)
inlinevirtual

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 576 of file ASTImporter.h.

◆ getToContext()

ASTContext & clang::ASTImporter::getToContext ( ) const
inline

Retrieve the context that AST nodes are being imported into.

Definition at line 533 of file ASTImporter.h.

Referenced by Import(), ImportLoopControlStmt(), IsEquivalentFriend(), and IsStructurallyEquivalent().

◆ getToFileManager()

FileManager & clang::ASTImporter::getToFileManager ( ) const
inline

Retrieve the file manager that AST nodes are being imported into.

Definition at line 539 of file ASTImporter.h.

◆ HandleNameConflict()

Expected< DeclarationName > ASTImporter::HandleNameConflict ( DeclarationName Name,
DeclContext * DC,
unsigned IDNS,
NamedDecl ** Decls,
unsigned NumDecls )
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.

Parameters
Namethe name of the declaration being imported, which conflicts with other declarations.
DCthe declaration context (in the "to" AST context) in which the name is being imported.
IDNSthe identifier namespace in which the name will be found.
Declsthe set of declarations with the same name as the declaration being imported.
NumDeclsthe number of conflicting declarations in Decls.
Returns
the name that the newly-imported declaration should have. Or an error if we can't handle the name conflict.

Definition at line 10680 of file ASTImporter.cpp.

References Conservative, and clang::ASTImportError::NameConflict.

◆ Import() [1/24]

llvm::Expected< APValue > ASTImporter::Import ( const APValue & FromValue)

Import the given APValue from the "from" context into the "to" context.

Returns
the equivalent APValue in the "to" context or the import error.

Definition at line 10379 of file ASTImporter.cpp.

References ASTNodeImporter, and clang::ASTNodeImporter::ImportAPValue().

◆ Import() [2/24]

Expected< Attr * > ASTImporter::Import ( const Attr * FromAttr)

Import the given attribute from the "from" context into the "to" context.

Returns
The equivalent attribute in the "to" context, or the import error.

Definition at line 9595 of file ASTImporter.cpp.

References clang::cast(), clang::Attr::getKind(), and Import().

◆ Import() [3/24]

Expected< CXXBaseSpecifier * > ASTImporter::Import ( const CXXBaseSpecifier * FromSpec)

◆ Import() [4/24]

llvm::Expected< const Decl * > clang::ASTImporter::Import ( const Decl * FromD)
inline

Definition at line 351 of file ASTImporter.h.

References Import().

◆ Import() [5/24]

IdentifierInfo * ASTImporter::Import ( const IdentifierInfo * FromId)

Import the given identifier from the "from" context into the "to" context.

Returns
The equivalent identifier in the "to" context. Note: It returns nullptr only if the FromId was nullptr.

Definition at line 10491 of file ASTImporter.cpp.

References clang::IdentifierInfo::getBuiltinID(), clang::IdentifierInfo::getName(), and clang::IdentifierInfo::setBuiltinID().

◆ Import() [6/24]

llvm::Expected< InheritedConstructor > ASTImporter::Import ( const InheritedConstructor & From)

Definition at line 9876 of file ASTImporter.cpp.

References ASTNodeImporter.

◆ Import() [7/24]

Expected< TemplateArgument > clang::ASTImporter::Import ( const TemplateArgument & From)

◆ Import() [8/24]

ExpectedTypePtr ASTImporter::Import ( const Type * FromT)

Import the given type from the "from" context into the "to" context.

Returns
The equivalent type in the "to" context, or the import error.

Definition at line 9408 of file ASTImporter.cpp.

References ASTNodeImporter, and clang::TypeVisitor< ImplClass, RetTy >::Visit().

◆ Import() [9/24]

◆ Import() [10/24]

Expected< Decl * > ASTImporter::Import ( Decl * FromD)

Import the given declaration from the "from" context into the "to" context.

Returns
The equivalent declaration in the "to" context, or the import error.

Definition at line 9724 of file ASTImporter.cpp.

References clang::Decl::addAttr(), clang::Error, GetAlreadyImportedOrNull(), clang::Decl::getAttrs(), clang::Decl::getDeclContext(), getImportDeclErrorIfAny(), clang::Decl::hasAttrs(), Import(), Imported(), ImportImpl(), setImportDeclError(), and clang::updateFlags().

◆ Import() [11/24]

◆ Import() [12/24]

Expected< Expr * > ASTImporter::Import ( Expr * FromE)

Import the given expression from the "from" context into the "to" context.

Returns
The equivalent expression in the "to" context, or the import error.

Definition at line 9947 of file ASTImporter.cpp.

References Import().

◆ Import() [13/24]

◆ Import() [14/24]

◆ Import() [15/24]

Import the given identifier or overloaded operator from the "from" context into the "to" context.

Returns
The equivalent identifier or overloaded operator in the "to" context.

Definition at line 10504 of file ASTImporter.cpp.

References clang::IdentifierOrOverloadedOperator::getIdentifier(), clang::IdentifierOrOverloadedOperator::getOperator(), and Import().

◆ Import() [16/24]

◆ Import() [17/24]

◆ Import() [18/24]

Expected< QualType > ASTImporter::Import ( QualType FromT)

Import the given qualified type from the "from" context into the "to" context.

A null type is imported as a null type (no error).

Returns
The equivalent type in the "to" context, or the import error.

Definition at line 9430 of file ASTImporter.cpp.

References clang::QualType::getLocalQualifiers(), clang::QualType::getTypePtr(), Import(), and clang::QualType::isNull().

◆ Import() [19/24]

Expected< Selector > ASTImporter::Import ( Selector FromSel)

Import the given Objective-C selector from the "from" context into the "to" context.

Returns
The equivalent selector in the "to" context, or the import error.

Definition at line 10510 of file ASTImporter.cpp.

References clang::Selector::getIdentifierInfoForSlot(), clang::Selector::getNumArgs(), Import(), and clang::Selector::isNull().

◆ Import() [20/24]

Expected< SourceLocation > ASTImporter::Import ( SourceLocation FromLoc)

Import the given source location from the "from" context into the "to" context.

Returns
The equivalent source location in the "to" context, or the import error.

Definition at line 10181 of file ASTImporter.cpp.

References clang::SourceManager::getComposedLoc(), clang::SourceManager::getDecomposedLoc(), Import(), clang::SourceLocation::isInvalid(), and clang::SourceManager::isWrittenInBuiltinFile().

◆ Import() [21/24]

Expected< SourceRange > ASTImporter::Import ( SourceRange FromRange)

Import the given source range from the "from" context into the "to" context.

Returns
The equivalent source range in the "to" context, or the import error.

Definition at line 10196 of file ASTImporter.cpp.

References clang::Error, clang::SourceRange::getBegin(), clang::SourceRange::getEnd(), and importInto().

◆ Import() [22/24]

Expected< Stmt * > ASTImporter::Import ( Stmt * FromS)

Import the given statement from the "from" context into the "to" context.

Returns
The equivalent statement in the "to" context, or the import error.

Definition at line 9954 of file ASTImporter.cpp.

References ASTNodeImporter, clang::cast(), and clang::TypeVisitor< ImplClass, RetTy >::Visit().

◆ Import() [23/24]

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 10085 of file ASTImporter.cpp.

References clang::UnresolvedSetImpl::addDecl(), clang::TemplateName::AssumedTemplate, ASTNodeImporter, clang::UnresolvedSetImpl::begin(), clang::cast(), clang::TemplateName::DeducedTemplate, clang::TemplateName::DependentTemplate, clang::UnresolvedSetImpl::end(), clang::SubstTemplateTemplateParmPackStorage::getArgumentPack(), clang::TemplateName::getAsAssumedTemplateName(), clang::TemplateName::getAsDependentTemplateName(), clang::TemplateName::getAsOverloadedTemplate(), clang::TemplateName::getAsQualifiedTemplateName(), clang::SubstTemplateTemplateParmPackStorage::getAssociatedDecl(), clang::SubstTemplateTemplateParmStorage::getAssociatedDecl(), clang::TemplateName::getAsSubstTemplateTemplateParm(), clang::TemplateName::getAsSubstTemplateTemplateParmPack(), clang::TemplateName::getAsTemplateDecl(), clang::TemplateName::getAsUsingShadowDecl(), clang::AssumedTemplateStorage::getDeclName(), clang::SubstTemplateTemplateParmPackStorage::getFinal(), clang::SubstTemplateTemplateParmStorage::getFinal(), clang::SubstTemplateTemplateParmPackStorage::getIndex(), clang::SubstTemplateTemplateParmStorage::getIndex(), clang::TemplateName::getKind(), clang::DependentTemplateStorage::getName(), clang::SubstTemplateTemplateParmStorage::getPackIndex(), clang::DependentTemplateStorage::getQualifier(), clang::QualifiedTemplateName::getQualifier(), clang::SubstTemplateTemplateParmStorage::getReplacement(), clang::QualifiedTemplateName::getUnderlyingTemplate(), clang::DependentTemplateStorage::hasTemplateKeyword(), clang::QualifiedTemplateName::hasTemplateKeyword(), Import(), clang::ASTNodeImporter::ImportTemplateArgument(), clang::TemplateName::OverloadedTemplate, clang::TemplateName::QualifiedTemplate, clang::TemplateName::SubstTemplateTemplateParm, clang::TemplateName::SubstTemplateTemplateParmPack, clang::TemplateName::Template, clang::TemplateName, and clang::TemplateName::UsingTemplate.

◆ Import() [24/24]

Expected< TypeSourceInfo * > ASTImporter::Import ( TypeSourceInfo * FromTSI)

Import the given type source information from the "from" context into the "to" context.

Returns
The equivalent type source information in the "to" context, or the import error.

Definition at line 9441 of file ASTImporter.cpp.

References clang::TypeLoc::getBeginLoc(), clang::TypeSourceInfo::getType(), clang::TypeSourceInfo::getTypeLoc(), and Import().

◆ ImportContext()

Expected< DeclContext * > ASTImporter::ImportContext ( DeclContext * FromDC)

Import the given declaration context from the "from" AST context into the "to" AST context.

Returns
the equivalent declaration context in the "to" context, or error value.

Definition at line 9880 of file ASTImporter.cpp.

References ASTNodeImporter, clang::cast(), CompleteDecl(), clang::Error, clang::ObjCInterfaceDecl::getDefinition(), clang::ObjCProtocolDecl::getDefinition(), clang::ASTNodeImporter::IDK_Basic, and Import().

◆ ImportDefinition()

Error ASTImporter::ImportDefinition ( Decl * From)
nodiscard

Import the definition of the given declaration, including all of the declarations it contains.

Definition at line 10384 of file ASTImporter.cpp.

References ASTNodeImporter, clang::cast(), clang::Error, clang::ASTNodeImporter::IDK_Everything, Import(), clang::ASTNodeImporter::ImportDeclContext(), and clang::ASTNodeImporter::ImportDefinition().

◆ Imported()

virtual void clang::ASTImporter::Imported ( Decl * From,
Decl * To )
inlinevirtual

Subclasses can override this function to observe all of the From -> To declaration mappings as they are imported.

Definition at line 561 of file ASTImporter.h.

Referenced by Import(), and Import().

◆ ImportImpl()

Expected< Decl * > ASTImporter::ImportImpl ( Decl * From)
protectedvirtual

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 9386 of file ASTImporter.cpp.

References ASTNodeImporter, and clang::TypeVisitor< ImplClass, RetTy >::Visit().

Referenced by Import().

◆ importInto()

template<typename ImportT>
llvm::Error clang::ASTImporter::importInto ( ImportT & To,
const ImportT & From )
inlinenodiscard

Import the given object, returns the result.

Parameters
ToImport the object into this variable.
FromObject to import.
Returns
Error information (success or error).

Definition at line 308 of file ASTImporter.h.

References Import().

Referenced by Import(), Import(), and Import().

◆ ImportTemplateArguments()

llvm::Error clang::ASTImporter::ImportTemplateArguments ( ArrayRef< TemplateArgument > FromArgs,
SmallVectorImpl< TemplateArgument > & ToArgs )

◆ isMinimalImport()

bool clang::ASTImporter::isMinimalImport ( ) const
inline

Whether the importer will perform a minimal import, creating to-be-completed forward declarations when possible.

Definition at line 298 of file ASTImporter.h.

Referenced by getStructuralEquivalenceKind().

◆ IsStructurallyEquivalent()

bool ASTImporter::IsStructurallyEquivalent ( QualType From,
QualType To,
bool Complain = true )

Determine whether the given types are structurally equivalent.

Definition at line 10763 of file ASTImporter.cpp.

References getStructuralEquivalenceKind(), getToContext(), clang::QualType::getTypePtr(), Import(), and clang::StructuralEquivalenceContext::IsEquivalent().

Referenced by IsEquivalentFriend().

◆ MapImported()

Decl * ASTImporter::MapImported ( Decl * From,
Decl * To )

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 10729 of file ASTImporter.cpp.

References clang::Decl::getDeclContext().

Referenced by RegisterImportedDecl().

◆ RegisterImportedDecl()

void ASTImporter::RegisterImportedDecl ( Decl * FromD,
Decl * ToD )

Definition at line 9392 of file ASTImporter.cpp.

References MapImported().

◆ returnWithErrorInTest()

virtual bool clang::ASTImporter::returnWithErrorInTest ( )
inlineprotectedvirtual

Used only in unittests to verify the behaviour of the error handling.

Definition at line 270 of file ASTImporter.h.

◆ setImportDeclError()

void ASTImporter::setImportDeclError ( Decl * From,
ASTImportError Error )

Mark (newly) imported declaration with error.

Definition at line 10755 of file ASTImporter.cpp.

References clang::Error.

Referenced by Import().

◆ setODRHandling()

void clang::ASTImporter::setODRHandling ( ODRHandlingType T)
inline

Definition at line 300 of file ASTImporter.h.

References clang::T.

◆ ToDiag()

DiagnosticBuilder ASTImporter::ToDiag ( SourceLocation Loc,
unsigned DiagID )

Report a diagnostic in the "to" context.

Definition at line 10693 of file ASTImporter.cpp.

◆ ASTNodeImporter

friend class ASTNodeImporter
friend

The documentation for this class was generated from the following files: