]> granicus.if.org Git - clang/commit
[Sema] Make extended vectors of `bool` an error.
authorGeorge Burgess IV <george.burgess.iv@gmail.com>
Thu, 28 Jan 2016 01:38:18 +0000 (01:38 +0000)
committerGeorge Burgess IV <george.burgess.iv@gmail.com>
Thu, 28 Jan 2016 01:38:18 +0000 (01:38 +0000)
commit0646fe72018e31974b4cae194460a828f77f4dc9
treea599e88e0bd0887138d2a000bb20758c8376d991
parent629d68f86da29f79f20ee7c55143ccb4a705aaa1
[Sema] Make extended vectors of `bool` an error.

In OpenCL, `bool` vectors are a reserved type, and are therefore
illegal.

Outside of OpenCL, if we try to make an extended vector of N `bool`s,
Clang will lower it to an `[N x i1]`. LLVM has no ABI for bitvectors, so
lots of operations on such vectors are thoroughly broken. As a result,
this patch makes them illegal in everything else, as well. :)

Differential Revision: http://reviews.llvm.org/D15721

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@259011 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Sema/SemaType.cpp
test/CodeGen/convertvector.c
test/Sema/ext_vector_casts.c
test/SemaOpenCL/bool-vectors.cl [new file with mode: 0644]