clang  10.0.0svn
Functions
ASTStructuralEquivalence.cpp File Reference
#include "clang/AST/ASTStructuralEquivalence.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/ASTDiagnostic.h"
#include "clang/AST/Decl.h"
#include "clang/AST/DeclBase.h"
#include "clang/AST/DeclCXX.h"
#include "clang/AST/DeclFriend.h"
#include "clang/AST/DeclObjC.h"
#include "clang/AST/DeclTemplate.h"
#include "clang/AST/ExprCXX.h"
#include "clang/AST/NestedNameSpecifier.h"
#include "clang/AST/TemplateBase.h"
#include "clang/AST/TemplateName.h"
#include "clang/AST/Type.h"
#include "clang/Basic/ExceptionSpecificationType.h"
#include "clang/Basic/IdentifierTable.h"
#include "clang/Basic/LLVM.h"
#include "clang/Basic/SourceLocation.h"
#include "llvm/ADT/APInt.h"
#include "llvm/ADT/APSInt.h"
#include "llvm/ADT/None.h"
#include "llvm/ADT/Optional.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/ErrorHandling.h"
#include <cassert>
#include <utility>
Include dependency graph for ASTStructuralEquivalence.cpp:

Go to the source code of this file.

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, const TemplateArgument &Arg1, const TemplateArgument &Arg2)
 Determine whether two template arguments are equivalent. More...
 
static bool IsStructurallyEquivalent (StructuralEquivalenceContext &Context, NestedNameSpecifier *NNS1, NestedNameSpecifier *NNS2)
 Determine whether two nested-name-specifiers are equivalent. More...
 
static bool IsStructurallyEquivalent (const IdentifierInfo *Name1, const IdentifierInfo *Name2)
 Determine whether two identifiers are equivalent. More...
 
static bool IsStructurallyEquivalent (StructuralEquivalenceContext &Context, const DeclarationName Name1, const DeclarationName Name2)
 
static bool IsStructurallyEquivalent (StructuralEquivalenceContext &Context, const Expr *E1, const Expr *E2)
 Determine structural equivalence of two expressions. More...
 
static bool IsStructurallyEquivalent (StructuralEquivalenceContext &Context, const TemplateName &N1, const TemplateName &N2)
 
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, FunctionType::ExtInfo EI1, FunctionType::ExtInfo EI2)
 Determine structural equivalence based on the ExtInfo of functions. More...
 
static bool IsEquivalentExceptionSpec (StructuralEquivalenceContext &Context, const FunctionProtoType *Proto1, const FunctionProtoType *Proto2)
 Check the equivalence of exception specifications. More...
 
static bool IsStructurallyEquivalent (StructuralEquivalenceContext &Context, FieldDecl *Field1, FieldDecl *Field2)
 Determine structural equivalence of two fields. More...
 
static bool IsStructurallyEquivalent (StructuralEquivalenceContext &Context, CXXMethodDecl *Method1, CXXMethodDecl *Method2)
 Determine structural equivalence of two methods. More...
 
static bool IsStructurallyEquivalentLambdas (StructuralEquivalenceContext &Context, CXXRecordDecl *D1, CXXRecordDecl *D2)
 Determine structural equivalence of two lambda classes. 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 IsTemplateDeclCommonStructurallyEquivalent (StructuralEquivalenceContext &Ctx, TemplateDecl *D1, TemplateDecl *D2)
 
static bool IsStructurallyEquivalent (StructuralEquivalenceContext &Context, ClassTemplateDecl *D1, ClassTemplateDecl *D2)
 
static bool IsStructurallyEquivalent (StructuralEquivalenceContext &Context, FunctionTemplateDecl *D1, FunctionTemplateDecl *D2)
 
static bool IsStructurallyEquivalent (StructuralEquivalenceContext &Context, ConceptDecl *D1, ConceptDecl *D2)
 
static bool IsStructurallyEquivalent (StructuralEquivalenceContext &Context, FriendDecl *D1, FriendDecl *D2)
 
