Commit Graph

264 Commits

Author SHA1 Message Date
Paul Berry ceecfe862b Reserve element 0 in the references table for dynamic.
In addition to simplifying some serialization/deserialization code, this
paves the way for merging the references table with the prefixes table
by allowing the zeroth entry in both tables to act as a sentinel value.

R=scheglov@google.com

Review URL: https://codereview.chromium.org/1528083002 .
2015-12-15 11:25:11 -08:00
Paul Berry 518ae623d6 Move summary references into UnlinkedUnit and PrelinkedUnit.
This is a follow up to commit
f85684604b, which reorganized the
declarations by compilation unit to pave the way for allowing
summaries to be "re-linked" if the relationship between part files
changes.  Organizing references by compilation unit is another
necessary step to make that possible.

R=scheglov@google.com

Review URL: https://codereview.chromium.org/1523093003 .
2015-12-15 10:55:45 -08:00
Konstantin Shcheglov db1bf5fecf Couple comment tweaks for summaries IDL.
R=paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/1521963003 .
2015-12-15 09:52:45 -08:00
Paul Berry f85684604b Organize summary declarations by unit rather than by library.
In the initial implementation of summaries, all declarations for a
given library were thrown together into a single bucket, regardless of
the compilation unit in which they appeared.  This was done on the
grounds that semantically, the compilation unit in which a declaration
appears is irrelevant.

However, it turns out that this conflicts with one of the design goals
of summaries, which is to allow summaries to be quickly "re-linked"
when URI resolution changes.  Since "part" declarations use URIs to
refer to part files, this means that URI resolution may affect the
relationship among compilation units within a library; thus, the
declarations for each compilation unit need to be in their own data
structure.

A side benefit of this reorganization is to make the structure of the
summary more similar to the structure of the element model; this
should in turn make it simpler (and possibly more performant) to
convert between element models and summaries.

This CL reorganizes the declarations themselves; future CLs will
reorganize the dependency and resolution information to match.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1530503002 .
2015-12-14 16:30:15 -08:00
Paul Berry 9cff7ca404 Ensure that summary builders aren't used after call to finish()
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1522123002 .
2015-12-14 08:59:20 -08:00
Paul Berry 45068f01ed Track implicit vs explicit types in summaries.
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1524443002 .
2015-12-11 13:49:14 -08:00
Paul Berry 84c3cdb048 Add a unit index to prelinked type references in summaries.
In order to avoid having to reconstitute the entire element model when
deserializing a library summary, we'll need to be able to create element
handles for any elements referenced by the library.  Since element
handles operate using a "location", and the "location" records
information about the compilation unit containing the element, this
means that the library summary needs to track which unit each referenced
element lives in (even though this information would otherwise not be
semantically relevant).

R=scheglov@google.com

Review URL: https://codereview.chromium.org/1468583002 .
2015-11-20 14:10:42 -08:00
Paul Berry 0aebd7d6b2 Implement support for generic methods in summaries.
In theory generic top level functions are also supported, but they
aren't tested due to lack of parser support.

R=brianwilkerson@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org/1455863003 .
2015-11-18 10:26:28 -08:00
Paul Berry 178cebb634 Modify summary Builder classes to avoid the use of Object.
Instead of passing around opaque Objects which are the result of
calling the Builder.finish() methods, we pass around the Builder
objects themselves, and we call finish() from within the generated
code.  This pushes the lack of type safety into the generated code,
leaving the handwritten code type safe.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1452363002 .
2015-11-17 15:50:26 -08:00
Paul Berry 74f09b99f1 Introduce code to generate summaries from an element model.
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1420053011 .
2015-11-11 13:17:59 -08:00
Paul Berry 9d550c4a0f Begin generating code for summary serialization/deserialization.
The generated code is not yet used.

R=brianwilkerson@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org/1414903005 .
2015-11-04 10:22:42 -08:00
Paul Berry 7995c8ef1e Replace flags in summary IDL with enums and booleans.
We can let code generation compress these enums and booleans into a flag
integer if necessary to save space.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1415173003 .
2015-10-21 13:50:23 -07:00
Paul Berry de54dcbb0a Minor cleanup to analyzer summary IDL.
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1413763007 .
2015-10-20 11:51:44 -07:00
Paul Berry fc1f07fe2e Introduce an "idl"-like format description for analyzer summaries.
Not yet used.  This is mostly copied from experiments done earlier in
the year, and is therefore incomplete; I plan to refine this in the
process of fleshing out the implementation and tests.

R=scheglov@google.com

Review URL: https://codereview.chromium.org/1410383004 .
2015-10-20 09:09:43 -07:00