Skip to content

Commit

Permalink
Merge pull request #104 from vext01/tidy
Browse files Browse the repository at this point in the history
Tidy up IR serialiser a bit
  • Loading branch information
ltratt authored Nov 20, 2023
2 parents 9f5de3b + b3bddfd commit 881577b
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions llvm/lib/YkIR/YkIRWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,6 @@ class YkIRWriter {
return getIndex(&M, F);
}

public:
YkIRWriter(Module &M, MCStreamer &OutStreamer)
: M(M), OutStreamer(OutStreamer) {}

// Serialises a null-terminated string.
void serialiseString(StringRef S) {
OutStreamer.emitBinaryData(S);
Expand Down Expand Up @@ -489,6 +485,18 @@ class YkIRWriter {
}
}

public:
YkIRWriter(Module &M, MCStreamer &OutStreamer)
: M(M), OutStreamer(OutStreamer) {}

// Entry point for IR serialisation.
//
// The order of serialisation matters.
//
// - Serialising functions can introduce new types and constants.
// - Serialising constants can introduce new types.
//
// So we must serialise functions, then constants, then types.
void serialise() {
// header:
OutStreamer.emitInt32(Magic);
Expand Down

0 comments on commit 881577b

Please sign in to comment.