static bool IsStructurallyEquivalent (StructuralEquivalenceContext &Context, FunctionDecl *D1, FunctionDecl *D2)
 

Function Documentation

◆ IsArrayStructurallyEquivalent()

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 364 of file ASTStructuralEquivalence.cpp.

◆ IsEquivalentExceptionSpec()

static bool IsEquivalentExceptionSpec ( StructuralEquivalenceContext Context,
const FunctionProtoType Proto1,
const FunctionProtoType Proto2 
)
static

Check the equivalence of exception specifications.

Definition at line 405 of file ASTStructuralEquivalence.cpp.

◆ IsStructurallyEquivalent() [1/22]

static bool IsStructurallyEquivalent ( StructuralEquivalenceContext Context,
QualType  T1,
QualType  T2 
)
static

◆ IsStructurallyEquivalent() [2/22]

static bool IsStructurallyEquivalent ( StructuralEquivalenceContext Context,
Decl D1,
Decl D2 
)
static

Determine structural equivalence of two declarations.

Definition at line 1573 of file ASTStructuralEquivalence.cpp.

◆ IsStructurallyEquivalent() [3/22]

static bool IsStructurallyEquivalent ( StructuralEquivalenceContext Context,
const TemplateArgument Arg1,
const TemplateArgument Arg2 
)
static

Determine whether two template arguments are equivalent.

Definition at line 307 of file ASTStructuralEquivalence.cpp.

◆ IsStructurallyEquivalent() [4/22]

static bool IsStructurallyEquivalent ( StructuralEquivalenceContext Context,
NestedNameSpecifier NNS1,
NestedNameSpecifier NNS2 
)
static

Determine whether two nested-name-specifiers are equivalent.

Definition at line 197 of file ASTStructuralEquivalence.cpp.

◆ IsStructurallyEquivalent() [5/22]

static bool IsStructurallyEquivalent ( const IdentifierInfo Name1,
const IdentifierInfo Name2 
)
static

Determine whether two identifiers are equivalent.

Definition at line 188 of file ASTStructuralEquivalence.cpp.

References clang::IdentifierInfo::getName().

◆ IsStructurallyEquivalent() [6/22]

static bool IsStructurallyEquivalent ( StructuralEquivalenceContext Context,
const DeclarationName  Name1,
const DeclarationName  Name2 
)
static

Definition at line 110 of file ASTStructuralEquivalence.cpp.

◆ IsStructurallyEquivalent() [7/22]

static bool IsStructurallyEquivalent ( StructuralEquivalenceContext Context,
const Expr E1,
const Expr E2 
)
static

Determine structural equivalence of two expressions.

Definition at line 159 of file ASTStructuralEquivalence.cpp.

◆ IsStructurallyEquivalent() [8/22]

static bool IsStructurallyEquivalent ( StructuralEquivalenceContext Context,
const TemplateName N1,
const TemplateName N2 
)
static

Definition at line 235 of file ASTStructuralEquivalence.cpp.

◆ IsStructurallyEquivalent() [9/22]

static bool IsStructurallyEquivalent ( StructuralEquivalenceContext Context,
FunctionType::ExtInfo  EI1,
FunctionType::ExtInfo  EI2 
)
static

Determine structural equivalence based on the ExtInfo of functions.

This is inspired by ASTContext::mergeFunctionTypes(), we compare calling conventions bits but must not compare some other bits.

Definition at line 381 of file ASTStructuralEquivalence.cpp.

◆ IsStructurallyEquivalent() [10/22]

static bool IsStructurallyEquivalent ( StructuralEquivalenceContext Context,
FieldDecl Field1,
FieldDecl Field2 
)
static

Determine structural equivalence of two fields.

Definition at line 944 of file ASTStructuralEquivalence.cpp.

◆ IsStructurallyEquivalent() [11/22]

static bool IsStructurallyEquivalent ( StructuralEquivalenceContext Context,
CXXMethodDecl Method1,
CXXMethodDecl Method2 
)
static

