From 257e37794b2549c5dbed97076a2cde8440498e2c Mon Sep 17 00:00:00 2001 From: Edd Barrett Date: Wed, 27 Sep 2023 11:28:17 +0100 Subject: [PATCH] Serialise types last. Constants can introduce new types, so we have to serialise types after constants. --- llvm/lib/YkIR/YkIRWriter.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/llvm/lib/YkIR/YkIRWriter.cpp b/llvm/lib/YkIR/YkIRWriter.cpp index e16292a296a0d7..2470685f115cf1 100644 --- a/llvm/lib/YkIR/YkIRWriter.cpp +++ b/llvm/lib/YkIR/YkIRWriter.cpp @@ -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