FailedChanges

Summary

  1. [NFC] Rename ClangASTEmitters.h -> ASTTableGen.h (details)
  2. [NFC] Correct accidental use of tabs. (details)
  3. Introduce some types and functions to make it easier to work with the (details)
  4. Add a function to get the ExceptionSpecInfo of a function type; NFC. (details)
  5. Extract out WrappedRecord as a convenience base class; NFC. (details)
  6. Enable better node-hierarchy metaprogramming; NFC. (details)
  7. Extract the TypeClass <-> TypeCode map into a .def file; NFC. (details)
  8. Standardize the reader methods in ASTReader; NFC. (details)
  9. Abstract serialization: TableGen "basic" reader/writer CRTP classes that (details)
  10. Abstract serialization: TableGen the (de)serialization code for Types. (details)
Commit b6f03a5a6b57b7858098051e60c2ce2fd4058461 by rjmccall
[NFC] Rename ClangASTEmitters.h -> ASTTableGen.h
The file was modifiedclang/utils/TableGen/ClangTypeNodesEmitter.cpp
The file was modifiedclang/utils/TableGen/TableGen.cpp
The file was addedclang/utils/TableGen/ASTTableGen.h
The file was modifiedclang/utils/TableGen/ClangAttrEmitter.cpp
The file was removedclang/utils/TableGen/ClangASTEmitters.h
The file was modifiedclang/utils/TableGen/ClangASTNodesEmitter.cpp
Commit a7950ffd12caa2fb7ed4704128011bceeacd35e9 by rjmccall
[NFC] Correct accidental use of tabs.
The file was modifiedclang/utils/TableGen/ClangTypeNodesEmitter.cpp
Commit 91dd67ef724c07f28d4cb52448539f12ad488f2a by rjmccall
Introduce some types and functions to make it easier to work with the
tblgen AST node hierarchies.
Not totally NFC because both of the emitters now emit in a different
order.  The type-nodes emitter now visits nodes in hierarchy order,
which means we could use range checks in classof if we had any types
that would benefit from that; currently we do not.  The AST-nodes
emitter now uses a multimap keyed by the name of the record; previously
it was using `Record*`, which of couse isn't stable across processes and
may have led to non-reproducible builds in some circumstances.
The file was modifiedclang/utils/TableGen/CMakeLists.txt
The file was modifiedclang/utils/TableGen/ASTTableGen.h
The file was modifiedclang/utils/TableGen/ClangTypeNodesEmitter.cpp
The file was addedclang/utils/TableGen/ASTTableGen.cpp
The file was modifiedclang/utils/TableGen/ClangASTNodesEmitter.cpp
Commit f39e1efaf5b0d4abb08bd042a3bae9a772836b5f by rjmccall
Add a function to get the ExceptionSpecInfo of a function type; NFC.
The file was modifiedclang/include/clang/AST/Type.h
Commit 30066e522c94a193dbcae9bc4d4005f8a137bd4b by rjmccall
Extract out WrappedRecord as a convenience base class; NFC.
The file was modifiedclang/utils/TableGen/ASTTableGen.h
Commit f6da0cf34a5a48bf8154067206980fff9b7a1975 by rjmccall
Enable better node-hierarchy metaprogramming; NFC.
The file was modifiedclang/utils/TableGen/ClangTypeNodesEmitter.cpp
The file was modifiedclang/utils/TableGen/ASTTableGen.h
The file was modifiedclang/utils/TableGen/ASTTableGen.cpp
Commit 139006ceb641f038a2b19cac1174316e57004ed6 by rjmccall
Extract the TypeClass <-> TypeCode map into a .def file; NFC.
The file was modifiedclang/include/clang/Serialization/ASTBitCodes.h
The file was addedclang/include/clang/Serialization/TypeBitCodes.def
Commit 3ce3d23facf146698c4ef6107d1b9425b3ff5764 by rjmccall
Standardize the reader methods in ASTReader; NFC.
There are three significant changes here:
- Most of the methods to read various embedded structures (`APInt`,
`NestedNameSpecifier`, `DeclarationName`, etc.) have been moved
from `ASTReader` to `ASTRecordReader`.  This cleans up quite a
bit of code which was passing around `(F, Record, Idx)` arguments
everywhere or doing explicit indexing, and it nicely parallels
how it works on the writer side.  It also sets us up to then move
most of these methods into the `BasicReader`s that I'm introducing
as part of abstract serialization.
  As part of this, several of the top-level reader methods (e.g.
`readTypeRecord`) have been converted to use `ASTRecordReader`
internally, which is a nice readability improvement.
- I've standardized most of these method names on `readFoo` rather
than `ReadFoo` (used in some of the helper structures) or `GetFoo`
(used for some specific types for no apparent reason).
- I've changed a few of these methods to return their result instead
of reading into an argument passed by reference.  This is partly
for general consistency and partly because it will make the
metaprogramming easier with abstract serialization.
The file was modifiedclang/utils/TableGen/ClangAttrEmitter.cpp
The file was modifiedclang/include/clang/Serialization/ASTReader.h
The file was modifiedclang/lib/Serialization/ASTReaderStmt.cpp
The file was modifiedclang/lib/Serialization/ASTReaderDecl.cpp
The file was modifiedclang/lib/Serialization/ASTReader.cpp
Commit 6404bd236240639d4986d1ee634ded4bc81d8bd8 by rjmccall
Abstract serialization: TableGen "basic" reader/writer CRTP classes that
serialize basic values
The file was modifiedclang/utils/TableGen/ASTTableGen.h
The file was modifiedclang/utils/TableGen/TableGen.cpp
The file was modifiedclang/utils/TableGen/CMakeLists.txt
The file was modifiedclang/include/clang/Basic/TypeNodes.td
The file was modifiedclang/utils/TableGen/TableGenBackends.h
The file was modifiedclang/utils/TableGen/ASTTableGen.cpp
The file was modifiedclang/include/clang/AST/CMakeLists.txt
The file was modifiedclang/include/clang/Basic/DeclNodes.td
The file was modifiedclang/include/clang/Basic/StmtNodes.td
The file was addedclang/include/clang/AST/PropertiesBase.td
The file was addedclang/utils/TableGen/ClangASTPropertiesEmitter.cpp
Commit d505e57cc273750541ec8bbce2065b8b87c99ad6 by rjmccall
Abstract serialization: TableGen the (de)serialization code for Types.
The basic technical design here is that we have three levels of readers
and writers:
- At the lowest level, there's a `Basic{Reader,Writer}` that knows
how to emit the basic structures of the AST.  CRTP allows this to
be metaprogrammed so that the client only needs to support a handful
of primitive types (e.g. `uint64_t` and `IdentifierInfo*`) and more
complicated "inline" structures such as `DeclarationName` can just
be emitted in terms of those primitives.
  In Clang's binary-serialization code, these are
