This revision was automatically updated to reflect the committed changes.
Closed by commit rL338805: Sema: Fix explicit address space cast involving void
pointers (authored by yaxunl, committed by ).
Herald added a subscriber: llvm-commits.
Changed prior to commit:
https://reviews.llvm.org/D500
rjmccall added inline comments.
Comment at: lib/Sema/SemaCast.cpp:1050
+ SrcType->getAs()->getPointeeType().getAddressSpace() !=
+
DestType->getAs()->getPointeeType().getAddressSpace();
+}
yaxunl wrote:
> rjmccall wrote:
> > yaxunl wrote:
> >
yaxunl added inline comments.
Comment at: lib/Sema/SemaCast.cpp:1050
+ SrcType->getAs()->getPointeeType().getAddressSpace() !=
+
DestType->getAs()->getPointeeType().getAddressSpace();
+}
rjmccall wrote:
> yaxunl wrote:
> > rjmccall wrote:
> >
rjmccall added inline comments.
Comment at: lib/Sema/SemaCast.cpp:1050
+ SrcType->getAs()->getPointeeType().getAddressSpace() !=
+
DestType->getAs()->getPointeeType().getAddressSpace();
+}
yaxunl wrote:
> rjmccall wrote:
> > I know the code w
yaxunl added inline comments.
Comment at: lib/Sema/SemaCast.cpp:1050
+ SrcType->getAs()->getPointeeType().getAddressSpace() !=
+
DestType->getAs()->getPointeeType().getAddressSpace();
+}
rjmccall wrote:
> I know the code was like this before,
rjmccall accepted this revision.
rjmccall added a comment.
This revision is now accepted and ready to land.
One minor request; feel free to just do that when you commit.
Comment at: lib/Sema/SemaCast.cpp:1050
+ SrcType->getAs()->getPointeeType().getAddressSpace() !=
+
yaxunl created this revision.
yaxunl added a reviewer: rjmccall.
Explicit cast of a void pointer to a pointer type in different address space is
incorrectly classified as bitcast, which causes invalid bitcast in codegen.
The patch fixes that by checking the address space of the source and destina