24 : Diags(Diags), Context(Context), LangOpts(LangOpts) {}
46 const struct CXXRecordDecl::DefinitionData *SecondDD)
const;
59 const struct ObjCInterfaceDecl::DefinitionData *SecondDD)
const;
65 assert(FirstID->data().Definition != SecondID->data().Definition &&
66 "Don't diagnose differences when definitions are merged already");
78 const struct ObjCProtocolDecl::DefinitionData *SecondDD)
const;
83 assert(FirstProtocol->data().Definition !=
84 SecondProtocol->data().Definition &&
85 "Don't diagnose differences when definitions are merged already");
87 &SecondProtocol->data());
102 enum ODRMismatchDecl {
122 const Decl *FirstDecl =
nullptr, *SecondDecl =
nullptr;
123 ODRMismatchDecl FirstDiffType =
Other, SecondDiffType =
Other;
129 static DiffResult FindTypeDiffs(DeclHashes &FirstHashes,
130 DeclHashes &SecondHashes);
132 DiagnosticBuilder Diag(SourceLocation Loc,
unsigned DiagID)
const {
133 return Diags.Report(Loc, DiagID);
139 void diagnoseSubMismatchUnexpected(DiffResult &DR,
140 const NamedDecl *FirstRecord,
141 StringRef FirstModule,
142 const NamedDecl *SecondRecord,
143 StringRef SecondModule)
const;
145 void diagnoseSubMismatchDifferentDeclKinds(DiffResult &DR,
146 const NamedDecl *FirstRecord,
147 StringRef FirstModule,
148 const NamedDecl *SecondRecord,
149 StringRef SecondModule)
const;
151 bool diagnoseSubMismatchField(
const NamedDecl *FirstRecord,
152 StringRef FirstModule, StringRef SecondModule,
153 const FieldDecl *FirstField,
154 const FieldDecl *SecondField)
const;
156 bool diagnoseSubMismatchTypedef(
const NamedDecl *FirstRecord,
157 StringRef FirstModule, StringRef SecondModule,
158 const TypedefNameDecl *FirstTD,
159 const TypedefNameDecl *SecondTD,
160 bool IsTypeAlias)
const;
162 bool diagnoseSubMismatchVar(
const NamedDecl *FirstRecord,
163 StringRef FirstModule, StringRef SecondModule,
164 const VarDecl *FirstVD,
165 const VarDecl *SecondVD)
const;
170 bool diagnoseSubMismatchProtocols(
const ObjCProtocolList &FirstProtocols,
171 const ObjCContainerDecl *FirstContainer,
172 StringRef FirstModule,
173 const ObjCProtocolList &SecondProtocols,
174 const ObjCContainerDecl *SecondContainer,
175 StringRef SecondModule)
const;
180 bool diagnoseSubMismatchObjCMethod(
const NamedDecl *FirstObjCContainer,
181 StringRef FirstModule,
182 StringRef SecondModule,
183 const ObjCMethodDecl *FirstMethod,
184 const ObjCMethodDecl *SecondMethod)
const;
190 diagnoseSubMismatchObjCProperty(
const NamedDecl *FirstObjCContainer,
191 StringRef FirstModule, StringRef SecondModule,
192 const ObjCPropertyDecl *FirstProp,
193 const ObjCPropertyDecl *SecondProp)
const;
196 DiagnosticsEngine &Diags;
197 const ASTContext &Context;
198 const LangOptions &LangOpts;
Defines the clang::ASTContext interface.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...