clang API Documentation
#include "clang/AST/ASTImporter.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/ASTDiagnostic.h"
#include "clang/AST/DeclCXX.h"
#include "clang/AST/DeclObjC.h"
#include "clang/AST/DeclVisitor.h"
#include "clang/AST/StmtVisitor.h"
#include "clang/AST/TypeVisitor.h"
#include "clang/Basic/FileManager.h"
#include "clang/Basic/SourceManager.h"
#include "llvm/Support/MemoryBuffer.h"
#include <deque>
#include "clang/AST/BuiltinTypes.def"
Go to the source code of this file.
Classes | |
class | clang::ASTNodeImporter |
Namespaces | |
namespace | clang |
Defines | |
#define | SHARED_SINGLETON_TYPE(Expansion) |
#define | BUILTIN_TYPE(Id, SingletonId) case BuiltinType::Id: return Importer.getToContext().SingletonId; |
Functions | |
static bool | IsStructurallyEquivalent (StructuralEquivalenceContext &Context, QualType T1, QualType T2) |
Determine structural equivalence of two types. | |
static bool | IsStructurallyEquivalent (StructuralEquivalenceContext &Context, Decl *D1, Decl *D2) |
Determine structural equivalence of two declarations. | |
static bool | IsStructurallyEquivalent (StructuralEquivalenceContext &Context, Expr *E1, Expr *E2) |
Determine structural equivalence of two expressions. | |
static bool | IsStructurallyEquivalent (const IdentifierInfo *Name1, const IdentifierInfo *Name2) |
Determine whether two identifiers are equivalent. | |
static bool | IsStructurallyEquivalent (StructuralEquivalenceContext &Context, NestedNameSpecifier *NNS1, NestedNameSpecifier *NNS2) |
Determine whether two nested-name-specifiers are equivalent. | |
static bool | IsStructurallyEquivalent (StructuralEquivalenceContext &Context, const TemplateArgument &Arg1, const TemplateArgument &Arg2) |
Determine whether two template arguments are equivalent. | |
static bool | IsArrayStructurallyEquivalent (StructuralEquivalenceContext &Context, const ArrayType *Array1, const ArrayType *Array2) |
Determine structural equivalence for the common part of array types. | |
static bool | IsStructurallyEquivalent (StructuralEquivalenceContext &Context, FieldDecl *Field1, FieldDecl *Field2) |
Determine structural equivalence of two fields. | |
static Optional< unsigned > | findAnonymousStructOrUnionIndex (RecordDecl *Anon) |
Find the index of the given anonymous struct/union within its context. | |
static bool | IsStructurallyEquivalent (StructuralEquivalenceContext &Context, RecordDecl *D1, RecordDecl *D2) |
Determine structural equivalence of two records. | |
static bool | IsStructurallyEquivalent (StructuralEquivalenceContext &Context, EnumDecl *D1, EnumDecl *D2) |
Determine structural equivalence of two enums. | |
static bool | IsStructurallyEquivalent (StructuralEquivalenceContext &Context, TemplateParameterList *Params1, TemplateParameterList *Params2) |
static bool | IsStructurallyEquivalent (StructuralEquivalenceContext &Context, TemplateTypeParmDecl *D1, TemplateTypeParmDecl *D2) |
static bool | IsStructurallyEquivalent (StructuralEquivalenceContext &Context, NonTypeTemplateParmDecl *D1, NonTypeTemplateParmDecl *D2) |
static bool | IsStructurallyEquivalent (StructuralEquivalenceContext &Context, TemplateTemplateParmDecl *D1, TemplateTemplateParmDecl *D2) |
static bool | IsStructurallyEquivalent (StructuralEquivalenceContext &Context, ClassTemplateDecl *D1, ClassTemplateDecl *D2) |
static unsigned | getFieldIndex (Decl *F) |
static bool | ImportCastPath (CastExpr *E, CXXCastPath &Path) |
#define BUILTIN_TYPE | ( | Id, | |
SingletonId | |||
) | case BuiltinType::Id: return Importer.getToContext().SingletonId; |
#define SHARED_SINGLETON_TYPE | ( | Expansion | ) |
static Optional<unsigned> findAnonymousStructOrUnionIndex | ( | RecordDecl * | Anon | ) | [static] |
Find the index of the given anonymous struct/union within its context.
Definition at line 924 of file ASTImporter.cpp.
References Context, clang::Decl::getASTContext(), clang::Decl::getDeclContext(), clang::ASTContext::getRecordType(), clang::ASTContext::hasSameType(), and clang::DeclContext::noload_decls().
Referenced by IsStructurallyEquivalent(), and clang::ASTNodeImporter::VisitRecordDecl().
static unsigned getFieldIndex | ( | Decl * | F | ) | [static] |
Definition at line 2835 of file ASTImporter.cpp.
References clang::Decl::getDeclContext(), and clang::DeclContext::noload_decls().
Referenced by clang::ASTNodeImporter::VisitFieldDecl(), and clang::ASTNodeImporter::VisitIndirectFieldDecl().
static bool ImportCastPath | ( | CastExpr * | E, |
CXXCastPath & | Path | ||
) | [static] |
Definition at line 4509 of file ASTImporter.cpp.
References clang::CastExpr::path_empty().
Referenced by clang::ASTNodeImporter::VisitCStyleCastExpr(), and clang::ASTNodeImporter::VisitImplicitCastExpr().
static bool IsArrayStructurallyEquivalent | ( | StructuralEquivalenceContext & | Context, |
const ArrayType * | Array1, | ||
const ArrayType * | Array2 | ||
) | [static] |
Determine structural equivalence for the common part of array types.
Definition at line 350 of file ASTImporter.cpp.
References clang::ArrayType::getElementType(), clang::ArrayType::getIndexTypeQualifiers(), clang::ArrayType::getSizeModifier(), and IsStructurallyEquivalent().
Referenced by IsStructurallyEquivalent().
static bool IsStructurallyEquivalent | ( | StructuralEquivalenceContext & | Context, |
QualType | T1, | ||
QualType | T2 | ||
) | [static] |
Determine structural equivalence of two types.
Definition at line 366 of file ASTImporter.cpp.
References clang::EST_ComputedNoexcept, clang::EST_Dynamic, clang::TemplateSpecializationType::getArg(), clang::DependentTemplateSpecializationType::getArg(), clang::SubstTemplateTypeParmPackType::getArgumentPack(), clang::ObjCObjectType::getBaseType(), clang::MemberPointerType::getClass(), clang::ObjCInterfaceType::getDecl(), clang::TemplateTypeParmType::getDepth(), clang::DependentSizedExtVectorType::getElementType(), clang::VectorType::getElementType(), getElementType(), clang::FunctionProtoType::getExceptionSpecType(), clang::FunctionProtoType::getExceptionType(), clang::FunctionType::getExtInfo(), clang::DependentNameType::getIdentifier(), clang::DependentTemplateSpecializationType::getIdentifier(), clang::TemplateTypeParmType::getIndex(), clang::InjectedClassNameType::getInjectedSpecializationType(), clang::TypeWithKeyword::getKeyword(), getKind(), clang::ElaboratedType::getNamedType(), clang::FunctionProtoType::getNoexceptExpr(), clang::TemplateSpecializationType::getNumArgs(), clang::DependentTemplateSpecializationType::getNumArgs(), clang::VectorType::getNumElements(), clang::FunctionProtoType::getNumExceptions(), clang::FunctionProtoType::getNumParams(), clang::ObjCObjectType::getNumProtocols(), clang::FunctionProtoType::getParamType(), clang::Type::getPointeeType(), clang::MemberPointerType::getPointeeType(), clang::ObjCObjectPointerType::getPointeeType(), clang::ReferenceType::getPointeeTypeAsWritten(), clang::ObjCObjectType::getProtocol(), clang::ElaboratedType::getQualifier(), clang::DependentNameType::getQualifier(), clang::DependentTemplateSpecializationType::getQualifier(), clang::QualType::getQualifiers(), clang::SubstTemplateTypeParmType::getReplacedParameter(), clang::SubstTemplateTypeParmPackType::getReplacedParameter(), clang::SubstTemplateTypeParmType::getReplacementType(), clang::FunctionType::getReturnType(), clang::ConstantArrayType::getSize(), clang::VariableArrayType::getSizeExpr(), clang::DependentSizedArrayType::getSizeExpr(), clang::DependentSizedExtVectorType::getSizeExpr(), clang::TemplateSpecializationType::getTemplateName(), clang::Type::getTypeClass(), clang::FunctionProtoType::getTypeQuals(), getUnderlyingType(), clang::VectorType::getVectorKind(), IsArrayStructurallyEquivalent(), clang::ReferenceType::isInnerRef(), clang::QualType::isNull(), clang::TemplateTypeParmType::isParameterPack(), clang::ReferenceType::isSpelledAsLValue(), clang::FunctionProtoType::isVariadic(), Paren, and Record.
Referenced by IsArrayStructurallyEquivalent(), and IsStructurallyEquivalent().
static bool IsStructurallyEquivalent | ( | StructuralEquivalenceContext & | Context, |
Decl * | D1, | ||
Decl * | D2 | ||
) | [static] |
Determine structural equivalence of two declarations.
Definition at line 1270 of file ASTImporter.cpp.
References clang::Decl::getCanonicalDecl().
static bool IsStructurallyEquivalent | ( | StructuralEquivalenceContext & | Context, |
Expr * | E1, | ||
Expr * | E2 | ||
) | [static] |
Determine structural equivalence of two expressions.
Definition at line 265 of file ASTImporter.cpp.
static bool IsStructurallyEquivalent | ( | const IdentifierInfo * | Name1, |
const IdentifierInfo * | Name2 | ||
) | [static] |
Determine whether two identifiers are equivalent.
Definition at line 275 of file ASTImporter.cpp.
References clang::IdentifierInfo::getName().
static bool IsStructurallyEquivalent | ( | StructuralEquivalenceContext & | Context, |
NestedNameSpecifier * | NNS1, | ||
NestedNameSpecifier * | NNS2 | ||
) | [static] |
Determine whether two nested-name-specifiers are equivalent.
Definition at line 284 of file ASTImporter.cpp.
static bool IsStructurallyEquivalent | ( | StructuralEquivalenceContext & | Context, |
const TemplateArgument & | Arg1, | ||
const TemplateArgument & | Arg2 | ||
) | [static] |
Determine whether two template arguments are equivalent.
Definition at line 292 of file ASTImporter.cpp.
References clang::TemplateArgument::Declaration, clang::TemplateArgument::Expression, clang::TemplateArgument::getAsDecl(), clang::TemplateArgument::getAsExpr(), clang::TemplateArgument::getAsIntegral(), clang::TemplateArgument::getAsTemplate(), clang::TemplateArgument::getAsTemplateOrTemplatePattern(), clang::TemplateArgument::getAsType(), clang::TemplateArgument::getIntegralType(), clang::TemplateArgument::getKind(), clang::TemplateArgument::Integral, IsStructurallyEquivalent(), clang::TemplateArgument::Null, clang::TemplateArgument::NullPtr, clang::TemplateArgument::Pack, clang::TemplateArgument::pack_begin(), clang::TemplateArgument::pack_size(), clang::TemplateArgument::Template, clang::TemplateArgument::TemplateExpansion, and clang::TemplateArgument::Type.
static bool IsStructurallyEquivalent | ( | StructuralEquivalenceContext & | Context, |
FieldDecl * | Field1, | ||
FieldDecl * | Field2 | ||
) | [static] |
Determine structural equivalence of two fields.
Definition at line 842 of file ASTImporter.cpp.
References clang::Type::castAs(), clang::FieldDecl::getBitWidthValue(), clang::Decl::getDeclContext(), clang::NamedDecl::getDeclName(), clang::NamedDecl::getIdentifier(), clang::Decl::getLocation(), clang::ValueDecl::getType(), clang::FieldDecl::isAnonymousStructOrUnion(), clang::FieldDecl::isBitField(), and IsStructurallyEquivalent().
static bool IsStructurallyEquivalent | ( | StructuralEquivalenceContext & | Context, |
RecordDecl * | D1, | ||
RecordDecl * | D2 | ||
) | [static] |
Determine structural equivalence of two records.
Definition at line 948 of file ASTImporter.cpp.
References findAnonymousStructOrUnionIndex(), clang::TemplateArgumentList::get(), clang::NamedDecl::getDeclName(), clang::RecordDecl::getDefinition(), clang::Decl::getLocation(), clang::CXXBaseSpecifier::getLocStart(), clang::CXXBaseSpecifier::getSourceRange(), clang::ClassTemplateSpecializationDecl::getSpecializedTemplate(), clang::TagDecl::getTagKind(), clang::ClassTemplateSpecializationDecl::getTemplateArgs(), clang::CXXBaseSpecifier::getType(), clang::RecordDecl::isAnonymousStructOrUnion(), IsStructurallyEquivalent(), clang::TagDecl::isUnion(), and clang::TemplateArgumentList::size().
static bool IsStructurallyEquivalent | ( | StructuralEquivalenceContext & | Context, |
EnumDecl * | D1, | ||
EnumDecl * | D2 | ||
) | [static] |
Determine structural equivalence of two enums.
Definition at line 1106 of file ASTImporter.cpp.
References clang::Decl::getLocation(), and IsStructurallyEquivalent().
static bool IsStructurallyEquivalent | ( | StructuralEquivalenceContext & | Context, |
TemplateParameterList * | Params1, | ||
TemplateParameterList * | Params2 | ||
) | [static] |
Definition at line 1158 of file ASTImporter.cpp.
References clang::Decl::getKind(), clang::Decl::getLocation(), clang::TemplateParameterList::getParam(), clang::TemplateParameterList::getTemplateLoc(), and clang::TemplateParameterList::size().
static bool IsStructurallyEquivalent | ( | StructuralEquivalenceContext & | Context, |
TemplateTypeParmDecl * | D1, | ||
TemplateTypeParmDecl * | D2 | ||
) | [static] |
Definition at line 1193 of file ASTImporter.cpp.
References clang::Decl::getLocation(), and clang::TemplateTypeParmDecl::isParameterPack().
static bool IsStructurallyEquivalent | ( | StructuralEquivalenceContext & | Context, |
NonTypeTemplateParmDecl * | D1, | ||
NonTypeTemplateParmDecl * | D2 | ||
) | [static] |
Definition at line 1209 of file ASTImporter.cpp.
References clang::Decl::getLocation(), clang::ValueDecl::getType(), and clang::NonTypeTemplateParmDecl::isParameterPack().
static bool IsStructurallyEquivalent | ( | StructuralEquivalenceContext & | Context, |
TemplateTemplateParmDecl * | D1, | ||
TemplateTemplateParmDecl * | D2 | ||
) | [static] |
Definition at line 1237 of file ASTImporter.cpp.
References clang::Decl::getLocation(), clang::TemplateDecl::getTemplateParameters(), clang::TemplateTemplateParmDecl::isParameterPack(), and IsStructurallyEquivalent().
static bool IsStructurallyEquivalent | ( | StructuralEquivalenceContext & | Context, |
ClassTemplateDecl * | D1, | ||
ClassTemplateDecl * | D2 | ||
) | [static] |
Definition at line 1255 of file ASTImporter.cpp.
References clang::ClassTemplateDecl::getTemplatedDecl(), clang::TemplateDecl::getTemplateParameters(), and IsStructurallyEquivalent().