@@ -1555,26 +1555,26 @@ void SILSerializer::writeSILInstruction(const SILInstruction &SI) {
1555
1555
case SILInstructionKind::FloatLiteralInst:
1556
1556
case SILInstructionKind::IntegerLiteralInst: {
1557
1557
// Use SILOneOperandLayout to specify the type and the literal.
1558
- std::string Str;
1558
+ llvm::SmallString< char > Str;
1559
1559
SILType Ty;
1560
1560
switch (SI.getKind ()) {
1561
1561
default : llvm_unreachable (" Out of sync with parent switch" );
1562
1562
case SILInstructionKind::IntegerLiteralInst:
1563
- Str = cast<IntegerLiteralInst>(&SI)->getValue ().toString (10 , true );
1563
+ cast<IntegerLiteralInst>(&SI)->getValue ().toString (Str, 10 ,
1564
+ /* signed*/ true );
1564
1565
Ty = cast<IntegerLiteralInst>(&SI)->getType ();
1565
1566
break ;
1566
1567
case SILInstructionKind::FloatLiteralInst:
1567
- Str = cast<FloatLiteralInst >(&SI)->getBits ().toString (16 ,
1568
- /* Signed */ false );
1568
+ cast<IntegerLiteralInst >(&SI)->getValue ().toString (Str, 16 ,
1569
+ /* signed */ true );
1569
1570
Ty = cast<FloatLiteralInst>(&SI)->getType ();
1570
1571
break ;
1571
1572
}
1572
1573
unsigned abbrCode = SILAbbrCodes[SILOneOperandLayout::Code];
1573
- SILOneOperandLayout::emitRecord (Out, ScratchRecord, abbrCode,
1574
- (unsigned )SI.getKind (), 0 ,
1575
- S.addTypeRef (Ty.getASTType ()),
1576
- (unsigned )Ty.getCategory (),
1577
- S.addUniquedStringRef (Str));
1574
+ SILOneOperandLayout::emitRecord (
1575
+ Out, ScratchRecord, abbrCode, (unsigned )SI.getKind (), 0 ,
1576
+ S.addTypeRef (Ty.getASTType ()), (unsigned )Ty.getCategory (),
1577
+ S.addUniquedStringRef (Str.str ()));
1578
1578
break ;
1579
1579
}
1580
1580
case SILInstructionKind::MarkFunctionEscapeInst: {
0 commit comments