mirror of
https://github.com/intel/llvm.git
synced 2026-01-24 08:30:34 +08:00
[analyzer] Turn inlining on by default for better testing exposure.
Fix a test, which was most likely an unintended recursive call. llvm-svn: 151848
This commit is contained in:
@@ -100,7 +100,7 @@ public:
|
||||
TrimGraph = 0;
|
||||
VisualizeEGDot = 0;
|
||||
VisualizeEGUbi = 0;
|
||||
InlineCall = 0;
|
||||
InlineCall = 1;
|
||||
UnoptimizedCFG = 0;
|
||||
CFGAddImplicitDtors = 0;
|
||||
CFGAddInitializers = 0;
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user