File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed
include/swift/WALASupport Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ class InstrKindInfoGetter {
47
47
jobject handleIntegerLiteralInst ();
48
48
jobject handleStringLiteralInst ();
49
49
jobject handleConstStringLiteralInst ();
50
+ jobject handleFloatLiteralInst ();
50
51
jobject handleProjectBoxInst ();
51
52
jobject handleDebugValueInst ();
52
53
jobject handleFunctionRefInst ();
Original file line number Diff line number Diff line change @@ -225,6 +225,19 @@ jobject InstrKindInfoGetter::handleIntegerLiteralInst() {
225
225
return node;
226
226
}
227
227
228
+ jobject InstrKindInfoGetter::handleFloatLiteralInst () {
229
+ if (outs != NULL ) {
230
+ *outs << " << FloatLiteralInst >>" << " \n " ;
231
+ }
232
+ FloatLiteralInst* castInst = cast<FloatLiteralInst>(instr);
233
+ APFloat value = castInst->getValue ();
234
+ bool APFLosesInfo;
235
+ value.convert (APFloat::IEEEdouble (), APFloat::rmNearestTiesToEven, &APFLosesInfo);
236
+ jobject node = (*wala)->makeConstant (value.convertToDouble ());
237
+ nodeMap->insert (std::make_pair (castInst, node));
238
+ return node;
239
+ }
240
+
228
241
jobject InstrKindInfoGetter::handleStringLiteralInst () {
229
242
// ValueKind indentifier
230
243
if (outs != NULL ) {
@@ -813,7 +826,7 @@ SILInstructionKind InstrKindInfoGetter::get() {
813
826
}
814
827
815
828
case SILInstructionKind::FloatLiteralInst: {
816
- *outs << " << FloatLiteralInst >> " << " \n " ;
829
+ node = handleFloatLiteralInst () ;
817
830
break ;
818
831
}
819
832
You can’t perform that action at this time.
0 commit comments