From 6ff25e20ec478fcb76148c062beef0ca8d88f897 Mon Sep 17 00:00:00 2001
Date: Mon, 17 May 2021 21:15:35 -0700
Subject: [PATCH 04/24] MacPorts Only: Fix name of scan-view executable inside
 scan-build

---
 clang/tools/scan-build/bin/scan-build | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/clang/tools/scan-build/bin/scan-build b/clang/tools/scan-build/bin/scan-build
index 645f5507b6fa..2eecc3b9a1dd 100755
--- a/clang/tools/scan-build/bin/scan-build
+++ b/clang/tools/scan-build/bin/scan-build
@@ -969,6 +969,8 @@ sub Finalize {
       if ($Options{ViewResults} and -r "$Options{OutputDir}/index.html") {
         Diag "Viewing analysis results in '$Options{OutputDir}' using scan-view.\n";
         my $ScanView = Cwd::realpath("$RealBin/scan-view");
+        if (! -x $ScanView) { $ScanView = Cwd::realpath("$RealBin/bin/scan-view"); }
+        if (! -x $ScanView) { $ScanView = Cwd::realpath("$RealBin/../scan-view/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; }
-- 
2.21.1 (Apple Git-122.3)

