[PATCH] D66569: [analyzer] ccc-analyzer: handle --sysroot=/path in addition to --sysroot /path

Phabricator via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 4 17:43:32 PDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL371002: [analyzer] scan-build: handle --sysroot=/path in addition to --sysroot /path. (authored by dergachev, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D66569?vs=216524&id=218817#toc

Repository:
  rL LLVM

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

https://reviews.llvm.org/D66569

Files:
  cfe/trunk/tools/scan-build/libexec/ccc-analyzer


Index: cfe/trunk/tools/scan-build/libexec/ccc-analyzer
===================================================================
--- cfe/trunk/tools/scan-build/libexec/ccc-analyzer
+++ cfe/trunk/tools/scan-build/libexec/ccc-analyzer
@@ -498,7 +498,8 @@
 # Process the arguments.
 foreach (my $i = 0; $i < scalar(@ARGV); ++$i) {
   my $Arg = $ARGV[$i];
-  my ($ArgKey) = split /=/,$Arg,2;
+  my @ArgParts = split /=/,$Arg,2;
+  my $ArgKey = @ArgParts[0];
 
   # Be friendly to "" in the argument list.
   if (!defined($ArgKey)) {
@@ -566,10 +567,12 @@
     push @CompileOpts,$Arg;
     push @LinkOpts,$Arg;
 
-    while ($Cnt > 0) {
-      ++$i; --$Cnt;
-      push @CompileOpts, $ARGV[$i];
-      push @LinkOpts, $ARGV[$i];
+    if (scalar @ArgParts == 1) {
+      while ($Cnt > 0) {
+        ++$i; --$Cnt;
+        push @CompileOpts, $ARGV[$i];
+        push @LinkOpts, $ARGV[$i];
+      }
     }
     next;
   }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D66569.218817.patch
Type: text/x-patch
Size: 908 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190905/b9c8f546/attachment.bin>


More information about the cfe-commits mailing list