]> granicus.if.org Git - clang/commit
Driver: hoist the `wchar_t` handling to the driver
authorSaleem Abdulrasool <compnerd@compnerd.org>
Fri, 6 Oct 2017 23:09:55 +0000 (23:09 +0000)
committerSaleem Abdulrasool <compnerd@compnerd.org>
Fri, 6 Oct 2017 23:09:55 +0000 (23:09 +0000)
commitb623e4aa711a40eae845d6eabf2ea3b5303d391d
treea14d5c47af6678237ff827523a3e3f36af268542
parentfe2683b0850c29250ab428c538948989d02d0409
Driver: hoist the `wchar_t` handling to the driver

Move the logic for determining the `wchar_t` type information into the
driver.  Rather than passing the single bit of information of
`-fshort-wchar` indicate to the frontend the desired type of `wchar_t`
through a new `-cc1` option of `-fwchar-type` and indicate the
signedness through `-f{,no-}signed-wchar`.  This replicates the current
logic which was spread throughout Basic into the
`RenderCharacterOptions`.

Most of the changes to the tests are to ensure that the frontend uses
the correct type.  Add a new test set under `test/Driver/wchar_t.c` to
ensure that we calculate the proper types for the various cases.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@315126 91177308-0d34-0410-b5e6-96231b3b80d8
28 files changed:
include/clang/Basic/DiagnosticFrontendKinds.td
include/clang/Basic/LangOptions.def
include/clang/Driver/CC1Options.td
include/clang/Driver/Options.td
lib/Basic/TargetInfo.cpp
lib/Basic/Targets/AArch64.cpp
lib/Basic/Targets/ARM.cpp
lib/Basic/Targets/AVR.h
lib/Basic/Targets/OSTargets.h
lib/Basic/Targets/X86.h
lib/Driver/ToolChains/Clang.cpp
lib/Frontend/CompilerInstance.cpp
lib/Frontend/CompilerInvocation.cpp
test/CXX/conv/conv.prom/p2.cpp
test/CodeGen/arm-metadata.c
test/CodeGen/pascal-wchar-string.c
test/CodeGen/string-literal-short-wstring.c
test/CodeGen/string-literal-unicode-conversion.c
test/CodeGen/wchar-size.c
test/Driver/clang_f_opts.c
test/Headers/wchar_limits.cpp
test/Index/index-pch.cpp
test/Lexer/wchar.c
test/Preprocessor/init.c
test/Preprocessor/pr19649-unsigned-wchar_t.c
test/Preprocessor/wchar_t.c [new file with mode: 0644]
test/Sema/wchar.c
test/SemaCXX/short-wchar-sign.cpp