This patch concludes my GSoC'19 project by enabling track-conditions by default.
Differential Revision: https://reviews.llvm.org/D66381
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@369616
91177308-0d34-0410-b5e6-
96231b3b80d8
ANALYZER_OPTION(bool, ShouldTrackConditions, "track-conditions",
"Whether to track conditions that are a control dependency of "
"an already tracked variable.",
- false)
+ true)
ANALYZER_OPTION(bool, ShouldTrackConditionsDebug, "track-conditions-debug",
"Whether to place an event at each tracked condition.",
// CHECK-NEXT: suppress-c++-stdlib = true
// CHECK-NEXT: suppress-inlined-defensive-checks = true
// CHECK-NEXT: suppress-null-return-paths = true
-// CHECK-NEXT: track-conditions = false
+// CHECK-NEXT: track-conditions = true
// CHECK-NEXT: track-conditions-debug = false
// CHECK-NEXT: unix.DynamicMemoryModeling:Optimistic = false
// CHECK-NEXT: unroll-loops = false
return 0;
}
return 1; // expected-note{{Returning without writing to '*var'}}
+ // expected-note@-1{{Returning the value 1, which participates in a condition later}}
}
@end
// class-note@-1 {{The value 0 is assigned to 'F.Field'}}
return !MCAsmParser::Error();
// class-note@-1 {{'MCAsmParser::Error' returns true}}
+ // class-note@-2 {{Returning zero, which participates in a condition later}}
}
bool parseFile() {
struct MCAsmParser {
static bool Error() {
return false; // class-note {{'MCAsmParser::Error' returns false}}
+ // class-note@-1 {{Returning zero, which participates in a condition later}}
}
};
return MCAsmParser::Error();
// class-note@-1 {{Calling 'MCAsmParser::Error'}}
// class-note@-2 {{Returning from 'MCAsmParser::Error'}}
+ // class-note@-3 {{Returning zero, which participates in a condition later}}
}
bool parseFile() {
// RUN: not %clang_analyze_cc1 -verify %s \
// RUN: -analyzer-checker=core \
+// RUN: -analyzer-config track-conditions=false \
// RUN: -analyzer-config track-conditions-debug=true \
// RUN: 2>&1 | FileCheck %s -check-prefix=CHECK-INVALID-DEBUG
// RUN: %clang_analyze_cc1 %s -verify \
// RUN: -analyzer-output=text \
+// RUN: -analyzer-config track-conditions=false \
// RUN: -analyzer-checker=core
namespace example_1 {