MCPcopy Create free account
hub / github.com/WheretIB/nullc / ConvertFirstForSecond

Function ConvertFirstForSecond

NULLC/SyntaxTreeLLVM.cpp:435–447  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

433}
434
435Value* ConvertFirstForSecond(Value *V, TypeInfo *firstType, TypeInfo *secondType)
436{
437 asmDataType fDT = firstType->dataType, sDT = secondType->dataType;
438 asmStackType first = stackTypeForDataType(fDT), second = stackTypeForDataType(sDT);
439 if(first == STYPE_INT && second == STYPE_DOUBLE)
440 return Builder.CreateSIToFP(V, Type::getDoubleTy(getGlobalContext()), "tmp_itod");
441 if(first == STYPE_LONG && second == STYPE_DOUBLE)
442 return Builder.CreateSIToFP(V, Type::getDoubleTy(getGlobalContext()), "tmp_ltod");
443 if(first == STYPE_INT && second == STYPE_LONG)
444 return Builder.CreateIntCast(V, Type::getInt64Ty(getGlobalContext()), true, "tmp_itol");
445
446 return V;
447}
448
449TypeInfo* GetStackType(TypeInfo* type)
450{

Callers 1

CompileLLVMMethod · 0.70

Calls 1

stackTypeForDataTypeFunction · 0.85

Tested by

no test coverage detected