]> granicus.if.org Git - clang/commitdiff
[analyzer] Turn inlining on by default for better testing exposure.
authorAnna Zaks <ganna@apple.com>
Thu, 1 Mar 2012 22:37:46 +0000 (22:37 +0000)
committerAnna Zaks <ganna@apple.com>
Thu, 1 Mar 2012 22:37:46 +0000 (22:37 +0000)
Fix a test, which was most likely an unintended recursive call.

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

include/clang/Frontend/AnalyzerOptions.h
lib/Driver/Tools.cpp
lib/Frontend/CompilerInvocation.cpp
test/Analysis/misc-ps-region-store.m

index 66d0c37777817f3955e101a3ccb975c7315cc72e..8a1f4f0227349a6c2c352f5ecfbad3405db44505 100644 (file)
@@ -100,7 +100,7 @@ public:
     TrimGraph = 0;
     VisualizeEGDot = 0;
     VisualizeEGUbi = 0;
-    InlineCall = 0;
+    InlineCall = 1;
     UnoptimizedCFG = 0;
     CFGAddImplicitDtors = 0;
     CFGAddInitializers = 0;
index 1d77c5f1a84c473e3c4b2bbeab7ea193191acb4b..08af9f77cacab67d6850fce09069d418bd950996 100644 (file)
@@ -1339,6 +1339,8 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
 
     CmdArgs.push_back("-analyzer-eagerly-assume");
 
+    CmdArgs.push_back("-analyzer-inline-call");
+
     // Add default argument set.
     if (!Args.hasArg(options::OPT__analyzer_no_default_checks)) {
       CmdArgs.push_back("-analyzer-checker=core");
index d792dc7730f9d84a8807a7010a6b5d8e9a629d54..b0c03024acd539a6fea47a967ca2d4fef8e895e0 100644 (file)
@@ -1044,7 +1044,8 @@ static bool ParseAnalyzerArgs(AnalyzerOptions &Opts, ArgList &Args,
   Opts.MaxNodes = Args.getLastArgIntValue(OPT_analyzer_max_nodes, 150000,Diags);
   Opts.MaxLoop = Args.getLastArgIntValue(OPT_analyzer_max_loop, 4, Diags);
   Opts.EagerlyTrimEGraph = !Args.hasArg(OPT_analyzer_no_eagerly_trim_egraph);
-  Opts.InlineCall = Args.hasArg(OPT_analyzer_inline_call);
+  if (Args.hasArg(OPT_analyzer_inline_call))
+    Opts.InlineCall = 1;
   Opts.PrintStats = Args.hasArg(OPT_analyzer_stats);
 
   Opts.CheckersControlList.clear();
index c915263644bfa36f1e5dba40aa5d3c282eef378e..7268c909be855f560745b735925d8d05817a004b 100644 (file)
@@ -294,9 +294,11 @@ int test_invalidate_field_test_positive() {
 struct ArrayWrapper { unsigned char y[16]; };
 struct WrappedStruct { unsigned z; };
 
+void test_handle_array_wrapper_helper();
+
 int test_handle_array_wrapper() {
   struct ArrayWrapper x;
-  test_handle_array_wrapper(&x);
+  test_handle_array_wrapper_helper(&x);
   struct WrappedStruct *p = (struct WrappedStruct*) x.y; // expected-warning{{Casting a non-structure type to a structure type and accessing a field can lead to memory access errors or data corruption.}}
   return p->z;  // no-warning
 }