Skip to content

Commit

Permalink
Serialise types last.
Browse files Browse the repository at this point in the history
Constants can introduce new types, so we have to serialise types after
constants.
  • Loading branch information
vext01 committed Sep 29, 2023
1 parent aec9a7a commit 257e377
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions llvm/lib/YkIR/YkIRWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -279,19 +279,19 @@ class YkIRWriter {
serialiseFunc(F);
}

// num_types:
OutStreamer.emitSizeT(Types.size());
// types:
for (Type *&Ty : Types) {
serialiseType(Ty);
}

// num_constants:
OutStreamer.emitSizeT(Constants.size());
// constants:
for (class Constant *&C : Constants) {
serialiseConstant(C);
}

// num_types:
OutStreamer.emitSizeT(Types.size());
// types:
for (Type *&Ty : Types) {
serialiseType(Ty);
}
}
};
} // anonymous namespace
Expand Down

0 comments on commit 257e377

Please sign in to comment.