44
44
45
45
#include " llvm/ADT/SmallString.h"
46
46
#include " llvm/ADT/StringExtras.h"
47
- #include " llvm/ADT/StringSet.h"
48
47
#include " llvm/Bitcode/BitstreamWriter.h"
49
48
#include " llvm/Bitcode/RecordLayout.h"
50
49
#include " llvm/Config/config.h"
@@ -966,9 +965,7 @@ void Serializer::writeHeader(const SerializationOptions &options) {
966
965
options_block::SDKPathLayout SDKPath (Out);
967
966
options_block::XCCLayout XCC (Out);
968
967
969
- SDKPath.emit (ScratchRecord,
970
- options.DebugPrefixMap .remapPath (
971
- M->getASTContext ().SearchPathOpts .SDKPath ));
968
+ SDKPath.emit (ScratchRecord, M->getASTContext ().SearchPathOpts .SDKPath );
972
969
auto &Opts = options.ExtraClangOptions ;
973
970
for (auto Arg = Opts.begin (), E = Opts.end (); Arg != E; ++Arg) {
974
971
// FIXME: This is a hack and calls for a better design.
@@ -986,23 +983,6 @@ void Serializer::writeHeader(const SerializationOptions &options) {
986
983
continue ;
987
984
}
988
985
}
989
- // Remap the absolute working directory path that the driver adds to
990
- // the Clang arguments.
991
- if (StringRef (*Arg) == " -working-directory" ) {
992
- XCC.emit (ScratchRecord, *Arg);
993
- auto Next = std::next (Arg);
994
- if (Next != E) {
995
- XCC.emit (ScratchRecord, options.DebugPrefixMap .remapPath (*Next));
996
- ++Arg;
997
- continue ;
998
- }
999
- }
1000
- // Filter out any -fdebug-prefix-map flags, since they can't be
1001
- // meaningfully remapped. They're only needed during codegen, not when
1002
- // the module is loaded for debugging.
1003
- if (StringRef (*Arg).startswith (" -fdebug-prefix-map=" ))
1004
- continue ;
1005
-
1006
986
XCC.emit (ScratchRecord, *Arg);
1007
987
}
1008
988
}
@@ -1093,33 +1073,14 @@ void Serializer::writeInputBlock(const SerializationOptions &options) {
1093
1073
input_block::SearchPathLayout SearchPath (Out);
1094
1074
1095
1075
if (options.SerializeOptionsForDebugging ) {
1096
- // Remapping the paths can result in duplicates when the same path is passed
1097
- // to the compiler that is also loaded from an imported module; the
1098
- // compilation invocation will contain the unmapped path but the loaded
1099
- // module will have the remapped path. We uniquify the paths before writing
1100
- // to prevent this.
1101
- llvm::StringSet<> FrameworkPathsSeen;
1102
- llvm::StringSet<> ImportPathsSeen;
1103
-
1104
1076
const SearchPathOptions &searchPathOpts = M->getASTContext ().SearchPathOpts ;
1105
1077
// Put the framework search paths first so that they'll be preferred upon
1106
1078
// deserialization.
1107
- for (auto &framepath : searchPathOpts.FrameworkSearchPaths ) {
1108
- auto remapped = options.DebugPrefixMap .remapPath (framepath.Path );
1109
- if (FrameworkPathsSeen.find (remapped) == FrameworkPathsSeen.end ()) {
1110
- SearchPath.emit (ScratchRecord, /* framework=*/ true , framepath.IsSystem ,
1111
- remapped);
1112
- FrameworkPathsSeen.insert (remapped);
1113
- }
1114
- }
1115
- for (auto &path : searchPathOpts.ImportSearchPaths ) {
1116
- auto remapped = options.DebugPrefixMap .remapPath (path);
1117
- if (ImportPathsSeen.find (remapped) == ImportPathsSeen.end ()) {
1118
- SearchPath.emit (ScratchRecord, /* framework=*/ false , /* system=*/ false ,
1119
- remapped);
1120
- ImportPathsSeen.insert (remapped);
1121
- }
1122
- }
1079
+ for (auto &framepath : searchPathOpts.FrameworkSearchPaths )
1080
+ SearchPath.emit (ScratchRecord, /* framework=*/ true , framepath.IsSystem ,
1081
+ framepath.Path );
1082
+ for (auto &path : searchPathOpts.ImportSearchPaths )
1083
+ SearchPath.emit (ScratchRecord, /* framework=*/ false , /* system=*/ false , path);
1123
1084
}
1124
1085
1125
1086
// FIXME: Having to deal with private imports as a superset of public imports
0 commit comments