llvm::sys::fs::equivalent() does 2 stat calls every time it's called. Use FileManager::getFile() to take advantage
of the stat caching that FileManager is providing.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176450
91177308-0d34-0410-b5e6-
96231b3b80d8
~ASTReader();
SourceManager &getSourceManager() const { return SourceMgr; }
+ FileManager &getFileManager() const { return FileMgr; }
/// \brief Flags that indicate what kind of AST loading failures the client
/// of the AST reader can directly handle.
return false;
// Determine whether the actual files are equivalent.
- bool Result = false;
- if (llvm::sys::fs::equivalent(a, b, Result))
- return false;
-
- return Result;
+ FileManager &FileMgr = Reader.getFileManager();
+ const FileEntry *FEA = FileMgr.getFile(a);
+ const FileEntry *FEB = FileMgr.getFile(b);
+ return (FEA && FEA == FEB);
}
std::pair<unsigned, unsigned>