Skip to content

Commit 257e377

Browse files
committed
Serialise types last.
Constants can introduce new types, so we have to serialise types after constants.
1 parent aec9a7a commit 257e377

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

llvm/lib/YkIR/YkIRWriter.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -279,19 +279,19 @@ class YkIRWriter {
279279
serialiseFunc(F);
280280
}
281281

282-
// num_types:
283-
OutStreamer.emitSizeT(Types.size());
284-
// types:
285-
for (Type *&Ty : Types) {
286-
serialiseType(Ty);
287-
}
288-
289282
// num_constants:
290283
OutStreamer.emitSizeT(Constants.size());
291284
// constants:
292285
for (class Constant *&C : Constants) {
293286
serialiseConstant(C);
294287
}
288+
289+
// num_types:
290+
OutStreamer.emitSizeT(Types.size());
291+
// types:
292+
for (Type *&Ty : Types) {
293+
serialiseType(Ty);
294+
}
295295
}
296296
};
297297
} // anonymous namespace

0 commit comments

Comments
 (0)