]> granicus.if.org Git - clang/commit
Sema: Fix explicit address space cast involving void pointers
authorYaxun Liu <Yaxun.Liu@amd.com>
Fri, 3 Aug 2018 03:18:56 +0000 (03:18 +0000)
committerYaxun Liu <Yaxun.Liu@amd.com>
Fri, 3 Aug 2018 03:18:56 +0000 (03:18 +0000)
commitd3ee85bfddb61cc7d77488784eef1515bcc68a9d
tree9190317d6650323ab0f2a4c7706a071f76aee549
parentcfa6f95d761c637715ade56c863d2e9921ad8f87
Sema: Fix explicit address space cast involving void pointers

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 destination
type and set the correct cast kind.

Differential Revision: https://reviews.llvm.org/D50003

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@338805 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Sema/SemaCast.cpp
test/CodeGenCXX/address-space-cast.cpp