clang
6.0.0
|
#include "clang/AST/ASTStructuralEquivalence.h"
Public Member Functions | |
StructuralEquivalenceContext (ASTContext &FromCtx, ASTContext &ToCtx, llvm::DenseSet< std::pair< Decl *, Decl *>> &NonEquivalentDecls, bool StrictTypeSpelling=false, bool Complain=true, bool ErrorOnTagTypeMismatch=false) | |
DiagnosticBuilder | Diag1 (SourceLocation Loc, unsigned DiagID) |
DiagnosticBuilder | Diag2 (SourceLocation Loc, unsigned DiagID) |
bool | IsStructurallyEquivalent (Decl *D1, Decl *D2) |
Determine whether the two declarations are structurally equivalent. More... | |
bool | IsStructurallyEquivalent (QualType T1, QualType T2) |
Determine whether the two types are structurally equivalent. More... | |
Static Public Member Functions | |
static llvm::Optional< unsigned > | findUntaggedStructOrUnionIndex (RecordDecl *Anon) |
Find the index of the given anonymous struct/union within its context. More... | |
Public Attributes | |
ASTContext & | FromCtx |
AST contexts for which we are checking structural equivalence. More... | |
ASTContext & | ToCtx |
llvm::DenseMap< Decl *, Decl * > | TentativeEquivalences |
The set of "tentative" equivalences between two canonical declarations, mapping from a declaration in the first context to the declaration in the second context that we believe to be equivalent. More... | |
std::deque< Decl * > | DeclsToCheck |
Queue of declarations in the first context whose equivalence with a declaration in the second context still needs to be verified. More... | |
llvm::DenseSet< std::pair< Decl *, Decl * > > & | NonEquivalentDecls |
Declaration (from, to) pairs that are known not to be equivalent (which we have already complained about). More... | |
bool | StrictTypeSpelling |
Whether we're being strict about the spelling of types when unifying two types. More... | |
bool | ErrorOnTagTypeMismatch |
Whether warn or error on tag type mismatches. More... | |
bool | Complain |
Whether to complain about failures. More... | |
bool | LastDiagFromC2 |
true if the last diagnostic came from ToCtx. More... | |
Definition at line 32 of file ASTStructuralEquivalence.h.
|
inline |
Definition at line 62 of file ASTStructuralEquivalence.h.
References Diag1(), Diag2(), findUntaggedStructOrUnionIndex(), and IsStructurallyEquivalent().
DiagnosticBuilder clang::StructuralEquivalenceContext::Diag1 | ( | SourceLocation | Loc, |
unsigned | DiagID | ||
) |
Definition at line 1194 of file ASTStructuralEquivalence.cpp.
Referenced by StructuralEquivalenceContext().
DiagnosticBuilder clang::StructuralEquivalenceContext::Diag2 | ( | SourceLocation | Loc, |
unsigned | DiagID | ||
) |
Definition at line 1203 of file ASTStructuralEquivalence.cpp.
Referenced by StructuralEquivalenceContext().
|
static |
Find the index of the given anonymous struct/union within its context.
FIXME: This is needed by ASTImporter and ASTStructureEquivalence. It probably makes more sense in some other common place then here.
Definition at line 1213 of file ASTStructuralEquivalence.cpp.
References clang::Decl::getASTContext(), clang::Decl::getDeclContext(), clang::NamedDecl::getIdentifier(), clang::ASTContext::getRecordType(), clang::ASTContext::hasSameType(), clang::DeclContext::noload_decls(), and clang::diff::None.
Referenced by StructuralEquivalenceContext().
Determine whether the two declarations are structurally equivalent.
Definition at line 1251 of file ASTStructuralEquivalence.cpp.
Referenced by clang::Sema::hasStructuralCompatLayout(), clang::ASTImporter::IsStructurallyEquivalent(), clang::ASTNodeImporter::IsStructuralMatch(), and StructuralEquivalenceContext().
Determine whether the two types are structurally equivalent.
Definition at line 1259 of file ASTStructuralEquivalence.cpp.
References clang::Decl::getCanonicalDecl().
bool clang::StructuralEquivalenceContext::Complain |
Whether to complain about failures.
Definition at line 57 of file ASTStructuralEquivalence.h.
std::deque<Decl *> clang::StructuralEquivalenceContext::DeclsToCheck |
Queue of declarations in the first context whose equivalence with a declaration in the second context still needs to be verified.
Definition at line 43 of file ASTStructuralEquivalence.h.
bool clang::StructuralEquivalenceContext::ErrorOnTagTypeMismatch |
Whether warn or error on tag type mismatches.
Definition at line 54 of file ASTStructuralEquivalence.h.
ASTContext& clang::StructuralEquivalenceContext::FromCtx |
AST contexts for which we are checking structural equivalence.
Definition at line 34 of file ASTStructuralEquivalence.h.
bool clang::StructuralEquivalenceContext::LastDiagFromC2 |
true
if the last diagnostic came from ToCtx.
Definition at line 60 of file ASTStructuralEquivalence.h.
llvm::DenseSet<std::pair<Decl *, Decl *> >& clang::StructuralEquivalenceContext::NonEquivalentDecls |
Declaration (from, to) pairs that are known not to be equivalent (which we have already complained about).
Definition at line 47 of file ASTStructuralEquivalence.h.
bool clang::StructuralEquivalenceContext::StrictTypeSpelling |
Whether we're being strict about the spelling of types when unifying two types.
Definition at line 51 of file ASTStructuralEquivalence.h.
The set of "tentative" equivalences between two canonical declarations, mapping from a declaration in the first context to the declaration in the second context that we believe to be equivalent.
Definition at line 39 of file ASTStructuralEquivalence.h.
ASTContext & clang::StructuralEquivalenceContext::ToCtx |
Definition at line 34 of file ASTStructuralEquivalence.h.