[analyzer] Get scan-view executable from environment.

Fixes "Use of uninitialized value $ScanView in exec" error on systems
with scan-view executable not located in the expected place.

Patch by Oliver Tušla!

Differential Revision: https://reviews.llvm.org/D77880
This commit is contained in:
Artem Dergachev 2020-05-20 14:31:06 +03:00
parent 587f81f54a
commit 3f333e0af7
1 changed files with 1 additions and 0 deletions

View File

@ -971,6 +971,7 @@ sub Finalize {
my $ScanView = Cwd::realpath("$RealBin/scan-view");
if (! -x $ScanView) { $ScanView = "scan-view"; }
if (! -x $ScanView) { $ScanView = Cwd::realpath("$RealBin/../../scan-view/bin/scan-view"); }
if (! -x $ScanView) { $ScanView = `which scan-view`; chomp $ScanView; }
exec $ScanView, "$Options{OutputDir}";
}