[PATCH] D58529: [analyzer] MIGChecker: Enable by default.

Artem Dergachev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 21 15:48:38 PST 2019


NoQ created this revision.
NoQ added a reviewer: dcoughlin.
Herald added subscribers: cfe-commits, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, szepet, baloghadamsoftware, xazax.hun.
Herald added a project: clang.
NoQ added a comment.

The TODOs for future polishing are:

- Add a second `trackExpressionValue()` visitor to track argument values as they're copied around.
- Introduce annotations for deallocator functions so that we no longer had to hardcode them and users could annotate their consuming functions.


The checker has already proven to be fairly useful and wanted and doesn't have any known false positives, mostly because its positives are usually fairly local and there's no room for running into infeasible paths.


Repository:
  rC Clang

https://reviews.llvm.org/D58529

Files:
  clang/include/clang/StaticAnalyzer/Checkers/Checkers.td
  clang/test/Analysis/mig.mm


Index: clang/test/Analysis/mig.mm
===================================================================
--- clang/test/Analysis/mig.mm
+++ clang/test/Analysis/mig.mm
@@ -1,4 +1,4 @@
-// RUN: %clang_analyze_cc1 -w -analyzer-checker=core,alpha.osx.MIG\
+// RUN: %clang_analyze_cc1 -w -analyzer-checker=core,osx.MIG\
 // RUN:                       -analyzer-output=text -fblocks -verify %s
 
 typedef unsigned uint32_t;
Index: clang/include/clang/StaticAnalyzer/Checkers/Checkers.td
===================================================================
--- clang/include/clang/StaticAnalyzer/Checkers/Checkers.td
+++ clang/include/clang/StaticAnalyzer/Checkers/Checkers.td
@@ -703,6 +703,11 @@
   HelpText<"Check for proper uses of Secure Keychain APIs">,
   Documentation<HasDocumentation>;
 
+def MIGChecker : Checker<"MIG">,
+  HelpText<"Find violations of the Mach Interface Generator "
+           "calling convention">,
+  Documentation<NotDocumented>;
+
 def ObjCPropertyChecker : Checker<"ObjCProperty">,
   HelpText<"Check for proper uses of Objective-C properties">,
   Documentation<NotDocumented>;
@@ -811,15 +816,6 @@
   Documentation<NotDocumented>;
 } // end "optin.performance"
 
-let ParentPackage = OSXAlpha in {
-
-def MIGChecker : Checker<"MIG">,
-  HelpText<"Find violations of the Mach Interface Generator "
-           "calling convention">,
-  Documentation<NotDocumented>;
-
-} // end "alpha.osx"
-
 let ParentPackage = CocoaAlpha in {
 
 def IvarInvalidationModeling : Checker<"IvarInvalidationModeling">,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D58529.187880.patch
Type: text/x-patch
Size: 1525 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190221/2b883cae/attachment-0001.bin>


More information about the cfe-commits mailing list