@@ -1199,10 +1199,12 @@ void Serializer::writeHeader() {
1199
1199
1200
1200
const auto &PathRemapper = Options.DebuggingOptionsPrefixMap ;
1201
1201
const auto &PathObfuscator = Options.PathObfuscator ;
1202
+ auto remapPath = [&PathRemapper, &PathObfuscator](StringRef Path) {
1203
+ return PathObfuscator.obfuscate (PathRemapper.remapPath (Path));
1204
+ };
1205
+
1202
1206
auto sdkPath = M->getASTContext ().SearchPathOpts .getSDKPath ();
1203
- SDKPath.emit (
1204
- ScratchRecord,
1205
- PathObfuscator.obfuscate (PathRemapper.remapPath (sdkPath)));
1207
+ SDKPath.emit (ScratchRecord, remapPath (sdkPath));
1206
1208
auto &Opts = Options.ExtraClangOptions ;
1207
1209
for (auto Arg = Opts.begin (), E = Opts.end (); Arg != E; ++Arg) {
1208
1210
StringRef arg (*Arg);
@@ -1246,28 +1248,28 @@ void Serializer::writeHeader() {
1246
1248
auto &opt = elem.get <PluginSearchOption::PluginPath>();
1247
1249
PluginSearchOpt.emit (ScratchRecord,
1248
1250
uint8_t (PluginSearchOptionKind::PluginPath),
1249
- opt.SearchPath );
1251
+ remapPath ( opt.SearchPath ) );
1250
1252
continue ;
1251
1253
}
1252
1254
case PluginSearchOption::Kind::ExternalPluginPath: {
1253
1255
auto &opt = elem.get <PluginSearchOption::ExternalPluginPath>();
1254
1256
PluginSearchOpt.emit (
1255
1257
ScratchRecord,
1256
1258
uint8_t (PluginSearchOptionKind::ExternalPluginPath),
1257
- opt.SearchPath + " #" + opt.ServerPath );
1259
+ remapPath ( opt.SearchPath ) + " #" + remapPath ( opt.ServerPath ) );
1258
1260
continue ;
1259
1261
}
1260
1262
case PluginSearchOption::Kind::LoadPluginLibrary: {
1261
1263
auto &opt = elem.get <PluginSearchOption::LoadPluginLibrary>();
1262
1264
PluginSearchOpt.emit (
1263
1265
ScratchRecord,
1264
1266
uint8_t (PluginSearchOptionKind::LoadPluginLibrary),
1265
- opt.LibraryPath );
1267
+ remapPath ( opt.LibraryPath ) );
1266
1268
continue ;
1267
1269
}
1268
1270
case PluginSearchOption::Kind::LoadPluginExecutable: {
1269
1271
auto &opt = elem.get <PluginSearchOption::LoadPluginExecutable>();
1270
- std::string optStr = opt.ExecutablePath + " #" ;
1272
+ std::string optStr = remapPath ( opt.ExecutablePath ) + " #" ;
1271
1273
llvm::interleave (
1272
1274
opt.ModuleNames , [&](auto &name) { optStr += name; },
1273
1275
[&]() { optStr += " ," ; });
@@ -1278,8 +1280,8 @@ void Serializer::writeHeader() {
1278
1280
}
1279
1281
case PluginSearchOption::Kind::ResolvedPluginConfig: {
1280
1282
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 ) + " #" ;
1283
1285
llvm::interleave (
1284
1286
opt.ModuleNames , [&](auto &name) { optStr += name; },
1285
1287
[&]() { optStr += " ," ; });
0 commit comments