Make sure to pass the same options to the static analyzer as the

compiler.
 - Code generation options may still affect the language...

llvm-svn: 70393
This commit is contained in:
Daniel Dunbar 2009-04-29 18:32:25 +00:00
parent 156ed6c015
commit 44e7122151
2 changed files with 155 additions and 146 deletions

View File

@ -237,7 +237,8 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
// Add -Xanalyzer arguments when running as analyzer.
Args.AddAllArgValues(CmdArgs, options::OPT_Xanalyzer);
} else {
}
// Perform argument translation for LLVM backend. This
// takes some care in reconciling with llvm-gcc. The
// issue is that llvm-gcc translates these options based on
@ -385,7 +386,6 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
(Unsupported = Args.getLastArg(options::OPT_MQ)))
D.Diag(clang::diag::err_drv_unsupported_opt)
<< Unsupported->getOption().getName();
}
Args.AddAllArgs(CmdArgs, options::OPT_v);
Args.AddLastArg(CmdArgs, options::OPT_P);

View File

@ -0,0 +1,9 @@
// Verify that the analyzer gets the same flags as normal compilation
// (at least for a few key ones).
// RUN: clang -ccc-host-triple i386-apple-darwin9 -### --analyze -o /dev/null %s -msse 2> %t.log &&
// RUN: grep '"-analyze"' %t.log &&
// RUN: grep '"--fmath-errno=0"' %t.log &&
// RUN: grep '"--mattr" "+sse"' %t.log &&
// RUN: grep '"-mmacosx-version-min=10.5.0"' %t.log