[llvm-commits] [llvm] r117176 - /llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp
Gabor Greif
ggreif at gmail.com
Fri Oct 22 16:16:11 PDT 2010
Author: ggreif
Date: Fri Oct 22 18:16:11 2010
New Revision: 117176
URL: http://llvm.org/viewvc/llvm-project?rev=117176&view=rev
Log:
fix memory-layout assumption which only holds on little-endian systems
Modified:
llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp
Modified: llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp?rev=117176&r1=117175&r2=117176&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp Fri Oct 22 18:16:11 2010
@@ -505,7 +505,7 @@
emitGlobalAddress(GV, ARM::reloc_arm_absolute, isa<Function>(GV), false);
emitWordLE(0);
} else if (const ConstantInt *CI = dyn_cast<ConstantInt>(CV)) {
- uint32_t Val = *(uint32_t*)CI->getValue().getRawData();
+ uint32_t Val = uint32_t(*CI->getValue().getRawData());
emitWordLE(Val);
} else if (const ConstantFP *CFP = dyn_cast<ConstantFP>(CV)) {
if (CFP->getType()->isFloatTy())
More information about the llvm-commits
mailing list