[PATCH] D88446: docs: add documentation describing API Notes
Saleem Abdulrasool via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Oct 2 15:46:03 PDT 2020
compnerd marked 2 inline comments as done.
compnerd added inline comments.
================
Comment at: clang/docs/APINotes.rst:233-235
+ Note that the type is *not* parsed in the context where it will be used,
+ which means that macros are not available and nullability must be applied
+ explicitly (even in an ``NS_ASSUME_NONNULL_BEGIN`` section).
----------------
rsmith wrote:
> compnerd wrote:
> > rsmith wrote:
> > > So what context is it parsed in? Below you have an `NSArray *` example; how do we do the lookup for `NSArray`?
> > A separate buffer is constructed where the annotations are processed. During semantic analysis, the requested APINotes are processed and the attributes specified are applied to the declaration.
> I've not been able to work out what the rule is, based on this documentation. The name `NSArray` isn't predeclared, so how is it found? How can a user ensure their types are visible to this parsing process? Are these things parsed as if they appear at the global scope in a translation unit in which the corresponding framework has been imported? (And if so, why wouldn't macros be available there too?) Whatever the rule is, I'd like to see it documented.
Discussed offline, this has been updated.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D88446/new/
https://reviews.llvm.org/D88446
More information about the cfe-commits
mailing list