From 3447fb01c0bdb1dce159681cc81c1f8a891cb0a2 Mon Sep 17 00:00:00 2001 From: Jay Foad Date: Sun, 28 Nov 2010 21:04:48 +0000 Subject: PR5207: change APInt::doubleToBits() and APInt::floatToBits() to be static methods that return a new APInt. llvm-svn: 120261 --- llvm/lib/ExecutionEngine/Interpreter/Execution.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'llvm/lib/ExecutionEngine/Interpreter/Execution.cpp') diff --git a/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp b/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp index 59ebe6e..498063b 100644 --- a/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp +++ b/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp @@ -1060,11 +1060,9 @@ GenericValue Interpreter::executeBitCastInst(Value *SrcVal, const Type *DstTy, Dest.PointerVal = Src.PointerVal; } else if (DstTy->isIntegerTy()) { if (SrcTy->isFloatTy()) { - Dest.IntVal.zext(sizeof(Src.FloatVal) * CHAR_BIT); - Dest.IntVal.floatToBits(Src.FloatVal); + Dest.IntVal = APInt::floatToBits(Src.FloatVal); } else if (SrcTy->isDoubleTy()) { - Dest.IntVal.zext(sizeof(Src.DoubleVal) * CHAR_BIT); - Dest.IntVal.doubleToBits(Src.DoubleVal); + Dest.IntVal = APInt::doubleToBits(Src.DoubleVal); } else if (SrcTy->isIntegerTy()) { Dest.IntVal = Src.IntVal; } else -- cgit v1.1