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 @@ -1252,9 +1252,25 @@ class YkIRWriter {
1252
1252
serialiseString (toString (C));
1253
1253
}
1254
1254
1255
+ void serialiseConstantNullPtr (ConstantPointerNull *NP) {
1256
+ // `Const` discriminator:
1257
+ OutStreamer.emitInt8 (ConstKindVal);
1258
+ // ty_idx:
1259
+ OutStreamer.emitSizeT (typeIndex (NP->getType ()));
1260
+ // num_bytes:
1261
+ DataLayout DL (&M);
1262
+ assert (DL.getPointerSize (NP->getType ()->getAddressSpace ()) ==
1263
+ sizeof (size_t ));
1264
+ OutStreamer.emitSizeT (sizeof (size_t ));
1265
+ // bytes:
1266
+ OutStreamer.emitSizeT (0 );
1267
+ }
1268
+
1255
1269
void serialiseConstant (Constant *C) {
1256
1270
if (ConstantInt *CI = dyn_cast<ConstantInt>(C)) {
1257
1271
serialiseConstantInt (CI);
1272
+ } else if (ConstantPointerNull *NP = dyn_cast<ConstantPointerNull>(C)) {
1273
+ serialiseConstantNullPtr (NP);
1258
1274
} else {
1259
1275
serialiseUnimplementedConstant (C);
1260
1276
}
You can’t perform that action at this time.
0 commit comments