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

2017-10-06 Thread Saleem Abdulrasool via Phabricator via cfe-commits
compnerd closed this revision. compnerd added a comment. SVN r315126 Repository: rL LLVM https://reviews.llvm.org/D37891 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2017-10-06 Thread Saleem Abdulrasool via Phabricator via cfe-commits
compnerd added inline comments. Comment at: lib/Basic/Targets/AArch64.cpp:47-51 + bool IsNetBSD = getTriple().getOS() == llvm::Triple::NetBSD; + bool IsOpenBSD = getTriple().getOS() == llvm::Triple::OpenBSD; + if (!getTriple().isOSDarwin() && !IsNetBSD && !IsOpenBSD) +WCha

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

2017-10-06 Thread Reid Kleckner via Phabricator via cfe-commits
rnk accepted this revision. rnk added a comment. This revision is now accepted and ready to land. Looks good with nits Comment at: lib/Basic/Targets/AArch64.cpp:47-51 + bool IsNetBSD = getTriple().getOS() == llvm::Triple::NetBSD; + bool IsOpenBSD = getTriple().getOS() == llvm

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

2017-10-06 Thread Saleem Abdulrasool via Phabricator via cfe-commits
compnerd updated this revision to Diff 118085. compnerd added a comment. Split the defaulting back to all the various targets. Repository: rL LLVM https://reviews.llvm.org/D37891 Files: include/clang/Basic/DiagnosticFrontendKinds.td include/clang/Basic/LangOptions.def include/clang/Dri

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

2017-10-05 Thread Reid Kleckner via Phabricator via cfe-commits
rnk added inline comments. Comment at: lib/Basic/TargetInfo.cpp:29 +namespace { +TargetInfo::IntType GetDefaultWCharType(const llvm::Triple &T) { + const llvm::Triple::ArchType Arch = T.getArch(); compnerd wrote: > rnk wrote: > > How is this better than what we

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

2017-10-05 Thread Saleem Abdulrasool via Phabricator via cfe-commits
compnerd added inline comments. Comment at: lib/Basic/TargetInfo.cpp:29 +namespace { +TargetInfo::IntType GetDefaultWCharType(const llvm::Triple &T) { + const llvm::Triple::ArchType Arch = T.getArch(); rnk wrote: > How is this better than what we had before? It'

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

2017-10-05 Thread Reid Kleckner via Phabricator via cfe-commits
rnk added inline comments. Comment at: lib/Basic/TargetInfo.cpp:29 +namespace { +TargetInfo::IntType GetDefaultWCharType(const llvm::Triple &T) { + const llvm::Triple::ArchType Arch = T.getArch(); How is this better than what we had before? It's totally inconsis

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

2017-10-05 Thread Saleem Abdulrasool via Phabricator via cfe-commits
compnerd updated this revision to Diff 117832. compnerd added a comment. Moves the logic back into Basic. The flags are now optional, but controlled by the driver. The test adjustments are to map the old `-fshort-wchar` to `-fwchar-type=short -fno-signed-wchar` for the most part, there is one

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

2017-09-26 Thread Matthias Braun via Phabricator via cfe-commits
MatzeB added inline comments. Comment at: lib/CodeGen/CodeGenModule.cpp:477 Context.getTypeSizeInChars(Context.getWideCharType()).getQuantity(); - assert((LangOpts.ShortWChar || - llvm::TargetLibraryInfoImpl::getTargetWCharSize(Target.getTriple()) == ---

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

2017-09-16 Thread Saleem Abdulrasool via Phabricator via cfe-commits
compnerd added inline comments. Comment at: lib/CodeGen/CodeGenModule.cpp:477 Context.getTypeSizeInChars(Context.getWideCharType()).getQuantity(); - assert((LangOpts.ShortWChar || - llvm::TargetLibraryInfoImpl::getTargetWCharSize(Target.getTriple()) == -

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

2017-09-15 Thread Saleem Abdulrasool via Phabricator via cfe-commits
compnerd added inline comments. Comment at: lib/CodeGen/CodeGenModule.cpp:477 Context.getTypeSizeInChars(Context.getWideCharType()).getQuantity(); - assert((LangOpts.ShortWChar || - llvm::TargetLibraryInfoImpl::getTargetWCharSize(Target.getTriple()) == -

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

2017-09-15 Thread Matthias Braun via Phabricator via cfe-commits
MatzeB added inline comments. Comment at: lib/CodeGen/CodeGenModule.cpp:477 Context.getTypeSizeInChars(Context.getWideCharType()).getQuantity(); - assert((LangOpts.ShortWChar || - llvm::TargetLibraryInfoImpl::getTargetWCharSize(Target.getTriple()) == ---

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

2017-09-15 Thread Saleem Abdulrasool via Phabricator via cfe-commits
compnerd updated this revision to Diff 115510. compnerd added a comment. Try to clarify the logic for APCS ABI. Repository: rL LLVM https://reviews.llvm.org/D37891 Files: include/clang/Basic/DiagnosticFrontendKinds.td include/clang/Basic/LangOptions.def include/clang/Driver/CC1Options.

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

2017-09-15 Thread Saleem Abdulrasool via Phabricator via cfe-commits
compnerd added inline comments. Comment at: lib/Driver/ToolChains/Clang.cpp:2659 + + const bool IsAPCSABI = + IsARM && (IsGNUEnvironment || IsNetBSD || rnk wrote: > This target detection logic is insanely complicated, and I'm not convinced > it's simpler t

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

2017-09-15 Thread Reid Kleckner via Phabricator via cfe-commits
rnk added inline comments. Comment at: lib/CodeGen/CodeGenModule.cpp:477 Context.getTypeSizeInChars(Context.getWideCharType()).getQuantity(); - assert((LangOpts.ShortWChar || - llvm::TargetLibraryInfoImpl::getTargetWCharSize(Target.getTriple()) == --

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

2017-09-15 Thread Saleem Abdulrasool via Phabricator via cfe-commits
compnerd added a comment. We could leave the defaults there as they stand, and only have the new flags alter the default. However, it seems that just paying the cost of adjusting the tests once isn't too bad. To me, it seems that having one instance of the horrible logic for determining the t

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

2017-09-15 Thread Reid Kleckner via Phabricator via cfe-commits
rnk added a comment. I do remember recommending this approach over IRC, but I thought we concluded that we should leave all the defaults in lib/Basic/Targets/ and make the -cc1 -fwchar-type= and -f[no-]signed-wchar overrides that affected all targets equally. That would avoid the need for these

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

2017-09-14 Thread Saleem Abdulrasool via Phabricator via cfe-commits
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 d