forked from qt-creator/qt-creator
ClangRefactoring: Move clang options to BeginInvocation
Change-Id: If4e90aa8e27b961026912bef3f0e81f972fbe0c7 Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
This commit is contained in:
@@ -66,9 +66,6 @@ private:
|
|||||||
CreateASTConsumer(clang::CompilerInstance &compilerInstance,
|
CreateASTConsumer(clang::CompilerInstance &compilerInstance,
|
||||||
llvm::StringRef inFile) override
|
llvm::StringRef inFile) override
|
||||||
{
|
{
|
||||||
compilerInstance.getPreprocessor().SetSuppressIncludeNotFoundError(true);
|
|
||||||
compilerInstance.getLangOpts().DelayedTemplateParsing = false;
|
|
||||||
|
|
||||||
return WrapperFrontendAction::CreateASTConsumer(compilerInstance, inFile);
|
return WrapperFrontendAction::CreateASTConsumer(compilerInstance, inFile);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@@ -25,6 +25,7 @@
|
|||||||
|
|
||||||
#include "symbolscollector.h"
|
#include "symbolscollector.h"
|
||||||
|
|
||||||
|
#include <clang/Frontend/CompilerInstance.h>
|
||||||
#include <clang/Frontend/FrontendActions.h>
|
#include <clang/Frontend/FrontendActions.h>
|
||||||
|
|
||||||
namespace ClangBackEnd {
|
namespace ClangBackEnd {
|
||||||
@@ -96,14 +97,26 @@ newFrontendActionFactory(Factory *consumerFactory,
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool BeginSourceFileAction(clang::CompilerInstance &CI) override {
|
bool BeginInvocation(clang::CompilerInstance &compilerInstance) override
|
||||||
if (!clang::ASTFrontendAction::BeginSourceFileAction(CI))
|
{
|
||||||
|
compilerInstance.getLangOpts().DelayedTemplateParsing = false;
|
||||||
|
|
||||||
|
return clang::ASTFrontendAction::BeginInvocation(compilerInstance);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool BeginSourceFileAction(clang::CompilerInstance &compilerInstance) override
|
||||||
|
{
|
||||||
|
compilerInstance.getPreprocessor().SetSuppressIncludeNotFoundError(true);
|
||||||
|
|
||||||
|
if (!clang::ASTFrontendAction::BeginSourceFileAction(compilerInstance))
|
||||||
return false;
|
return false;
|
||||||
if (m_sourceFileCallbacks)
|
if (m_sourceFileCallbacks)
|
||||||
return m_sourceFileCallbacks->handleBeginSource(CI);
|
return m_sourceFileCallbacks->handleBeginSource(compilerInstance);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
void EndSourceFileAction() override {
|
|
||||||
|
void EndSourceFileAction() override
|
||||||
|
{
|
||||||
if (m_sourceFileCallbacks)
|
if (m_sourceFileCallbacks)
|
||||||
m_sourceFileCallbacks->handleEndSource();
|
m_sourceFileCallbacks->handleEndSource();
|
||||||
clang::ASTFrontendAction::EndSourceFileAction();
|
clang::ASTFrontendAction::EndSourceFileAction();
|
||||||
|
Reference in New Issue
Block a user