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,
|
||||
llvm::StringRef inFile) override
|
||||
{
|
||||
compilerInstance.getPreprocessor().SetSuppressIncludeNotFoundError(true);
|
||||
compilerInstance.getLangOpts().DelayedTemplateParsing = false;
|
||||
|
||||
return WrapperFrontendAction::CreateASTConsumer(compilerInstance, inFile);
|
||||
}
|
||||
};
|
||||
|
@@ -25,6 +25,7 @@
|
||||
|
||||
#include "symbolscollector.h"
|
||||
|
||||
#include <clang/Frontend/CompilerInstance.h>
|
||||
#include <clang/Frontend/FrontendActions.h>
|
||||
|
||||
namespace ClangBackEnd {
|
||||
@@ -96,14 +97,26 @@ newFrontendActionFactory(Factory *consumerFactory,
|
||||
}
|
||||
|
||||
protected:
|
||||
bool BeginSourceFileAction(clang::CompilerInstance &CI) override {
|
||||
if (!clang::ASTFrontendAction::BeginSourceFileAction(CI))
|
||||
bool BeginInvocation(clang::CompilerInstance &compilerInstance) override
|
||||
{
|
||||
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;
|
||||
if (m_sourceFileCallbacks)
|
||||
return m_sourceFileCallbacks->handleBeginSource(CI);
|
||||
return m_sourceFileCallbacks->handleBeginSource(compilerInstance);
|
||||
return true;
|
||||
}
|
||||
void EndSourceFileAction() override {
|
||||
|
||||
void EndSourceFileAction() override
|
||||
{
|
||||
if (m_sourceFileCallbacks)
|
||||
m_sourceFileCallbacks->handleEndSource();
|
||||
clang::ASTFrontendAction::EndSourceFileAction();
|
||||
|
Reference in New Issue
Block a user