[llvm-commits] CVS: llvm/lib/ExecutionEngine/Interpreter/Execution.cpp
Chris Lattner
lattner at cs.uiuc.edu
Sat Jan 8 12:05:47 PST 2005
Changes in directory llvm/lib/ExecutionEngine/Interpreter:
Execution.cpp updated: 1.134 -> 1.135
---
Log message:
Silence VS warnings
---
Diffs of the changes: (+4 -4)
Index: llvm/lib/ExecutionEngine/Interpreter/Execution.cpp
diff -u llvm/lib/ExecutionEngine/Interpreter/Execution.cpp:1.134 llvm/lib/ExecutionEngine/Interpreter/Execution.cpp:1.135
--- llvm/lib/ExecutionEngine/Interpreter/Execution.cpp:1.134 Sat Oct 16 13:20:00 2004
+++ llvm/lib/ExecutionEngine/Interpreter/Execution.cpp Sat Jan 8 14:05:34 2005
@@ -703,7 +703,7 @@
unsigned NumElements = getOperandValue(I.getOperand(0), SF).UIntVal;
// Allocate enough memory to hold the type...
- void *Memory = malloc(NumElements * TD.getTypeSize(Ty));
+ void *Memory = malloc(NumElements * (size_t)TD.getTypeSize(Ty));
GenericValue Result = PTOGV(Memory);
assert(Result.PointerVal != 0 && "Null pointer returned by malloc!");
@@ -736,9 +736,9 @@
const StructLayout *SLO = TD.getStructLayout(STy);
const ConstantUInt *CPU = cast<ConstantUInt>(I.getOperand());
- unsigned Index = CPU->getValue();
+ unsigned Index = unsigned(CPU->getValue());
- Total += SLO->MemberOffsets[Index];
+ Total += (PointerTy)SLO->MemberOffsets[Index];
} else {
const SequentialType *ST = cast<SequentialType>(*I);
// Get the index number for the array... which must be long type...
@@ -756,7 +756,7 @@
case Type::UIntTyID: Idx = IdxGV.UIntVal; break;
case Type::ULongTyID: Idx = IdxGV.ULongVal; break;
}
- Total += TD.getTypeSize(ST->getElementType())*Idx;
+ Total += PointerTy(TD.getTypeSize(ST->getElementType())*Idx);
}
}
More information about the llvm-commits
mailing list