@@ -1199,10 +1199,12 @@ void Serializer::writeHeader() {
11991199
12001200 const auto &PathRemapper = Options.DebuggingOptionsPrefixMap ;
12011201 const auto &PathObfuscator = Options.PathObfuscator ;
1202+ auto remapPath = [&PathRemapper, &PathObfuscator](StringRef Path) {
1203+ return PathObfuscator.obfuscate (PathRemapper.remapPath (Path));
1204+ };
1205+
12021206 auto sdkPath = M->getASTContext ().SearchPathOpts .getSDKPath ();
1203- SDKPath.emit (
1204- ScratchRecord,
1205- PathObfuscator.obfuscate (PathRemapper.remapPath (sdkPath)));
1207+ SDKPath.emit (ScratchRecord, remapPath (sdkPath));
12061208 auto &Opts = Options.ExtraClangOptions ;
12071209 for (auto Arg = Opts.begin (), E = Opts.end (); Arg != E; ++Arg) {
12081210 StringRef arg (*Arg);
@@ -1246,28 +1248,28 @@ void Serializer::writeHeader() {
12461248 auto &opt = elem.get <PluginSearchOption::PluginPath>();
12471249 PluginSearchOpt.emit (ScratchRecord,
12481250 uint8_t (PluginSearchOptionKind::PluginPath),
1249- opt.SearchPath );
1251+ remapPath ( opt.SearchPath ) );
12501252 continue ;
12511253 }
12521254 case PluginSearchOption::Kind::ExternalPluginPath: {
12531255 auto &opt = elem.get <PluginSearchOption::ExternalPluginPath>();
12541256 PluginSearchOpt.emit (
12551257 ScratchRecord,
12561258 uint8_t (PluginSearchOptionKind::ExternalPluginPath),
1257- opt.SearchPath + " #" + opt.ServerPath );
1259+ remapPath ( opt.SearchPath ) + " #" + remapPath ( opt.ServerPath ) );
12581260 continue ;
12591261 }
12601262 case PluginSearchOption::Kind::LoadPluginLibrary: {
12611263 auto &opt = elem.get <PluginSearchOption::LoadPluginLibrary>();
12621264 PluginSearchOpt.emit (
12631265 ScratchRecord,
12641266 uint8_t (PluginSearchOptionKind::LoadPluginLibrary),
1265- opt.LibraryPath );
1267+ remapPath ( opt.LibraryPath ) );
12661268 continue ;
12671269 }
12681270 case PluginSearchOption::Kind::LoadPluginExecutable: {
12691271 auto &opt = elem.get <PluginSearchOption::LoadPluginExecutable>();
1270- std::string optStr = opt.ExecutablePath + " #" ;
1272+ std::string optStr = remapPath ( opt.ExecutablePath ) + " #" ;
12711273 llvm::interleave (
12721274 opt.ModuleNames , [&](auto &name) { optStr += name; },
12731275 [&]() { optStr += " ," ; });
@@ -1278,8 +1280,8 @@ void Serializer::writeHeader() {
12781280 }
12791281 case PluginSearchOption::Kind::ResolvedPluginConfig: {
12801282 auto &opt = elem.get <PluginSearchOption::ResolvedPluginConfig>();
1281- std::string optStr =
1282- opt. LibraryPath + " # " + opt.ExecutablePath + " #" ;
1283+ std::string optStr = remapPath (opt. LibraryPath ) + " # " +
1284+ remapPath ( opt.ExecutablePath ) + " #" ;
12831285 llvm::interleave (
12841286 opt.ModuleNames , [&](auto &name) { optStr += name; },
12851287 [&]() { optStr += " ," ; });
0 commit comments