[clang] [clang][Modules] Respect case sensitivity when hashing implicit module map path (PR #226339)

Jan Svoboda via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 25 08:55:55 PDT 2026


================
@@ -283,13 +283,12 @@ ModuleFileName HeaderSearch::getCachedModuleFileNameImpl(
     // in the hash are safe (because any translation unit can only import one
     // module with each name), but result in a loss of caching.
     //
-    // To avoid false-negatives, we form as canonical a path as we can, and map
-    // to lower-case in case we're on a case-insensitive file system.
+    // To avoid false-negatives, we form as canonical a path as we can.
     SmallString<128> CanonicalPath(ModuleMapPath);
     if (getModuleMap().canonicalizeModuleMapPath(CanonicalPath))
       return {};
 
-    auto Hash = llvm::xxh3_64bits(CanonicalPath.str().lower());
+    auto Hash = llvm::xxh3_64bits(CanonicalPath.str());
----------------
jansvoboda11 wrote:

The conversion from `SmallString` to `StringRef` will be done implicitly.

```suggestion
    auto Hash = llvm::xxh3_64bits(CanonicalPath);
```

https://github.com/llvm/llvm-project/pull/226339


More information about the cfe-commits mailing list