[llvm-commits] [llvm] r44400 - /llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp
Duncan Sands
baldrick at free.fr
Wed Nov 28 02:36:21 PST 2007
Author: baldrick
Date: Wed Nov 28 04:36:19 2007
New Revision: 44400
URL: http://llvm.org/viewvc/llvm-project?rev=44400&view=rev
Log:
My compiler complains that "x always evaluates to true"
in this call:
Result.IntVal = APInt(80, 2, x);
What is x?
uint16_t x[8];
I deduce that the APInt constructor being used is this one:
APInt(uint32_t numBits, uint64_t val, bool isSigned = false);
rather than this one:
APInt(uint32_t numBits, uint32_t numWords, const uint64_t bigVal[]);
That doesn't seem right! This fix compiles but is otherwise completely
untested.
Modified:
llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp
Modified: llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp?rev=44400&r1=44399&r2=44400&view=diff
==============================================================================
--- llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp (original)
+++ llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp Wed Nov 28 04:36:19 2007
@@ -712,13 +712,17 @@
break;
case Type::X86_FP80TyID: {
// This is endian dependent, but it will only work on x86 anyway.
- uint16_t x[8], *p = (uint16_t*)Ptr;
+ uint16_t *p = (uint16_t*)Ptr;
+ union {
+ uint16_t x[8];
+ uint64_t y[2];
+ };
x[0] = p[1];
x[1] = p[2];
x[2] = p[3];
x[3] = p[4];
x[4] = p[0];
- Result.IntVal = APInt(80, 2, x);
+ Result.IntVal = APInt(80, 2, y);
break;
}
default:
More information about the llvm-commits
mailing list