Discussion:
[PATCH] D55544: Warning: objc-encodings-larger-than=
Dave MacLachlan via Phabricator via cfe-commits
2018-12-11 04:01:51 UTC
Permalink
dmaclach created this revision.
dmaclach added a project: clang.
Herald added a subscriber: cfe-commits.

Issue a warning when the Objective C runtime encoding generated for an iVar, method, or block exceeds a user configurable value.

Off by default.

Note that handling iVars and methods will also get us properties.

Objective C runtime information can get very large (several K) and most of it is unused. Having the warning allows us to diagnose where the problem exists in our code.


Repository:
rC Clang

https://reviews.llvm.org/D55544

Files:
docs/ReleaseNotes.rst
include/clang/Basic/DiagnosticGroups.td
include/clang/Basic/DiagnosticSemaKinds.td
include/clang/Basic/LangOptions.def
include/clang/Driver/Options.td
include/clang/Sema/Sema.h
lib/Driver/ToolChains/Clang.cpp
lib/Frontend/CompilerInvocation.cpp
lib/Sema/SemaDeclObjC.cpp
lib/Sema/SemaExpr.cpp
test/SemaObjC/objc-large-encoding-warn.m
Stephane Moore via Phabricator via cfe-commits
2018-12-11 04:13:59 UTC
Permalink
stephanemoore added a comment.

FYI:
I have a clang-tidy check almost ready for review that aims to flag large Objective-C type encodings.



================
Comment at: include/clang/Basic/LangOptions.def:103
+BENIGN_LANGOPT(ObjCLargeEncodingSize, 32, 0,
+ "if non-zero, warn about Objective C encodings larger in bytes than this setting. 0 is no check.")
LANGOPT(AppExt , 1, 0, "Objective-C App Extension")
----------------
Objective-C


Repository:
rC Clang

CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D55544/new/

https://reviews.llvm.org/D55544

Loading...