File tree 1 file changed +16
-0
lines changed
1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -1284,9 +1284,25 @@ class YkIRWriter {
1284
1284
serialiseString (toString (C));
1285
1285
}
1286
1286
1287
+ void serialiseConstantNullPtr (ConstantPointerNull *NP) {
1288
+ // `Const` discriminator:
1289
+ OutStreamer.emitInt8 (ConstKindVal);
1290
+ // ty_idx:
1291
+ OutStreamer.emitSizeT (typeIndex (NP->getType ()));
1292
+ // num_bytes:
1293
+ DataLayout DL (&M);
1294
+ assert (DL.getPointerSize (NP->getType ()->getAddressSpace ()) ==
1295
+ sizeof (size_t ));
1296
+ OutStreamer.emitSizeT (sizeof (size_t ));
1297
+ // bytes:
1298
+ OutStreamer.emitSizeT (0 );
1299
+ }
1300
+
1287
1301
void serialiseConstant (Constant *C) {
1288
1302
if (ConstantInt *CI = dyn_cast<ConstantInt>(C)) {
1289
1303
serialiseConstantInt (CI);
1304
+ } else if (ConstantPointerNull *NP = dyn_cast<ConstantPointerNull>(C)) {
1305
+ serialiseConstantNullPtr (NP);
1290
1306
} else {
1291
1307
serialiseUnimplementedConstant (C);
1292
1308
}
You can’t perform that action at this time.
0 commit comments