clang
3.9.0
|
#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/Basic/OpenCLImageTypes.def"
#include "clang/AST/BuiltinTypes.def"
Go to the source code of this file.
Classes | |
class | clang::ASTNodeImporter |
Namespaces | |
clang | |
Dataflow Directional Tag Classes. | |
Macros | |
#define | IMAGE_TYPE(ImgType, Id, SingletonId, Access, Suffix) |
#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. More... | |
static bool | IsStructurallyEquivalent (StructuralEquivalenceContext &Context, Decl *D1, Decl *D2) |
Determine structural equivalence of two declarations. More... | |
static bool | IsStructurallyEquivalent (StructuralEquivalenceContext &Context, Expr *E1, Expr *E2) |
Determine structural equivalence of two expressions. More... | |
static bool | IsStructurallyEquivalent (const IdentifierInfo *Name1, const IdentifierInfo *Name2) |
Determine whether two identifiers are equivalent. More... | |
static bool | IsStructurallyEquivalent (StructuralEquivalenceContext &Context, NestedNameSpecifier *NNS1, NestedNameSpecifier *NNS2) |
Determine whether two nested-name-specifiers are equivalent. More... | |
static bool | IsStructurallyEquivalent (StructuralEquivalenceContext &Context, const TemplateArgument &Arg1, const TemplateArgument &Arg2) |
Determine whether two template arguments are equivalent. More... | |
static bool | IsArrayStructurallyEquivalent (StructuralEquivalenceContext &Context, const ArrayType *Array1, const ArrayType *Array2) |
Determine structural equivalence for the common part of array types. More... | |
static bool | IsStructurallyEquivalent (StructuralEquivalenceContext &Context, FieldDecl *Field1, FieldDecl *Field2) |
Determine structural equivalence of two fields. More... | |
static Optional< unsigned > | findUntaggedStructOrUnionIndex (RecordDecl *Anon) |
Find the index of the given anonymous struct/union within its context. More... | |
static bool | IsStructurallyEquivalent (StructuralEquivalenceContext &Context, RecordDecl *D1, RecordDecl *D2) |
Determine structural equivalence of two records. More... | |
static bool | IsStructurallyEquivalent (StructuralEquivalenceContext &Context, EnumDecl *D1, EnumDecl *D2) |
Determine structural equivalence of two enums. More... | |
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 IMAGE_TYPE | ( | ImgType, | |
Id, | |||
SingletonId, | |||
Access, | |||
Suffix | |||
) |
#define SHARED_SINGLETON_TYPE | ( | Expansion | ) |
|
static |
Find the index of the given anonymous struct/union within its context.
Definition at line 1032 of file ASTImporter.cpp.
References Context, clang::NamedDecl::getIdentifier(), clang::ASTContext::getRecordType(), clang::ASTContext::hasSameType(), clang::DeclContext::noload_decls(), and clang::None.
Referenced by IsStructurallyEquivalent(), and clang::ASTNodeImporter::VisitRecordDecl().
Definition at line 3155 of file ASTImporter.cpp.
References clang::DeclContext::noload_decls().
Referenced by clang::ASTNodeImporter::VisitFieldDecl(), and clang::ASTNodeImporter::VisitIndirectFieldDecl().
|
static |
Definition at line 5766 of file ASTImporter.cpp.
References clang::CastExpr::path_empty().
Referenced by clang::ASTNodeImporter::VisitCStyleCastExpr(), clang::ASTNodeImporter::VisitCXXNamedCastExpr(), and clang::ASTNodeImporter::VisitImplicitCastExpr().
|
static |
Determine structural equivalence for the common part of array types.
Definition at line 450 of file ASTImporter.cpp.
References clang::ArrayType::getElementType(), clang::ArrayType::getIndexTypeQualifiers(), clang::ArrayType::getSizeModifier(), and IsStructurallyEquivalent().
Referenced by IsStructurallyEquivalent().
|
static |
Determine structural equivalence of two types.
Definition at line 466 of file ASTImporter.cpp.
References clang::Auto, clang::DependentTemplateSpecializationType(), clang::EST_ComputedNoexcept, clang::EST_Dynamic, clang::SubstTemplateTypeParmPackType::getArgumentPack(), clang::ObjCObjectType::getBaseType(), clang::MemberPointerType::getClass(), clang::ObjCInterfaceType::getDecl(), clang::TemplateTypeParmType::getDepth(), clang::DependentSizedExtVectorType::getElementType(), clang::VectorType::getElementType(), clang::FunctionProtoType::getExceptionSpecType(), clang::FunctionProtoType::getExceptionType(), clang::FunctionType::getExtInfo(), clang::DependentNameType::getIdentifier(), clang::TemplateTypeParmType::getIndex(), clang::InjectedClassNameType::getInjectedSpecializationType(), clang::TypeWithKeyword::getKeyword(), getKind(), clang::ElaboratedType::getNamedType(), clang::FunctionProtoType::getNoexceptExpr(), 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::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::Type::getTypeClass(), clang::FunctionProtoType::getTypeQuals(), getUnderlyingType(), clang::VectorType::getVectorKind(), I, IsArrayStructurallyEquivalent(), clang::ReferenceType::isInnerRef(), clang::QualType::isNull(), clang::TemplateTypeParmType::isParameterPack(), clang::ReferenceType::isSpelledAsLValue(), clang::FunctionProtoType::isVariadic(), Paren, and clang::TemplateSpecializationType().
Referenced by IsArrayStructurallyEquivalent(), and IsStructurallyEquivalent().
|
static |
Determine structural equivalence of two declarations.
Definition at line 1394 of file ASTImporter.cpp.
|
static |
Determine structural equivalence of two expressions.
Definition at line 365 of file ASTImporter.cpp.
|
static |
Determine whether two identifiers are equivalent.
Definition at line 375 of file ASTImporter.cpp.
References clang::IdentifierInfo::getName().
|
static |
Determine whether two nested-name-specifiers are equivalent.
Definition at line 384 of file ASTImporter.cpp.
|
static |
Determine whether two template arguments are equivalent.
Definition at line 392 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(), I, 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 |
Determine structural equivalence of two fields.
Definition at line 950 of file ASTImporter.cpp.
References clang::Type::castAs(), clang::FieldDecl::getBitWidthValue(), clang::NamedDecl::getDeclName(), clang::NamedDecl::getIdentifier(), clang::ValueDecl::getType(), clang::FieldDecl::isAnonymousStructOrUnion(), clang::FieldDecl::isBitField(), and IsStructurallyEquivalent().
|
static |
Determine structural equivalence of two records.
Definition at line 1072 of file ASTImporter.cpp.
References clang::RecordDecl::field_begin(), clang::RecordDecl::field_end(), findUntaggedStructOrUnionIndex(), clang::TemplateArgumentList::get(), clang::NamedDecl::getDeclName(), clang::RecordDecl::getDefinition(), clang::CXXBaseSpecifier::getLocStart(), clang::CXXBaseSpecifier::getSourceRange(), clang::ClassTemplateSpecializationDecl::getSpecializedTemplate(), clang::TagDecl::getTagKind(), clang::ClassTemplateSpecializationDecl::getTemplateArgs(), clang::CXXBaseSpecifier::getType(), I, clang::RecordDecl::isAnonymousStructOrUnion(), IsStructurallyEquivalent(), clang::TagDecl::isUnion(), and clang::TemplateArgumentList::size().
|
static |
Determine structural equivalence of two enums.
Definition at line 1230 of file ASTImporter.cpp.
References clang::EnumDecl::enumerator_begin(), clang::EnumDecl::enumerator_end(), and IsStructurallyEquivalent().
|
static |
Definition at line 1282 of file ASTImporter.cpp.
References clang::TemplateParameterList::getParam(), clang::TemplateParameterList::getTemplateLoc(), I, and clang::TemplateParameterList::size().
|
static |
Definition at line 1317 of file ASTImporter.cpp.
References clang::TemplateTypeParmDecl::isParameterPack().
|
static |
Definition at line 1333 of file ASTImporter.cpp.
References clang::ValueDecl::getType(), and clang::NonTypeTemplateParmDecl::isParameterPack().
|
static |
Definition at line 1361 of file ASTImporter.cpp.
References clang::TemplateDecl::getTemplateParameters(), clang::TemplateTemplateParmDecl::isParameterPack(), and IsStructurallyEquivalent().
|
static |
Definition at line 1379 of file ASTImporter.cpp.
References clang::ClassTemplateDecl::getTemplatedDecl(), clang::TemplateDecl::getTemplateParameters(), and IsStructurallyEquivalent().