[PATCH] D89481: [scan-build] Fix clang++ pathname again

Stephan Bergmann via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 2 23:18:05 PST 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rG7a5184ed951a: [scan-build] Fix clang++ pathname again (authored by sberg).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D89481/new/

https://reviews.llvm.org/D89481

Files:
  clang/test/Analysis/scan-build/cxx-name.test
  clang/test/Analysis/scan-build/lit.local.cfg
  clang/tools/scan-build/bin/scan-build


Index: clang/tools/scan-build/bin/scan-build
===================================================================
--- clang/tools/scan-build/bin/scan-build
+++ clang/tools/scan-build/bin/scan-build
@@ -1925,7 +1925,7 @@
     $ClangCXX =~ s/.exe$/++.exe/;
   }
   else {
-    $ClangCXX =~ s/\-\d+\.\d+$//;
+    $ClangCXX =~ s/\-\d+(\.\d+)?$//;
     $ClangCXX .= "++";
   }
 }
Index: clang/test/Analysis/scan-build/lit.local.cfg
===================================================================
--- clang/test/Analysis/scan-build/lit.local.cfg
+++ clang/test/Analysis/scan-build/lit.local.cfg
@@ -15,4 +15,4 @@
                                                     'tools',
                                                     'scan-build',
                                                     'bin')),
-                                 config.clang)))
+                                 os.path.realpath(config.clang))))
Index: clang/test/Analysis/scan-build/cxx-name.test
===================================================================
--- /dev/null
+++ clang/test/Analysis/scan-build/cxx-name.test
@@ -0,0 +1,9 @@
+REQUIRES: shell
+
+RUN: %scan-build sh -c 'echo "CLANG_CXX=/$(basename "$CLANG_CXX")/"' | FileCheck %s
+
+Check that scan-build sets the CLANG_CXX environment variable (meant to be
+consumed by ccc-analyzer) to an appropriate pathname for the clang++ executable,
+derived from the pathname of the clang executable:
+
+CHECK: CLANG_CXX=/clang++{{(\.exe)?}}/


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D89481.302470.patch
Type: text/x-patch
Size: 1476 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20201103/2319cb75/attachment.bin>


More information about the cfe-commits mailing list