Determine structural equivalence of two methods.

Definition at line 1037 of file ASTStructuralEquivalence.cpp.

◆ IsStructurallyEquivalent() [12/22]

static bool IsStructurallyEquivalent ( StructuralEquivalenceContext Context,
RecordDecl D1,
RecordDecl D2 
)
static

Determine structural equivalence of two records.

Definition at line 1102 of file ASTStructuralEquivalence.cpp.

◆ IsStructurallyEquivalent() [13/22]

static bool IsStructurallyEquivalent ( StructuralEquivalenceContext Context,
EnumDecl D1,
EnumDecl D2 
)
static

Determine structural equivalence of two enums.

Definition at line 1335 of file ASTStructuralEquivalence.cpp.

◆ IsStructurallyEquivalent() [14/22]

static bool IsStructurallyEquivalent ( StructuralEquivalenceContext Context,
TemplateParameterList Params1,
TemplateParameterList Params2 
)
static

Definition at line 1396 of file ASTStructuralEquivalence.cpp.

◆ IsStructurallyEquivalent() [15/22]

static bool IsStructurallyEquivalent ( StructuralEquivalenceContext Context,
TemplateTypeParmDecl D1,
TemplateTypeParmDecl D2 
)
static

Definition at line 1431 of file ASTStructuralEquivalence.cpp.

◆ IsStructurallyEquivalent() [16/22]

static bool IsStructurallyEquivalent ( StructuralEquivalenceContext Context,
NonTypeTemplateParmDecl D1,
NonTypeTemplateParmDecl D2 
)
static

Definition at line 1449 of file ASTStructuralEquivalence.cpp.

◆ IsStructurallyEquivalent() [17/22]

static bool IsStructurallyEquivalent ( StructuralEquivalenceContext Context,
TemplateTemplateParmDecl D1,
TemplateTemplateParmDecl D2 
)
static

Definition at line 1480 of file ASTStructuralEquivalence.cpp.

◆ IsStructurallyEquivalent() [18/22]

static bool IsStructurallyEquivalent ( StructuralEquivalenceContext Context,
ClassTemplateDecl D1,
ClassTemplateDecl D2 
)
static

Definition at line 1511 of file ASTStructuralEquivalence.cpp.

◆ IsStructurallyEquivalent() [19/22]

static bool IsStructurallyEquivalent ( StructuralEquivalenceContext Context,
FunctionTemplateDecl D1,
FunctionTemplateDecl D2 
)
static

Definition at line 1523 of file ASTStructuralEquivalence.cpp.

◆ IsStructurallyEquivalent() [20/22]

static bool IsStructurallyEquivalent ( StructuralEquivalenceContext Context,
ConceptDecl D1,
ConceptDecl D2 
)
static

Definition at line 1535 of file ASTStructuralEquivalence.cpp.

◆ IsStructurallyEquivalent() [21/22]

static bool IsStructurallyEquivalent ( StructuralEquivalenceContext Context,
FriendDecl D1,
FriendDecl D2 
)
static

Definition at line 1547 of file ASTStructuralEquivalence.cpp.

◆ IsStructurallyEquivalent() [22/22]

static bool IsStructurallyEquivalent ( StructuralEquivalenceContext Context,
FunctionDecl D1,
FunctionDecl D2 
)
static

Definition at line 1563 of file ASTStructuralEquivalence.cpp.

◆ IsStructurallyEquivalentLambdas()

static bool IsStructurallyEquivalentLambdas ( StructuralEquivalenceContext Context,
CXXRecordDecl D1,
CXXRecordDecl D2 
)
static

Determine structural equivalence of two lambda classes.

Definition at line 1090 of file ASTStructuralEquivalence.cpp.

◆ IsTemplateDeclCommonStructurallyEquivalent()

static bool IsTemplateDeclCommonStructurallyEquivalent ( StructuralEquivalenceContext Ctx,
TemplateDecl D1,
TemplateDecl D2 
)
static