Commit Graph

8 Commits

Author SHA1 Message Date
Yang Fan a8219991d0
[clang][APINotes] Fix -Wunused-function warning (NFC)
GCC warning:
```
/llvm-project/clang/lib/APINotes/APINotesYAMLCompiler.cpp:574:23: warning: ‘void {anonymous}::Module::dump()’ defined but not used [-Wunused-function]
  574 | LLVM_DUMP_METHOD void Module::dump() {
      |                       ^~~~~~
```
2021-04-01 09:52:43 +08:00
Yang Fan 3f7f7f1615
[clang][APINotes] Fix gcc Wunused-function warning (NFC)
GCC warning:
```
/llvm-project/clang/lib/APINotes/APINotesYAMLCompiler.cpp:574:6: warning: ‘void {anonymous}::Module::dump()’ defined but not used [-Wunused-function]
  574 | void Module::dump() {
      |      ^~~~~~
```
2021-03-10 11:47:00 +08:00
Saleem Abdulrasool 16fdc5da89 APINotes: annotate dump methods (NFC)
This annotates the dump methods in APINotes to indicate that they are
unused as they are meant for debugging purposes.  This avoids an
unnecessary warning.
2021-01-08 20:49:28 +00:00
Saleem Abdulrasool b13f741511 APINotes: add bitcode format schema definitions
This adds the bitcode format schema required for serialization of the
YAML data to a binary format.  APINotes are pre-compiled and re-used in
the binary format from the frontend.  These definitions provide the data
layout representation enabling writing (and eventually) reading of the
data in bitcode format.

This is extracted from the code contributed by Apple at
https://github.com/llvm/llvm-project-staging/tree/staging/swift/apinotes.

Differential Revision: https://reviews.llvm.org/D91997
Reviewed By: Gabor Marton
2020-12-08 21:15:41 +00:00
Erik Pilkington 9cd2413f1c [clang] Add a new nullability annotation for swift async: _Nullable_result
_Nullable_result generally like _Nullable, except when being imported into a
swift async method. rdar://70106409

Differential revision: https://reviews.llvm.org/D92495
2020-12-07 17:19:20 -05:00
Saleem Abdulrasool 4eaa024863 APINotes: constify `dump` methods (NFC)
This simply marks the functions as const as they do not mutate the
value.  This is useful for debugging iterations during development.
NFCI.
2020-12-01 19:01:06 +00:00
Saleem Abdulrasool f6b02ecd02 APINotes: add property models for YAML attributes
This adds internal representation of the attributes in a more usable
form.  This is meant to allow programmatic access to the attributes that
are specified in the YAML data.

This is based upon the work contributed by Apple at
https://github.com/llvm/llvm-project-staging/tree/staging/swift/apinotes.

Differential Revision: https://reviews.llvm.org/D91104
Reviewed By: Gabor Marton
2020-11-23 21:29:17 +00:00
Saleem Abdulrasool 82f86ae01a APINotes: add APINotesYAMLCompiler
This adds the skeleton of the YAML Compiler for APINotes.  This change
only adds the YAML IO model for the API Notes along with a new testing
tool `apinotes-test` which can be used to verify that can round trip the
YAML content properly.  It provides the basis for the future work which
will add a binary serialization and deserialization format to the data
model.

This is based on the code contributed by Apple at
https://github.com/llvm/llvm-project-staging/tree/staging/swift/apinotes.

Differential Revision: https://reviews.llvm.org/D88859
Reviewed By: Gabor Marton
2020-11-05 18:55:13 +00:00