[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:
Anna Zaks
2012-03-01 22:37:46 +00:00
parent 5350c24509
commit d5c3027473
4 changed files with 8 additions and 3 deletions

View File

@@ -100,7 +100,7 @@ public:
TrimGraph = 0;
VisualizeEGDot = 0;
VisualizeEGUbi = 0;
InlineCall = 0;
InlineCall = 1;
UnoptimizedCFG = 0;
CFGAddImplicitDtors = 0;
CFGAddInitializers = 0;

View 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");

View 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();

View 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
}