15 #ifndef LLVM_CLANG_AST_ASTSTRUCTURALEQUIVALENCE_H 16 #define LLVM_CLANG_AST_ASTSTRUCTURALEQUIVALENCE_H 18 #include "llvm/ADT/DenseMap.h" 19 #include "llvm/ADT/DenseSet.h" 20 #include "llvm/ADT/Optional.h" 27 class DiagnosticBuilder;
65 bool StrictTypeSpelling =
false,
bool Complain =
true,
66 bool ErrorOnTagTypeMismatch =
false)
67 : FromCtx(FromCtx), ToCtx(ToCtx), NonEquivalentDecls(NonEquivalentDecls),
68 StrictTypeSpelling(StrictTypeSpelling),
69 ErrorOnTagTypeMismatch(ErrorOnTagTypeMismatch), Complain(Complain),
70 LastDiagFromC2(
false) {}
103 #endif // LLVM_CLANG_AST_ASTSTRUCTURALEQUIVALENCE_H A (possibly-)qualified type.
Decl - This represents one declaration (or definition), e.g.
The l-value was an access to a declared entity or something equivalently strong, like the address of ...
StructuralEquivalenceContext(ASTContext &FromCtx, ASTContext &ToCtx, llvm::DenseSet< std::pair< Decl *, Decl *>> &NonEquivalentDecls, bool StrictTypeSpelling=false, bool Complain=true, bool ErrorOnTagTypeMismatch=false)
ASTContext & FromCtx
AST contexts for which we are checking structural equivalence.
RecordDecl - Represents a struct/union/class.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
bool ErrorOnTagTypeMismatch
Whether warn or error on tag type mismatches.
bool StrictTypeSpelling
Whether we're being strict about the spelling of types when unifying two types.
bool IsStructurallyEquivalent(Decl *D1, Decl *D2)
Determine whether the two declarations are structurally equivalent.
A little helper class used to produce diagnostics.
DiagnosticBuilder Diag1(SourceLocation Loc, unsigned DiagID)
bool LastDiagFromC2
true if the last diagnostic came from ToCtx.
DiagnosticBuilder Diag2(SourceLocation Loc, unsigned DiagID)
Encodes a location in the source.
Dataflow Directional Tag Classes.
llvm::DenseSet< std::pair< Decl *, Decl * > > & NonEquivalentDecls
Declaration (from, to) pairs that are known not to be equivalent (which we have already complained ab...
static llvm::Optional< unsigned > findUntaggedStructOrUnionIndex(RecordDecl *Anon)
Find the index of the given anonymous struct/union within its context.
llvm::DenseMap< Decl *, Decl * > TentativeEquivalences
The set of "tentative" equivalences between two canonical declarations, mapping from a declaration in...
std::deque< Decl * > DeclsToCheck
Queue of declarations in the first context whose equivalence with a declaration in the second context...
bool Complain
Whether to complain about failures.