@@ -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 isOutputAgnosticCommandLineArgument ( argAsByteString, prevArgument: previousArg) {
736+ } else if isOutputAgnosticCCompilerArgument ( 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 outputAgnosticCompilerArguments = Set < ByteString > ( [
800+ static let outputAgnosticCCompilerArguments = Set < ByteString > ( [
801801 // https://clang.llvm.org/docs/UsersManual.html#formatting-of-diagnostics
802802 " -fshow-column " ,
803803 " -fno-show-column " ,
@@ -818,14 +818,15 @@ public class ClangCompilerSpec : CompilerSpec, SpecIdentifierType, GCCCompatible
818818 " -fdiagnostics-parseable-fixits " ,
819819 " -fno-elide-type " ,
820820 " -fdiagnostics-show-template-tree " ,
821+ " -v " ,
821822
822823 // https://clang.llvm.org/docs/ClangCommandLineReference.html
823824 " -fdiagnostics-show-note-include-stack " ,
824825 " -fno-diagnostics-show-note-include-stack " ,
825826 " -fmodules-validate-once-per-build-session " ,
826827 ] )
827828
828- static let outputAgnosticCompilerArgumentPrefixes = Set < ByteString > ( [
829+ static let outputAgnosticCCompilerArgumentPrefixes = Set < ByteString > ( [
829830 // https://clang.llvm.org/docs/UsersManual.html#formatting-of-diagnostics
830831 " -fdiagnostics-format= " ,
831832 " -fdiagnostics-show-category= " ,
@@ -837,22 +838,22 @@ public class ClangCompilerSpec : CompilerSpec, SpecIdentifierType, GCCCompatible
837838 " -fbuild-session-timestamp= " ,
838839 ] )
839840
840- static let outputAgnosticCompilerArgumentsWithValues = Set < ByteString > ( [
841+ static let outputAgnosticCCompilerArgumentsWithValues = Set < ByteString > ( [
841842 " -index-store-path " ,
842843 " -index-unit-output-path " ,
843844 ] )
844845
845- func isOutputAgnosticCommandLineArgument ( _ argument: ByteString , prevArgument: ByteString ? ) -> Bool {
846- if ClangCompilerSpec . outputAgnosticCompilerArguments . contains ( argument) ||
847- ClangCompilerSpec . outputAgnosticCompilerArgumentsWithValues . contains ( argument) {
846+ func isOutputAgnosticCCompilerArgument ( _ argument: ByteString , prevArgument: ByteString ? ) -> Bool {
847+ if ClangCompilerSpec . outputAgnosticCCompilerArguments . contains ( argument) ||
848+ ClangCompilerSpec . outputAgnosticCCompilerArgumentsWithValues . contains ( argument) {
848849 return true
849850 }
850851
851- if ClangCompilerSpec . outputAgnosticCompilerArgumentPrefixes . first ( where: { argument. hasPrefix ( $0) } ) != nil {
852+ if ClangCompilerSpec . outputAgnosticCCompilerArgumentPrefixes . first ( where: { argument. hasPrefix ( $0) } ) != nil {
852853 return true
853854 }
854855
855- if let prevArgument, ClangCompilerSpec . outputAgnosticCompilerArgumentsWithValues . contains ( prevArgument) {
856+ if let prevArgument, ClangCompilerSpec . outputAgnosticCCompilerArgumentsWithValues . contains ( prevArgument) {
856857 return true
857858 }
858859
@@ -868,7 +869,7 @@ public class ClangCompilerSpec : CompilerSpec, SpecIdentifierType, GCCCompatible
868869 return task. commandLine. indices. compactMap { index in
869870 let arg = task. commandLine [ index] . asByteString
870871 let prevArg = index > task. commandLine. startIndex ? task. commandLine [ index - 1 ] . asByteString : nil
871- if isOutputAgnosticCommandLineArgument ( arg, prevArgument: prevArg) {
872+ if isOutputAgnosticCCompilerArgument ( arg, prevArgument: prevArg) {
872873 return nil
873874 }
874875 return arg
0 commit comments