Skip to content

Commit b3bddfd

Browse files
committed
Add comment to serialise() and mention a design decision.
1 parent b8da34b commit b3bddfd

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

llvm/lib/YkIR/YkIRWriter.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,14 @@ class YkIRWriter {
489489
YkIRWriter(Module &M, MCStreamer &OutStreamer)
490490
: M(M), OutStreamer(OutStreamer) {}
491491

492+
// Entry point for IR serialisation.
493+
//
494+
// The order of serialisation matters.
495+
//
496+
// - Serialising functions can introduce new types and constants.
497+
// - Serialising constants can introduce new types.
498+
//
499+
// So we must serialise functions, then constants, then types.
492500
void serialise() {
493501
// header:
494502
OutStreamer.emitInt32(Magic);

0 commit comments

Comments
 (0)