Discard extra -isysroot options. This fixes:

<rdar://problem/6253141> Parser rejection occurs when command line has more than one -isysroot switch


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56790 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Ted Kremenek 2008-09-29 16:15:20 +00:00
Родитель 58df184ef9
Коммит a30730e5cd
1 изменённых файлов: 16 добавлений и 0 удалений

Просмотреть файл

@ -215,6 +215,10 @@ my %LangMap = (
'mi' => 'objective-c-cpp-output' 'mi' => 'objective-c-cpp-output'
); );
my %UniqueOptions = (
'-isysroot' => 0
);
##----------------------------------------------------------------------------## ##----------------------------------------------------------------------------##
# Main Logic. # Main Logic.
##----------------------------------------------------------------------------## ##----------------------------------------------------------------------------##
@ -225,6 +229,7 @@ my @LinkOpts;
my @Files; my @Files;
my $Lang; my $Lang;
my $Output; my $Output;
my %Uniqued;
# Forward arguments to gcc. # Forward arguments to gcc.
my $Status = system($CC,@ARGV); my $Status = system($CC,@ARGV);
@ -287,6 +292,17 @@ foreach (my $i = 0; $i < scalar(@ARGV); ++$i) {
my $Cnt = $CompilerLinkerOptionMap{$Arg}; my $Cnt = $CompilerLinkerOptionMap{$Arg};
push @CompileOpts,$Arg; push @CompileOpts,$Arg;
push @LinkOpts,$Arg; push @LinkOpts,$Arg;
# Check if this is an option that should have a unique value, and if so
# determine if the value was checked before.
if ($UniqueOptions{$Arg}) {
if (defined $Uniqued{$Arg}) {
$i += $Cnt;
next;
}
$Uniqued{$Arg} = 1;
}
while ($Cnt > 0) { while ($Cnt > 0) {
++$i; --$Cnt; ++$i; --$Cnt;
push @CompileOpts, $ARGV[$i]; push @CompileOpts, $ARGV[$i];