data: Option to run only C/C++ preprocessor when indexing (issue 297)

* Added as checkbox to indexing start dialog
* Only shown for C/C++ projects
* Files will be marked incomplete
This commit is contained in:
Eberhard Graether
2017-04-18 22:11:20 +02:00
parent 2b24b88745
commit 63087913bd
31 changed files with 373 additions and 231 deletions
@@ -1,8 +1,13 @@
#include "data/parser/cxx/ASTActionFactory.h"
ASTActionFactory::ASTActionFactory(std::shared_ptr<ParserClient> client, std::shared_ptr<FileRegister> fileRegister)
#include "clang/Frontend/FrontendActions.h"
ASTActionFactory::ASTActionFactory(
std::shared_ptr<ParserClient> client, std::shared_ptr<FileRegister> fileRegister, bool preprocessorOnly
)
: m_client(client)
, m_fileRegister(fileRegister)
, m_preprocessorOnly(preprocessorOnly)
{
}
@@ -12,5 +17,12 @@ ASTActionFactory::~ASTActionFactory()
clang::FrontendAction* ASTActionFactory::create()
{
return new ASTAction(m_client, m_fileRegister);
if (m_preprocessorOnly)
{
return new ASTAction<clang::PreprocessOnlyAction>(m_client, m_fileRegister);
}
else
{
return new ASTAction<clang::ASTFrontendAction>(m_client, m_fileRegister);
}
}