================
@@ -1397,28 +1440,73 @@ void Sema::ProcessAPINotes(Decl *D) {
auto Info = Reader->lookupCXXMethod(Context->id, MethodName);
ProcessVersionedAPINotes(*this, CXXMethod, Info);
- if (ParameterSelectorCandidates)
+ auto &DiagnosticState =
+ getAPINotesSelectorDiagnosticState(*this, Reader);
+ if (auto NameOnlyKey =
+ Reader->getCXXMethodSelectorKey(Context->id, MethodName))
+ DiagnosticState.noteSeenDeclaration(*NameOnlyKey, MethodName,
+ CXXMethod->getLocation());
+
+ if (ParameterSelectorCandidates) {
processExactAPINotes<api_notes::CXXMethodInfo>(
*this, CXXMethod, *ParameterSelectorCandidates,
[&](ArrayRef<std::string> Parameters) {
return Reader->lookupCXXMethod(Context->id, MethodName,
Parameters);
});
-
- if (ParameterSelectorCandidates) {
- auto &DiagnosticState =
- getAPINotesSelectorDiagnosticState(*this, Reader);
- if (auto BroadKey =
- Reader->getCXXMethodSelectorKey(Context->id, MethodName))
- DiagnosticState.noteSeenDeclaration(*BroadKey, MethodName,
- CXXMethod->getLocation());
DiagnosticState.markCandidatesUsed(
[&](ArrayRef<std::string> Parameters) {
return Reader->getCXXMethodSelectorKey(
Context->id, MethodName, Parameters);
},
*ParameterSelectorCandidates);
}
+
+ if (CXXMethod->isImplicitObjectMemberFunction()) {
+ SmallVector<api_notes::FunctionObjectSelector, 7>
ObjectSelectors;
+ getAPINotesObjectSelectorSubsets(
+ getAPINotesObjectSelector(CXXMethod), ObjectSelectors);
+ // Apply every matching object selector in increasing
specificity.
----------------
Xazax-hun wrote:
Could you elaborate on why we need this with an example? I am wondering if
APINotes should produce the same result regardless of the order of matching but
it is possible that I am missing something.
https://github.com/llvm/llvm-project/pull/216148
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits