CodeGenModule: Always output wchar_size, check LLVM assumptions.
authorMatthias Braun <matze@braunis.de>
Sat, 20 May 2017 01:29:55 +0000 (01:29 +0000)
committerMatthias Braun <matze@braunis.de>
Sat, 20 May 2017 01:29:55 +0000 (01:29 +0000)
commita4519532246a246a9e1d014d7c80343ca9ed7ee7
tree12332770957c11004e171a98563064b532646cf9
parent57fd12db0c76c9fde5f2d13507015bd161deaed6
CodeGenModule: Always output wchar_size, check LLVM assumptions.

Re-commit r303463 now that LLVM is fixed and adjust some lit tests.

llvm::TargetLibraryInfo needs to know the size of wchar_t to work on
functions like `wcslen`. This patch changes clang to always emit the
wchar_size module flag (it would only do so for ARM previously).
This also adds an `assert()` to ensure the LLVM defaults based on the
target triple are in sync with clang.

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

llvm-svn: 303478
clang/lib/CodeGen/CodeGenModule.cpp
clang/test/CodeGen/wchar-size.c [new file with mode: 0644]
clang/test/CodeGenCUDA/flush-denormals.cu
clang/test/CodeGenCXX/strict-vtable-pointers.cpp