14 #ifndef LLVM_CLANG_AST_ASTSTRUCTURALEQUIVALENCE_H 15 #define LLVM_CLANG_AST_ASTSTRUCTURALEQUIVALENCE_H 18 #include "llvm/ADT/DenseMap.h" 19 #include "llvm/ADT/DenseSet.h" 20 #include "llvm/ADT/Optional.h" 28 class DiagnosticBuilder;
70 bool LastDiagFromC2 =
false;
76 bool StrictTypeSpelling =
false,
bool Complain =
true,
77 bool ErrorOnTagTypeMismatch =
false)
78 : FromCtx(FromCtx), ToCtx(ToCtx), NonEquivalentDecls(NonEquivalentDecls),
79 EqKind(EqKind), StrictTypeSpelling(StrictTypeSpelling),
80 ErrorOnTagTypeMismatch(ErrorOnTagTypeMismatch), Complain(Complain) {}
91 bool IsEquivalent(
Decl *D1,
Decl *D2);
111 findUntaggedStructOrUnionIndex(
RecordDecl *Anon);
115 unsigned getApplicableDiagnostic(
unsigned ErrorDiagnostic);
127 bool CheckCommonEquivalence(
Decl *D1,
Decl *D2);
132 bool CheckKindSpecificEquivalence(
Decl *D1,
Decl *D2);
137 #endif // LLVM_CLANG_AST_ASTSTRUCTURALEQUIVALENCE_H StructuralEquivalenceContext(ASTContext &FromCtx, ASTContext &ToCtx, llvm::DenseSet< std::pair< Decl *, Decl *>> &NonEquivalentDecls, StructuralEquivalenceKind EqKind, bool StrictTypeSpelling=false, bool Complain=true, bool ErrorOnTagTypeMismatch=false)
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 ...
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.
StructuralEquivalenceKind EqKind
A little helper class used to produce diagnostics.
std::queue< std::pair< Decl *, Decl * > > DeclsToCheck
Encodes a location in the source.
StructuralEquivalenceKind
Whether to perform a normal or minimal equivalence check.
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...
llvm::DenseSet< std::pair< Decl *, Decl * > > VisitedDecls
bool Complain
Whether to complain about failures.