Hi Devang,
> // float foo(int w, float A[][w], int g) { return A[g][0]; }
>
> ArrayAddr = BitCastToType(ArrayAddr, PointerType::get(Type::Int8Ty));
> - Value *TypeSize = Emit(array_ref_element_size(exp), 0);
> - TypeSize = CastToUIntType(TypeSize, IntPtrTy);
> + Value *TypeSize = NULL;
since TypeSize is only used in the second branch of the "if", it could be
declared there.
> + if (VOID_TYPE_P(TREE_TYPE(ArrayType))) {
> + Value *Ptr = Builder.CreateGEP(ArrayAddr, IndexVal, "tmp");
> + return BitCastToType(Ptr, PointerType::get(Type::Int8Ty));
If ArrayAddr is not an i8*, then the CreateGEP line is wrong, so
this bitcast should be useless.
Ciao,
Duncan.
_______________________________________________
llvm-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits