[clang] [clang][ExtractAPI] Record availability information only for the target platform (PR #76823)

Daniel Grumberg via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 5 07:27:12 PST 2024


================
@@ -45,7 +45,7 @@ RecordTy *addTopLevelRecord(DenseMap<StringRef, APIRecord *> &USRLookupTable,
 
 NamespaceRecord *
 APISet::addNamespace(APIRecord *Parent, StringRef Name, StringRef USR,
-                     PresumedLoc Loc, AvailabilitySet Availability,
+                     PresumedLoc Loc, const AvailabilityInfo &Availability,
----------------
daniel-grumberg wrote:

Can we keep these as plain values (i.e. just `AvailabilityInfo Availability`), this prevents the move operation below and leads to a copy. Additionally, this prevents copy ellision with how we pass the parameters in.

https://github.com/llvm/llvm-project/pull/76823


More information about the cfe-commits mailing list