Clang: Use the clang indexer for indexing

It is not removing so much code but will makes somethings easier in the
future. We added the SymbolType::Definition too.

Change-Id: I4e106b8518e6bfed0c6a4aa6be61c4a5fe5f8bef
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
This commit is contained in:
Marco Bubke
2018-03-22 13:57:03 +01:00
parent 41a12410e6
commit 576eb3370c
11 changed files with 247 additions and 190 deletions

View File

@@ -25,15 +25,16 @@
#include "collectsymbolsaction.h"
#include "collectsymbolsconsumer.h"
#include <clang/Frontend/CompilerInstance.h>
namespace ClangBackEnd {
std::unique_ptr<clang::ASTConsumer> CollectSymbolsAction::newASTConsumer()
std::unique_ptr<clang::ASTConsumer> CollectSymbolsAction::newASTConsumer(
clang::CompilerInstance &compilerInstance,
llvm::StringRef inFile)
{
return std::make_unique<CollectSymbolsConsumer>(m_symbolEntries,
m_sourceLocationEntries,
m_filePathCache);
m_indexDataConsumer->setSourceManager(&compilerInstance.getSourceManager());
return m_action.CreateASTConsumer(compilerInstance, inFile);
}
} // namespace ClangBackEnd