diff --git a/clang/tools/scan-build/libexec/ccc-analyzer b/clang/tools/scan-build/libexec/ccc-analyzer --- a/clang/tools/scan-build/libexec/ccc-analyzer +++ b/clang/tools/scan-build/libexec/ccc-analyzer @@ -188,12 +188,19 @@ my $mode = shift; my $Args = shift; my $line; + my $err = ""; my $OutputStream = silent_system($HtmlDir, $Clang, "-###", $mode, @$Args); while (<$OutputStream>) { + $err = $err . $_ if ($_ =~ /error:/); next if (!/\s"?-cc1"?\s/); $line = $_; } - die "could not find clang line\n" if (!defined $line); + if (!defined $line) { + print STDERR "could not find clang line\n"; + print STDERR "Please check errors\n"; + print STDERR $err; + exit 1 + } # Strip leading and trailing whitespace characters. $line =~ s/^\s+|\s+$//g; my @items = quotewords('\s+', 0, $line);