logic: indexer and name resolving fixes

* made header and excluded filepaths of filemanager canonical
* implemented solving Attributed- and InjectedClassNameType
* handled clang returning null objects in NameResolvers
This commit is contained in:
malte_langkabel
2016-11-29 17:26:57 +01:00
parent b2358f581c
commit 328cf7e8cc
13 changed files with 542 additions and 472 deletions
+15
View File
@@ -1,5 +1,7 @@
#include "data/StorageProvider.h"
#include "utility/logging/logging.h"
int StorageProvider::getStorageCount() const
{
std::lock_guard<std::mutex> lock(m_storagesMutex);
@@ -57,5 +59,18 @@ std::shared_ptr<IntermediateStorage> StorageProvider::popInjectionSource()
return ret;
}
void StorageProvider::logCurrentState() const
{
std::string logString = "Storages waiting for injection:";
{
std::lock_guard<std::mutex> lock(m_storagesMutex);
for (std::shared_ptr<IntermediateStorage> storage: m_storages)
{
logString += " " + std::to_string(storage->getSourceLocationCount()) + ";";
}
}
LOG_INFO(logString);
}
+2
View File
@@ -18,6 +18,8 @@ public:
// returns empty shared_ptr if no storages available
std::shared_ptr<IntermediateStorage> popInjectionSource();
void logCurrentState() const;
private:
std::list<std::shared_ptr<IntermediateStorage>> m_storages; // larger storages are in front
mutable std::mutex m_storagesMutex;
+12 -2
View File
@@ -27,8 +27,8 @@ void FileManager::setPaths(
std::vector<std::string> sourceExtensions
){
m_sourcePaths = sourcePaths;
m_headerPaths = headerPaths;
m_excludePaths = excludePaths;
m_headerPaths = makeCanonical(headerPaths);
m_excludePaths = makeCanonical(excludePaths);
m_sourceExtensions = sourceExtensions;
}
@@ -159,6 +159,16 @@ const FileInfo FileManager::getFileInfo(const FilePath& filePath) const
return it->second;
}
std::vector<FilePath> FileManager::makeCanonical(const std::vector<FilePath>& filePaths)
{
std::vector<FilePath> ret;
for (const FilePath filePath: filePaths)
{
ret.push_back(filePath.canonical());
}
return ret;
}
bool FileManager::isExcluded(const FilePath& filePath) const
{
for (FilePath path : m_excludePaths)
+1
View File
@@ -34,6 +34,7 @@ public:
virtual const FileInfo getFileInfo(const FilePath& filePath) const;
private:
std::vector<FilePath> makeCanonical(const std::vector<FilePath>& filePaths);
bool isExcluded(const FilePath& filePath) const;
std::map<FilePath, FileInfo> m_files;