From: Anna Zaks Date: Fri, 31 May 2013 02:31:07 +0000 (+0000) Subject: [analyzer] Add --override-compiler option to scan-build. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3ee2ad876a7ffc093cecb220916b0cfa1b4cc3c3;p=clang [analyzer] Add --override-compiler option to scan-build. The new advanced option ensures ccc-analyze is used even when better interposition methods are available. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182981 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/tools/scan-build/scan-build b/tools/scan-build/scan-build index 803c073511..22d5289586 100755 --- a/tools/scan-build/scan-build +++ b/tools/scan-build/scan-build @@ -896,6 +896,9 @@ sub SetEnv { } } +# The flag corresponding to the --override-compiler command line option. +my $OverrideCompiler = 0; + sub RunXcodebuild { my $Args = shift; my $IgnoreErrors = shift; @@ -928,6 +931,12 @@ sub RunXcodebuild { } close(DETECT_XCODE); + # If --override-compiler is explicitely requested, resort to the old + # behavior regardless of Xcode version. + if ($OverrideCompiler) { + $oldBehavior = 1; + } + if ($oldBehavior == 0) { my $OutputDir = $Options->{"OUTPUT_DIR"}; my $CLANG = $Options->{"CLANG"}; @@ -1143,6 +1152,10 @@ ADVANCED OPTIONS: Don't remove the build results directory even if no issues were reported. + --override-compiler + Always resort to the ccc-analyzer even when better interposition methods + are available. + CONTROLLING CHECKERS: A default group of checkers are always run unless explicitly disabled. @@ -1506,6 +1519,12 @@ while (@ARGV) { $KeepEmpty = 1; next; } + + if ($arg eq "--override-compiler") { + shift @ARGV; + $OverrideCompiler = 1; + next; + } DieDiag("unrecognized option '$arg'\n") if ($arg =~ /^-/);