AlexeySotkin marked an inline comment as done.
AlexeySotkin added inline comments.


================
Comment at: lib/CodeGen/CGBuiltin.cpp:3711
+      EventList = EventList->getType()->isIntegerTy()
+                      ? Builder.CreateIntToPtr(EventList, EventPtrTy)
+                      : Builder.CreatePointerCast(EventList, EventPtrTy);
----------------
Anastasia wrote:
> AlexeySotkin wrote:
> > Anastasia wrote:
> > > It seems we are not testing the casts?
> > Do you mean that when we run LIT tests, this code is not executed? If so, 
> > in the modified test below, literal zeros are making clang to execute 
> > CreateIntToPtr call indeed.
> > Or, do you mean that we need some extra check(to make sure the cast will be 
> > successful for example) in the source code itself ?
> I mean since you are generating extra IR nodes we should check in the tests 
> that they appear correctly. I don't see these casts checked in the tests 
> currently.
Since we are casting null constants they are folded to null values, like this 
`%opencl.clk_event_t{{.*}}* addrspace(4)* null`.


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D59985/new/

https://reviews.llvm.org/D59985



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to