9#ifndef LLVM_CLANG_AST_ODRDIAGSEMITTER_H
10#define LLVM_CLANG_AST_ODRDIAGSEMITTER_H
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 {
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.
Defines the Diagnostic-related interfaces.
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate....
Defines the clang::LangOptions interface.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Represents a C++ struct/union/class.
Decl - This represents one declaration (or definition), e.g.
Concrete class used by the front-end to report problems and issues.
DiagnosticBuilder Report(SourceLocation Loc, unsigned DiagID)
Issue the message to the client.
Represents a function declaration or definition.
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
bool diagnoseMismatch(const FunctionDecl *FirstFunction, const FunctionDecl *SecondFunction) const
Diagnose ODR mismatch between 2 FunctionDecl.
bool diagnoseMismatch(const ObjCInterfaceDecl *FirstID, const ObjCInterfaceDecl *SecondID) const
Diagnose ODR mismatch between ObjCInterfaceDecl with different definitions.
ODRDiagsEmitter(DiagnosticsEngine &Diags, const ASTContext &Context, const LangOptions &LangOpts)
bool diagnoseMismatch(const ObjCProtocolDecl *FirstProtocol, const ObjCProtocolDecl *SecondProtocol) const
Diagnose ODR mismatch between ObjCProtocolDecl with different definitions.
static std::string getOwningModuleNameForDiagnostic(const Decl *D)
Get the best name we know for the module that owns the given declaration, or an empty string if the d...
Represents an ObjC class declaration.
Represents an Objective-C protocol declaration.
Represents a struct/union/class.
The JSON file list parser is used to communicate input to InstallAPI.