PR4882

Hello,

This patch fixes bug 4882.

Regards
-Jakub

pr4882.patch (6.7 KB)

Hi Jakub, looks good.

+ LLVMContext *Context = &SI->getContext();

I guess this could be
   LLVMContext &Context = SI->getContext();
which means you can use Context rather than *Context below.

- const Type *Ty = Type::getInt64Ty(SI->getContext());
- MemSetF = Intrinsic::getDeclaration(M, Intrinsic::memset, &Ty, 1);
+ const Type *Tys[] = {Type::getInt64Ty(*Context)};
+ MemSetF = Intrinsic::getDeclaration(M, Intrinsic::memset,
+ Tys, 1);

Why did you introduce Tys and not stick with Ty?

Ciao,

Duncan.

Hi Jakub, looks good.

+ LLVMContext *Context = &SI->getContext();

I guess this could be
LLVMContext &Context = SI->getContext();
which means you can use Context rather than *Context below.

Right, C bad habit :wink: Fixed.

- const Type *Ty = Type::getInt64Ty(SI->getContext());
- MemSetF = Intrinsic::getDeclaration(M, Intrinsic::memset, &Ty, 1);
+ const Type *Tys = {Type::getInt64Ty(*Context)};
+ MemSetF = Intrinsic::getDeclaration(M, Intrinsic::memset,
+ Tys, 1);

Why did you introduce Tys and not stick with Ty?

Ah, I did "svn update" after my correction and I didn't notice that. Fixed.

I also added "-disable-output" to test-case.

-Jakub

pr4882-2.patch (6.54 KB)

Thanks! I hand minimized the testcase a bit, applied as r81175.

-Chris