mirror of
https://github.com/RPCSX/llvm.git
synced 2024-11-29 22:50:47 +00:00
Fixed InitializeMemory to handle ConstantPacked.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25481 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
f690bc8c07
commit
7c2b7c7c75
@ -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());
|
||||
|
Loading…
Reference in New Issue
Block a user