`ASTRecord{Reader,Writer}`.  For now, a large number of basic
structures are still emitted explicitly by code on those classes
rather than by either TableGen or CRTP metaprogramming, but I
expect to move more of these over.
- In the middle, there's a `Property{Reader,Writer}` which is
responsible for processing the properties of a larger object.  The
object-level reader/writer asks the property-level reader/writer to
project out a particular property, yielding a basic reader/writer
which will be used to read/write the property's value, like so:
  ```
   propertyWriter.find("count").writeUInt32(node->getCount());
```
  Clang's binary-serialization code ignores this level (it uses
the basic reader/writer as the property reader/writer and has the
projection methods just return `*this`) and simply relies on the
roperties being read/written in a stable order.
- At the highest level, there's an object reader/writer (e.g.
`Type{Reader,Writer}` which emits a logical object with properties.
Think of this as writing something like a JSON dictionary literal.
I haven't introduced support for bitcode abbreviations yet --- it turns
out that there aren't any operative abbreviations for types besides the
QualType one --- but I do have some ideas of how they should work.  At
any rate, they'll be necessary in order to handle statements.
I'm sorry for not disentangling the patches that added basic and type
reader/writers; I made some effort to, but I ran out of energy after
disentangling a number of other patches from the work.
Negligible impact on module size, time to build a set of about 20 fairly
large modules, or time to read a few declarations out of them.
The file was addedclang/include/clang/AST/TypeProperties.td
The file was modifiedclang/include/clang/AST/ASTContext.h
The file was modifiedclang/include/clang/AST/CMakeLists.txt
The file was modifiedclang/lib/Serialization/ASTReader.cpp
The file was modifiedclang/utils/TableGen/TableGen.cpp
The file was addedclang/include/clang/AST/AbstractBasicReader.h
The file was addedclang/include/clang/AST/AbstractTypeWriter.h
The file was modifiedclang/include/clang/AST/Type.h
The file was modifiedclang/include/clang/Serialization/ASTReader.h
The file was addedclang/include/clang/AST/AbstractTypeReader.h
The file was modifiedclang/include/clang/Serialization/ASTWriter.h
The file was addedclang/include/clang/AST/AbstractBasicWriter.h
The file was modifiedclang/lib/Serialization/ASTWriter.cpp