@@ -733,7 +733,7 @@ public class ClangCompilerSpec : CompilerSpec, SpecIdentifierType, GCCCompatible
733733 } else if ClangSourceFileIndexingInfo . skippedArgsWithoutValues. contains ( argAsByteString) || arg. starts ( with: " -fbuild-session-file= " ) {
734734 // Relevant to indexing, so exclude arg from response file.
735735 regularCommandLine. append ( arg)
736- } else if isOutputAgnosticCCompilerArgument ( argAsByteString, prevArgument: previousArg) {
736+ } else if isOutputAgnosticCommandLineArgument ( argAsByteString, prevArgument: previousArg) {
737737 // Output agnostic, so exclude from response file.
738738 regularCommandLine. append ( arg)
739739 } else if precompNeutralFlagPatterns. map ( { $0. matches ( arg) } ) . reduce ( false , { $0 || $1 } ) && !( previousArg ?? " " ) . hasPrefix ( " -X " ) {
@@ -797,7 +797,7 @@ public class ClangCompilerSpec : CompilerSpec, SpecIdentifierType, GCCCompatible
797797 return fileType
798798 }
799799
800- static let outputAgnosticCCompilerArguments = Set < ByteString > ( [
800+ static let outputAgnosticCompilerArguments = Set < ByteString > ( [
801801 // https://clang.llvm.org/docs/UsersManual.html#formatting-of-diagnostics
802802 " -fshow-column " ,
803803 " -fno-show-column " ,
@@ -818,15 +818,15 @@ public class ClangCompilerSpec : CompilerSpec, SpecIdentifierType, GCCCompatible
818818 " -fdiagnostics-parseable-fixits " ,
819819 " -fno-elide-type " ,
820820 " -fdiagnostics-show-template-tree " ,
821- " -v " ,
821+
822822
823823 // https://clang.llvm.org/docs/ClangCommandLineReference.html
824824 " -fdiagnostics-show-note-include-stack " ,
825825 " -fno-diagnostics-show-note-include-stack " ,
826826 " -fmodules-validate-once-per-build-session " ,
827827 ] )
828828
829- static let outputAgnosticCCompilerArgumentPrefixes = Set < ByteString > ( [
829+ static let outputAgnosticCompilerArgumentPrefixes = Set < ByteString > ( [
830830 // https://clang.llvm.org/docs/UsersManual.html#formatting-of-diagnostics
831831 " -fdiagnostics-format= " ,
832832 " -fdiagnostics-show-category= " ,
@@ -838,22 +838,22 @@ public class ClangCompilerSpec : CompilerSpec, SpecIdentifierType, GCCCompatible
838838 " -fbuild-session-timestamp= " ,
839839 ] )
840840
841- static let outputAgnosticCCompilerArgumentsWithValues = Set < ByteString > ( [
841+ static let outputAgnosticCompilerArgumentsWithValues = Set < ByteString > ( [
842842 " -index-store-path " ,
843843 " -index-unit-output-path " ,
844844 ] )
845845
846- func isOutputAgnosticCCompilerArgument ( _ argument: ByteString , prevArgument: ByteString ? ) -> Bool {
847- if ClangCompilerSpec . outputAgnosticCCompilerArguments . contains ( argument) ||
848- ClangCompilerSpec . outputAgnosticCCompilerArgumentsWithValues . contains ( argument) {
846+ func isOutputAgnosticCommandLineArgument ( _ argument: ByteString , prevArgument: ByteString ? ) -> Bool {
847+ if ClangCompilerSpec . outputAgnosticCompilerArguments . contains ( argument) ||
848+ ClangCompilerSpec . outputAgnosticCompilerArgumentsWithValues . contains ( argument) {
849849 return true
850850 }
851851
852- if ClangCompilerSpec . outputAgnosticCCompilerArgumentPrefixes . first ( where: { argument. hasPrefix ( $0) } ) != nil {
852+ if ClangCompilerSpec . outputAgnosticCompilerArgumentPrefixes . first ( where: { argument. hasPrefix ( $0) } ) != nil {
853853 return true
854854 }
855855
856- if let prevArgument, ClangCompilerSpec . outputAgnosticCCompilerArgumentsWithValues . contains ( prevArgument) {
856+ if let prevArgument, ClangCompilerSpec . outputAgnosticCompilerArgumentsWithValues . contains ( prevArgument) {
857857 return true
858858 }
859859
@@ -869,7 +869,7 @@ public class ClangCompilerSpec : CompilerSpec, SpecIdentifierType, GCCCompatible
869869 return task. commandLine. indices. compactMap { index in
870870 let arg = task. commandLine [ index] . asByteString
871871 let prevArg = index > task. commandLine. startIndex ? task. commandLine [ index - 1 ] . asByteString : nil
872- if isOutputAgnosticCCompilerArgument ( arg, prevArgument: prevArg) {
872+ if isOutputAgnosticCommandLineArgument ( arg, prevArgument: prevArg) {
873873 return nil
874874 }
875875 return arg
0 commit comments