@@ -893,39 +893,6 @@ static TypeIndex getStringIdTypeIdx(GlobalTypeTableBuilder &TypeTable,
893
893
return TypeTable.writeLeafType (SIR);
894
894
}
895
895
896
- // This just exists for backwards compatability for the deprecated MCTargetOptions::CommandLineArgs
897
- // It assumed a clang compiler frontend
898
- static std::string flattenCommandLine (ArrayRef<std::string> Args,
899
- StringRef MainFilename) {
900
- std::string FlatCmdLine;
901
- raw_string_ostream OS (FlatCmdLine);
902
- bool PrintedOneArg = false ;
903
- if (!StringRef (Args[0 ]).contains (" -cc1" )) {
904
- llvm::sys::printArg (OS, " -cc1" , /* Quote=*/ true );
905
- PrintedOneArg = true ;
906
- }
907
- for (unsigned i = 0 ; i < Args.size (); i++) {
908
- StringRef Arg = Args[i];
909
- if (Arg.empty ())
910
- continue ;
911
- if (Arg == " -main-file-name" || Arg == " -o" ) {
912
- i++; // Skip this argument and next one.
913
- continue ;
914
- }
915
- if (Arg.starts_with (" -object-file-name" ) || Arg == MainFilename)
916
- continue ;
917
- // Skip fmessage-length for reproduciability.
918
- if (Arg.starts_with (" -fmessage-length" ))
919
- continue ;
920
- if (PrintedOneArg)
921
- OS << " " ;
922
- llvm::sys::printArg (OS, Arg, /* Quote=*/ true );
923
- PrintedOneArg = true ;
924
- }
925
- OS.flush ();
926
- return FlatCmdLine;
927
- }
928
-
929
896
void CodeViewDebug::emitBuildInfo () {
930
897
// First, make LF_BUILDINFO. It's a sequence of strings with various bits of
931
898
// build info. The known prefix is:
@@ -949,20 +916,11 @@ void CodeViewDebug::emitBuildInfo() {
949
916
// FIXME: PDB is intentionally blank unless we implement /Zi type servers.
950
917
BuildInfoArgs[BuildInfoRecord::TypeServerPDB] =
951
918
getStringIdTypeIdx (TypeTable, " " );
952
- if (Asm->TM .Options .MCOptions .Argv0 != nullptr ) {
953
- BuildInfoArgs[BuildInfoRecord::BuildTool] =
954
- getStringIdTypeIdx (TypeTable, Asm->TM .Options .MCOptions .Argv0 );
919
+ BuildInfoArgs[BuildInfoRecord::BuildTool] =
920
+ getStringIdTypeIdx (TypeTable, Asm->TM .Options .MCOptions .Argv0 );
921
+ BuildInfoArgs[BuildInfoRecord::CommandLine] = getStringIdTypeIdx (
922
+ TypeTable, Asm->TM .Options .MCOptions .CommandlineArgs );
955
923
956
- if (!Asm->TM .Options .MCOptions .CommandlineArgsFlat .empty ()) {
957
- BuildInfoArgs[BuildInfoRecord::CommandLine] = getStringIdTypeIdx (
958
- TypeTable, Asm->TM .Options .MCOptions .CommandlineArgsFlat );
959
- } else {
960
- BuildInfoArgs[BuildInfoRecord::CommandLine] = getStringIdTypeIdx (
961
- TypeTable,
962
- flattenCommandLine (Asm->TM .Options .MCOptions .CommandLineArgs ,
963
- MainSourceFile->getFilename ()));
964
- }
965
- }
966
924
BuildInfoRecord BIR (BuildInfoArgs);
967
925
TypeIndex BuildInfoIndex = TypeTable.writeLeafType (BIR);
968
926
0 commit comments