Skip to content

Commit 881577b

Browse files
authored
Merge pull request rust-lang#104 from vext01/tidy
Tidy up IR serialiser a bit
2 parents 9f5de3b + b3bddfd commit 881577b

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

llvm/lib/YkIR/YkIRWriter.cpp

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,10 +169,6 @@ class YkIRWriter {
169169
return getIndex(&M, F);
170170
}
171171

172-
public:
173-
YkIRWriter(Module &M, MCStreamer &OutStreamer)
174-
: M(M), OutStreamer(OutStreamer) {}
175-
176172
// Serialises a null-terminated string.
177173
void serialiseString(StringRef S) {
178174
OutStreamer.emitBinaryData(S);
@@ -489,6 +485,18 @@ class YkIRWriter {
489485
}
490486
}
491487

488+
public:
489+
YkIRWriter(Module &M, MCStreamer &OutStreamer)
490+
: M(M), OutStreamer(OutStreamer) {}
491+
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)