Skip to content

Commit 975750d

Browse files
committed
[Serialization] Add a helper for serializing nodes in an object graph
The AST block in a compiled module represents an object graph, which is essentially serialized in four steps: - An entity (such as a Decl or Type) is encountered, given an ID, and added to a worklist. - The next entity is popped from the worklist and its offset in the output stream is recorded. - During the course of writing that entity, more entities will be referenced and added to the worklist. - Once the entire worklist is drained, the offsets get written to a table in the Index block. The implementation of this was duplicated for each kind of entity in the AST block; this commit factors that out into a reusable helper. No intended high-level functionality change, but the order in which Decls and Types get emitted might change a little now that they're not in the same queue.
1 parent 2187fb2 commit 975750d

File tree

2 files changed

+262
-432
lines changed

2 files changed

+262
-432
lines changed

0 commit comments

Comments
 (0)