hanchenye-llvm-project/clang-tools-extra/test
Stephane Moore 5f70c473c9 [clang-tidy] Disable google-runtime-int in Objective-C++ 🔓
Summary:
In contrast to Google C++, Objective-C often uses built-in integer types
other than `int`. In fact, the Objective-C runtime itself defines the
types NSInteger¹ and NSUInteger² which are variant types depending on
the target architecture. The Objective-C style guide indicates that
usage of system types with variant sizes is appropriate when handling
values provided by system interfaces³. Objective-C++ is commonly the
result of conversion from Objective-C to Objective-C++ for the purpose
of integrating C++ functionality. The opposite of Objective-C++ being
used to expose Objective-C functionality to C++ is less common,
potentially because Objective-C has a signficantly more uneven presence
on different platforms compared to C++. This generally predisposes
Objective-C++ to commonly being more Objective-C than C++. Forcing
Objective-C++ developers to perform conversions between variant system types
and fixed size integer types depending on target architecture when
Objective-C++ commonly uses variant system types from Objective-C is
likely to lead to more bugs and overhead than benefit. For that reason,
this change proposes to disable google-runtime-int in Objective-C++.

[1] https://developer.apple.com/documentation/objectivec/nsinteger?language=objc
[2] https://developer.apple.com/documentation/objectivec/nsuinteger?language=objc
[3] "Types long, NSInteger, NSUInteger, and CGFloat vary in size between
32- and 64-bit builds. Use of these types is appropriate when handling
values exposed by system interfaces, but they should be avoided for most
other computations."
https://github.com/google/styleguide/blob/gh-pages/objcguide.md#types-with-inconsistent-sizes

Subscribers: xazax.hun, jdoerfert, cfe-commits

Tags: #clang

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

llvm-svn: 356627
2019-03-20 23:05:00 +00:00
..
Unit Assume the shared library path variable is LD_LIBRARY_PATH on systems 2018-01-20 14:34:33 +00:00
clang-apply-replacements Deduplicate replacements from diagnostics. 2018-09-25 08:24:07 +00:00
clang-change-namespace Rename directory housing clang-change-namespace to be eponymous 2019-03-15 11:54:01 +00:00
clang-doc [clang-doc] Switch to default to all-TUs executor 2018-10-26 19:11:34 +00:00
clang-move Re-enable a clang-move test on windows. 2018-05-18 09:25:36 +00:00
clang-query
clang-reorder-fields
clang-tidy [clang-tidy] Disable google-runtime-int in Objective-C++ 🔓 2019-03-20 23:05:00 +00:00
clangd [clangd] Add support for type hierarchy (super types only for now) 2019-03-19 09:27:04 +00:00
include-fixer Remove the optional dependency from libclang to clang-tidy/include-fixer 2018-11-23 15:02:33 +00:00
modularize Revert r351208 (which was a revert of r350892). 2019-01-17 20:21:44 +00:00
pp-trace [pp-trace] Delete -ignore and add a new option -callbacks 2019-03-18 13:30:17 +00:00
.clang-format
CMakeLists.txt [build] Rename clang-headers to clang-resource-headers 2019-03-04 21:19:53 +00:00
lit.cfg [extra] unit tests enable crash-recovery cases on FreeBSD 2019-01-24 07:58:42 +00:00
lit.site.cfg.in [clangd] XPC transport layer 2019-01-16 00:24:22 +00:00