[PATCH] D101159: Show why clang analyzer could not be executed

Ramin Moussavi via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 23 06:25:54 PDT 2021


Ramin created this revision.
Ramin added a reviewer: clang-tools-extra.
Herald added subscribers: steakhal, ASDenysPetrov, dkrupp, donat.nagy, Szelethus, a.sidorin, baloghadamsoftware.
Ramin requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

when an unknown paramater is used when running scan-build

it just prints "could not find clang line"

this patch shows the error message


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D101159

Files:
  clang/tools/scan-build/libexec/ccc-analyzer


Index: clang/tools/scan-build/libexec/ccc-analyzer
===================================================================
--- clang/tools/scan-build/libexec/ccc-analyzer
+++ clang/tools/scan-build/libexec/ccc-analyzer
@@ -39,11 +39,19 @@
 
   # Invoke 'system', STDOUT and STDERR are output to a temporary file.
   system $Command, @_;
+  my $ret = $?;
 
   # Restore STDOUT and STDERR.
   open STDOUT, ">&", \*OLDOUT;
   open STDERR, ">&", \*OLDERR;
 
+  if ($ret != 0) {
+    print "failed to run $Command \n";
+    while(<$TmpFH>){
+       print $_;
+    }
+  }
+
   return $TmpFH;
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D101159.340000.patch
Type: text/x-patch
Size: 587 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210423/08fc24d2/attachment.bin>


More information about the cfe-commits mailing list