@@ -2367,18 +2367,17 @@ getInfoForUsedFileNames(const ModuleDecl *module) {
2367
2367
return result;
2368
2368
}
2369
2369
2370
- static void
2371
- computeMagicFileString (const ModuleDecl *module , StringRef name,
2372
- SmallVectorImpl<char > &result) {
2370
+ static void computeFileID (const ModuleDecl *module , StringRef name,
2371
+ SmallVectorImpl<char > &result) {
2373
2372
result.assign (module ->getNameStr ().begin (), module ->getNameStr ().end ());
2374
2373
result.push_back (' /' );
2375
2374
result.append (name.begin (), name.end ());
2376
2375
}
2377
2376
2378
2377
static StringRef
2379
- resolveMagicNameConflicts (const ModuleDecl *module , StringRef fileString,
2380
- const llvm::StringMap<SourceFilePathInfo> &paths,
2381
- bool shouldDiagnose) {
2378
+ resolveFileIDConflicts (const ModuleDecl *module , StringRef fileString,
2379
+ const llvm::StringMap<SourceFilePathInfo> &paths,
2380
+ bool shouldDiagnose) {
2382
2381
assert (paths.size () > 1 );
2383
2382
assert (module ->getASTContext ().LangOpts .EnableConcisePoundFile );
2384
2383
@@ -2437,15 +2436,15 @@ resolveMagicNameConflicts(const ModuleDecl *module, StringRef fileString,
2437
2436
}
2438
2437
2439
2438
llvm::StringMap<std::pair<std::string, bool >>
2440
- ModuleDecl::computeMagicFileStringMap (bool shouldDiagnose) const {
2439
+ ModuleDecl::computeFileIDMap (bool shouldDiagnose) const {
2441
2440
llvm::StringMap<std::pair<std::string, bool >> result;
2442
2441
SmallString<64 > scratch;
2443
2442
2444
2443
if (!getASTContext ().LangOpts .EnableConcisePoundFile )
2445
2444
return result;
2446
2445
2447
2446
for (auto &namePair : getInfoForUsedFileNames (this )) {
2448
- computeMagicFileString (this , namePair.first (), scratch);
2447
+ computeFileID (this , namePair.first (), scratch);
2449
2448
auto &infoForPaths = namePair.second ;
2450
2449
2451
2450
assert (!infoForPaths.empty ());
@@ -2455,8 +2454,8 @@ ModuleDecl::computeMagicFileStringMap(bool shouldDiagnose) const {
2455
2454
// will simply warn about conflicts.
2456
2455
StringRef winner = infoForPaths.begin ()->first ();
2457
2456
if (infoForPaths.size () > 1 )
2458
- winner = resolveMagicNameConflicts (this , scratch, infoForPaths,
2459
- shouldDiagnose);
2457
+ winner = resolveFileIDConflicts (this , scratch, infoForPaths,
2458
+ shouldDiagnose);
2460
2459
2461
2460
for (auto &pathPair : infoForPaths) {
2462
2461
result[pathPair.first ()] =
0 commit comments