logic: reduce access to filesystem while indexing

* use canonical filepath cache in cxx indexer
* made constructors of FilePath explicit
* use FilePath at more places instead of string
* forward declares FilePath wherever possible
This commit is contained in:
malte_langkabel
2017-05-04 10:55:16 +02:00
parent 55d3f9c189
commit 054b8fab17
156 changed files with 656 additions and 444 deletions
@@ -767,8 +767,7 @@ bool CxxAstVisitorComponentIndexer::isLocatedInUnparsedProjectFile(clang::Source
const clang::FileEntry* fileEntry = sourceManager.getFileEntryForID(fileId);
if (fileEntry != NULL)
{
std::string fileName = fileEntry->getName();
FilePath filePath = FilePath(fileName).canonical();
FilePath filePath = getAstVisitor()->getCanonicalFilePathCache()->getValue(fileEntry->getName());
if (m_fileRegister->hasFilePath(filePath))
{
@@ -807,8 +806,8 @@ bool CxxAstVisitorComponentIndexer::isLocatedInProjectFile(clang::SourceLocation
if (fileEntry != NULL)
{
std::string fileName = fileEntry->getName();
FilePath filePath = FilePath(fileName).canonical();
bool ret = m_fileRegister->hasFilePath(filePath.str());
FilePath filePath = getAstVisitor()->getCanonicalFilePathCache()->getValue(fileName);
bool ret = m_fileRegister->hasFilePath(filePath);
m_inProjectFileMap[fileId] = ret;
return ret;
}