1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 11:42:57 +01:00

Fixed InitializeMemory to handle ConstantPacked.

llvm-svn: 25481
This commit is contained in:
Robert Bocchino 2006-01-20 18:18:40 +00:00
parent f4277eb311
commit 51e0be55e8

View File

@ -457,6 +457,12 @@ GenericValue ExecutionEngine::LoadValueFromMemory(GenericValue *Ptr,
void ExecutionEngine::InitializeMemory(const Constant *Init, void *Addr) {
if (isa<UndefValue>(Init)) {
return;
} else if (const ConstantPacked *CP = dyn_cast<ConstantPacked>(Init)) {
unsigned ElementSize =
getTargetData().getTypeSize(CP->getType()->getElementType());
for (unsigned i = 0, e = CP->getNumOperands(); i != e; ++i)
InitializeMemory(CP->getOperand(i), (char*)Addr+i*ElementSize);
return;
} else if (Init->getType()->isFirstClassType()) {
GenericValue Val = getConstantValue(Init);
StoreValueToMemory(Val, (GenericValue*)Addr, Init->getType());