summaryrefslogtreecommitdiffstats
path: root/clang/tools/scan-build
diff options
context:
space:
mode:
authorAnna Zaks <ganna@apple.com>2013-05-31 02:31:07 +0000
committerAnna Zaks <ganna@apple.com>2013-05-31 02:31:07 +0000
commit9f53c950df9d615d3ac917351b1391c65f580cb4 (patch)
tree6ac9872c86a056aa92d7858c63afa250aecad9ea /clang/tools/scan-build
parent7eb1d49a589d5b87cd097f74eba48481f99a02d2 (diff)
downloadbcm5719-llvm-9f53c950df9d615d3ac917351b1391c65f580cb4.tar.gz
bcm5719-llvm-9f53c950df9d615d3ac917351b1391c65f580cb4.zip
[analyzer] Add --override-compiler option to scan-build.
The new advanced option ensures ccc-analyze is used even when better interposition methods are available. llvm-svn: 182981
Diffstat (limited to 'clang/tools/scan-build')
-rwxr-xr-xclang/tools/scan-build/scan-build19
1 files changed, 19 insertions, 0 deletions
diff --git a/clang/tools/scan-build/scan-build b/clang/tools/scan-build/scan-build
index 803c0735110..22d5289586a 100755
--- a/clang/tools/scan-build/scan-build
+++ b/clang/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 =~ /^-/);
OpenPOWER on IntegriCloud