]> granicus.if.org Git - clang/commitdiff
[Static Analyzer] Turn on some nullability checks by default.
authorGabor Horvath <xazax.hun@gmail.com>
Mon, 14 Sep 2015 20:34:06 +0000 (20:34 +0000)
committerGabor Horvath <xazax.hun@gmail.com>
Mon, 14 Sep 2015 20:34:06 +0000 (20:34 +0000)
Differential Revision: http://reviews.llvm.org/D12858

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247614 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/Tools.cpp

index 1b79ed730fa21882423312280a4a20673f13b76a..7a5368a5faf3f4023ae118ec5c6d9baef57932dc 100644 (file)
@@ -3322,6 +3322,11 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
       CmdArgs.push_back("-analyzer-checker=security.insecureAPI.mktemp");
       CmdArgs.push_back("-analyzer-checker=security.insecureAPI.mkstemp");
       CmdArgs.push_back("-analyzer-checker=security.insecureAPI.vfork");
+
+      // Default nullability checks.
+      CmdArgs.push_back("-analyzer-checker=nullability.NullPassedToNonnull");
+      CmdArgs.push_back(
+          "-analyzer-checker=nullability.NullReturnedFromNonnull");
     }
 
     // Set the output format. The default is plist, for (lame) historical