clang
8.0.0
|
#include "clang/AST/ASTStructuralEquivalence.h"
Public Member Functions | |
StructuralEquivalenceContext (ASTContext &FromCtx, ASTContext &ToCtx, llvm::DenseSet< std::pair< Decl *, Decl *>> &NonEquivalentDecls, StructuralEquivalenceKind EqKind, bool StrictTypeSpelling=false, bool Complain=true, bool ErrorOnTagTypeMismatch=false) | |
DiagnosticBuilder | Diag1 (SourceLocation Loc, unsigned DiagID) |
DiagnosticBuilder | Diag2 (SourceLocation Loc, unsigned DiagID) |
bool | IsEquivalent (Decl *D1, Decl *D2) |
Determine whether the two declarations are structurally equivalent. More... | |
bool | IsEquivalent (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... | |
StructuralEquivalenceKind | EqKind |
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 = false |
true if the last diagnostic came from ToCtx. More... | |
Definition at line 42 of file ASTStructuralEquivalence.h.
|
inline |
Definition at line 74 of file ASTStructuralEquivalence.h.
DiagnosticBuilder StructuralEquivalenceContext::Diag1 | ( | SourceLocation | Loc, |
unsigned | DiagID | ||
) |
Definition at line 1427 of file ASTStructuralEquivalence.cpp.
References Complain, FromCtx, clang::ASTContext::getDiagnostics(), LastDiagFromC2, clang::DiagnosticsEngine::notePriorDiagnosticFrom(), clang::DiagnosticsEngine::Report(), and ToCtx.
DiagnosticBuilder StructuralEquivalenceContext::Diag2 | ( | SourceLocation | Loc, |
unsigned | DiagID | ||
) |
Definition at line 1436 of file ASTStructuralEquivalence.cpp.
References Complain, FromCtx, clang::ASTContext::getDiagnostics(), LastDiagFromC2, clang::DiagnosticsEngine::notePriorDiagnosticFrom(), clang::DiagnosticsEngine::Report(), and ToCtx.
|
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 1446 of file ASTStructuralEquivalence.cpp.
Determine whether the two declarations are structurally equivalent.
Implementation functions (all static functions in ASTStructuralEquivalence.cpp) must never call this function because that will wreak havoc the internal state (DeclsToCheck
and TentativeEquivalences
members) and can cause faulty equivalent results.
Definition at line 1488 of file ASTStructuralEquivalence.cpp.
References DeclsToCheck, IsStructurallyEquivalent(), and TentativeEquivalences.
Referenced by clang::Sema::hasStructuralCompatLayout(), clang::ASTImporter::IsStructurallyEquivalent(), and clang::ASTNodeImporter::IsStructuralMatch().
Determine whether the two types are structurally equivalent.
Implementation functions (all static functions in ASTStructuralEquivalence.cpp) must never call this function because that will wreak havoc the internal state (DeclsToCheck
and TentativeEquivalences
members) and can cause faulty equivalent results.
Definition at line 1505 of file ASTStructuralEquivalence.cpp.
References DeclsToCheck, clang::Equivalent, clang::Decl::getCanonicalDecl(), clang::Decl::getDescribedTemplate(), IsStructurallyEquivalent(), NonEquivalentDecls, and TentativeEquivalences.
bool clang::StructuralEquivalenceContext::Complain |
Whether to complain about failures.
Definition at line 69 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 53 of file ASTStructuralEquivalence.h.
Referenced by IsEquivalent().
StructuralEquivalenceKind clang::StructuralEquivalenceContext::EqKind |
Definition at line 59 of file ASTStructuralEquivalence.h.
bool clang::StructuralEquivalenceContext::ErrorOnTagTypeMismatch |
Whether warn or error on tag type mismatches.
Definition at line 66 of file ASTStructuralEquivalence.h.
ASTContext& clang::StructuralEquivalenceContext::FromCtx |
AST contexts for which we are checking structural equivalence.
Definition at line 44 of file ASTStructuralEquivalence.h.
true
if the last diagnostic came from ToCtx.
Definition at line 72 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 57 of file ASTStructuralEquivalence.h.
Referenced by IsEquivalent().
bool clang::StructuralEquivalenceContext::StrictTypeSpelling |
Whether we're being strict about the spelling of types when unifying two types.
Definition at line 63 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 49 of file ASTStructuralEquivalence.h.
Referenced by IsEquivalent().
ASTContext & clang::StructuralEquivalenceContext::ToCtx |
Definition at line 44 of file ASTStructuralEquivalence.h.