================
@@ -1112,6 +1113,58 @@ void
APINotesSelectorDiagnosticReaderState::markCandidatesUsed(
}
}
+static api_notes::FunctionObjectSelector
+getAPINotesObjectSelector(const CXXMethodDecl *Method) {
+ api_notes::FunctionObjectSelector Selector;
+ Selector.Const = Method->isConst();
+ Selector.Volatile = Method->isVolatile();
+ switch (Method->getRefQualifier()) {
+ case RQ_None:
+ Selector.Ref = api_notes::FunctionObjectRefQualifier::None;
+ break;
+ case RQ_LValue:
+ Selector.Ref = api_notes::FunctionObjectRefQualifier::LValue;
+ break;
+ case RQ_RValue:
+ Selector.Ref = api_notes::FunctionObjectRefQualifier::RValue;
+ break;
+ }
+ return Selector;
+}
+
+static void getAPINotesObjectSelectorSubsets(
+ api_notes::FunctionObjectSelector ObjectSelector,
+ SmallVectorImpl<api_notes::FunctionObjectSelector> &Subsets) {
+ enum ObjectSelectorField : unsigned {
+ ConstField = 1u << 0,
+ VolatileField = 1u << 1,
+ RefField = 1u << 2,
----------------
StoeckOverflow wrote:
Yes, both are still represented. A method can only have one ref qualifier at a
time, so the actual value is stored as `RefQualifierKind`. The subset mask
only controls whether the ref-qualifier field participates in the
broader/narrower object-selector lookup. When `RefQualifierField` is present we
copy the full value unchanged, preserving either `RQ_LValue` or `RQ_RValue`. I
also renamed the mask bit from `RefField` to `RefQualifierField` to make that
clearer.
https://github.com/llvm/llvm-project/pull/216148
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits