[clang][deps] Ensure deterministic filename case
The dependency scanner can reuse single FileManager instance across multiple translation units. This may lead to non-deterministic output depending on which TU gets processed first. One of the problems is that Clang uses DirectoryEntry::getName in the header search algorithm. This function returns the path that was first used to construct the (shared) entry in FileManager. Using DirectoryEntryRef::getName instead preserves the case as it was spelled out for the current "get directory entry" request. rdar://90647508 Reviewed By: dexonsmith Differential Revision: https://reviews.llvm.org/D123229
Showing
- clang/include/clang/Lex/DirectoryLookup.h 4 additions, 0 deletionsclang/include/clang/Lex/DirectoryLookup.h
- clang/lib/Lex/HeaderSearch.cpp 2 additions, 2 deletionsclang/lib/Lex/HeaderSearch.cpp
- clang/test/ClangScanDeps/header-search-case-sensitivity.c 50 additions, 0 deletionsclang/test/ClangScanDeps/header-search-case-sensitivity.c
Loading
Please register or sign in to comment