@@ -63,6 +63,7 @@ sub SearchInPath {
63
63
}
64
64
65
65
my $Compiler ;
66
+ my @CompilerArgs ;
66
67
my $Clang ;
67
68
my $DefaultCCompiler ;
68
69
my $DefaultCXXCompiler ;
@@ -89,7 +90,7 @@ if (`uname -s` =~ m/Darwin/) {
89
90
}
90
91
91
92
if ($FindBin::Script =~ / c\+\+ -analyzer/ ) {
92
- $Compiler = $ENV {' CCC_CXX' };
93
+ ( $Compiler , @CompilerArgs ) = shellwords( $ENV {' CCC_CXX' }) ;
93
94
if (!defined $Compiler || (! -x $Compiler && ! SearchInPath($Compiler ))) { $Compiler = $DefaultCXXCompiler ; }
94
95
95
96
$Clang = $ENV {' CLANG_CXX' };
@@ -98,7 +99,7 @@ if ($FindBin::Script =~ /c\+\+-analyzer/) {
98
99
$IsCXX = 1
99
100
}
100
101
else {
101
- $Compiler = $ENV {' CCC_CC' };
102
+ ( $Compiler , @CompilerArgs ) = shellwords( $ENV {' CCC_CC' }) ;
102
103
if (!defined $Compiler || (! -x $Compiler && ! SearchInPath($Compiler ))) { $Compiler = $DefaultCCompiler ; }
103
104
104
105
$Clang = $ENV {' CLANG' };
@@ -199,7 +200,7 @@ sub GetCCArgs {
199
200
die " could not find clang line\n " if (!defined $line );
200
201
# Strip leading and trailing whitespace characters.
201
202
$line =~ s / ^\s +|\s +$// g ;
202
- my @items = quotewords( ' \s+ ' , 0, $line );
203
+ my @items = shellwords( $line );
203
204
my $cmd = shift @items ;
204
205
die " cannot find 'clang' in 'clang' command\n " if (!($cmd =~ / clang/ || basename($cmd ) =~ / llvm/ ));
205
206
# If this is the llvm-driver the internal command will look like "llvm clang ...".
@@ -462,9 +463,9 @@ my $Output;
462
463
my %Uniqued ;
463
464
464
465
# Forward arguments to gcc.
465
- my $Status = system ($Compiler ,@ARGV );
466
+ my $Status = system ($Compiler ,@CompilerArgs , @ ARGV );
466
467
if (defined $ENV {' CCC_ANALYZER_LOG' }) {
467
- print STDERR " $Compiler @ARGV \n " ;
468
+ print STDERR " $Compiler @CompilerArgs @ ARGV\n " ;
468
469
}
469
470
if ($Status ) { exit ($Status >> 8); }
470
471
0 commit comments