logic: multiple fixes and improvements

* showing project name in main window title
* keep reference count visible when maximizing code file
* show first node in db when no main function is available
* log Storage stats after parse
* fixed macro locations saved multiply
* using NameHierarchy when retrieving ids
This commit is contained in:
Eberhard Graether
2015-10-01 19:03:05 +02:00
parent 8fa9bdde5e
commit 2704d47cd8
28 changed files with 246 additions and 154 deletions
+1 -1
View File
@@ -28,7 +28,7 @@ public:
virtual ~Parser();
virtual void parseFiles(const std::vector<FilePath>& filePaths, const Arguments& arguments) = 0;
virtual void parseFile(std::shared_ptr<TextAccess> textAccess, const Arguments& arguments) = 0;
virtual void parseFile(const FilePath& filePath, std::shared_ptr<TextAccess> textAccess, const Arguments& arguments) = 0;
protected:
ParserClient* m_client;
+3 -1
View File
@@ -83,8 +83,10 @@ void CxxParser::parseFiles(const std::vector<FilePath>& filePaths, const Argumen
}
}
void CxxParser::parseFile(std::shared_ptr<TextAccess> textAccess, const Arguments& arguments)
void CxxParser::parseFile(const FilePath& filePath, std::shared_ptr<TextAccess> textAccess, const Arguments& arguments)
{
setupParsing(std::vector<FilePath>(1, filePath), arguments);
std::vector<std::string> args = getCommandlineArguments(arguments);
std::shared_ptr<CxxDiagnosticConsumer> diagnostics = getDiagnostics(arguments);
+1 -1
View File
@@ -24,7 +24,7 @@ public:
// ParserClient implementation
virtual void parseFiles(const std::vector<FilePath>& filePaths, const Arguments& arguments);
virtual void parseFile(std::shared_ptr<TextAccess> textAccess, const Arguments& arguments);
virtual void parseFile(const FilePath& filePath, std::shared_ptr<TextAccess> textAccess, const Arguments& arguments);
private:
std::vector<std::string> getCommandlineArguments(const Arguments& arguments) const;
@@ -57,7 +57,7 @@ void PreprocessorCallbacks::InclusionDirective(
const FileManager* fileManager = m_fileRegister->getFileManager();
if (fileManager->hasFilePath(baseFilePath) && fileManager->hasFilePath(includedFilePath) &&
!m_fileRegister->includeFileIsParsed(baseFilePath))
!m_fileRegister->fileIsParsed(baseFilePath))
{
m_client->onFileIncludeParsed(
getParseLocation(fileNameRange.getAsRange()),
@@ -77,7 +77,7 @@ void PreprocessorCallbacks::MacroDefined(const clang::Token& macroNameToken, con
}
FilePath filePath = FilePath(fileStr);
if (m_fileRegister->getFileManager()->hasFilePath(filePath) && !m_fileRegister->includeFileIsParsed(filePath))
if (m_fileRegister->getFileManager()->hasFilePath(filePath) && !m_fileRegister->fileIsParsed(filePath))
{
// ignore builtin macros
if (m_sourceManager.getSpellingLoc(macroNameToken.getLocation()).printToString(m_sourceManager)[0] == '<')
@@ -103,7 +103,7 @@ void PreprocessorCallbacks::MacroExpands(
}
FilePath filePath = FilePath(fileStr);
if (m_fileRegister->getFileManager()->hasFilePath(filePath) && !m_fileRegister->includeFileIsParsed(filePath))
if (m_fileRegister->getFileManager()->hasFilePath(filePath) && !m_fileRegister->fileIsParsed(filePath))
{
NameHierarchy nameHierarchy;
nameHierarchy.push(std::make_shared<NameElement>(macroNameToken.getIdentifierInfo()->getName().str()));