[PATCH] D37891: Driver: hoist the `wchar_t` handling to the driver

Saleem Abdulrasool via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 14 23:20:36 PDT 2017


compnerd created this revision.
compnerd added a project: clang.
Herald added subscribers: fedor.sergeev, javed.absar.

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.


Repository:
  rL LLVM

https://reviews.llvm.org/D37891

Files:
  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/Basic/Targets/XCore.h
  lib/CodeGen/CodeGenModule.cpp
  lib/Driver/ToolChains/Clang.cpp
  lib/Frontend/CompilerInstance.cpp
  lib/Frontend/CompilerInvocation.cpp
  test/CXX/conv/conv.prom/p2.cpp
  test/CodeGen/aarch64-type-sizes.c
  test/CodeGen/arm-metadata.c
  test/CodeGen/coff-aarch64-type-sizes.c
  test/CodeGen/ms-annotation.c
  test/CodeGen/pascal-wchar-string.c
  test/CodeGen/string-literal-short-wstring.c
  test/CodeGen/string-literal-unicode-conversion.c
  test/CodeGen/wchar-const.c
  test/CodeGen/wchar-size.c
  test/CodeGenCXX/mangle-ms-string-literals.cpp
  test/CodeGenCXX/ms_wide_predefined_expr.cpp
  test/Driver/clang_f_opts.c
  test/Driver/rewrite-legacy-objc.m
  test/Driver/rewrite-objc.m
  test/Driver/wchar_t.c
  test/Headers/wchar_limits.cpp
  test/Index/index-pch.cpp
  test/Lexer/wchar-signedness.c
  test/Lexer/wchar.c
  test/Preprocessor/init.c
  test/Preprocessor/pr19649-unsigned-wchar_t.c
  test/Preprocessor/stdint.c
  test/Preprocessor/wchar_t.c
  test/Preprocessor/woa-defaults.c
  test/Preprocessor/woa-wchar_t.c
  test/Sema/format-strings-ms.c
  test/Sema/wchar.c
  test/SemaCXX/no-wchar.cpp
  test/SemaCXX/short-wchar-sign.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D37891.115361.patch
Type: text/x-patch
Size: 56803 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170915/71d0517e/attachment-0001.bin>


More information about the cfe-commits mailing list