diff --git a/src/lib_cxx/data/parser/cxx/ASTAction.h b/src/lib_cxx/data/parser/cxx/ASTAction.h index 64e4fb27..664f1742 100644 --- a/src/lib_cxx/data/parser/cxx/ASTAction.h +++ b/src/lib_cxx/data/parser/cxx/ASTAction.h @@ -32,14 +32,13 @@ public: virtual ~ASTAction() {} protected: - virtual std::unique_ptr CreateASTConsumer(clang::CompilerInstance& compiler, llvm::StringRef inFile) + virtual std::unique_ptr CreateASTConsumer(clang::CompilerInstance& compiler, llvm::StringRef inFile) override { -// return std::make_unique(&compiler.getASTContext(), &compiler.getPreprocessor(), m_client, m_fileRegister, m_canonicalFilePathCache); return std::unique_ptr( new ASTConsumer(&compiler.getASTContext(), &compiler.getPreprocessor(), m_client, m_fileRegister, m_canonicalFilePathCache)); } - virtual bool BeginSourceFileAction(clang::CompilerInstance& compiler, llvm::StringRef filePath) + virtual bool BeginSourceFileAction(clang::CompilerInstance& compiler) override { clang::Preprocessor& preprocessor = compiler.getPreprocessor(); preprocessor.addPPCallbacks( diff --git a/src/lib_cxx/data/parser/cxx/ASTActionFactory.h b/src/lib_cxx/data/parser/cxx/ASTActionFactory.h index 55a1a1eb..2a948a2d 100644 --- a/src/lib_cxx/data/parser/cxx/ASTActionFactory.h +++ b/src/lib_cxx/data/parser/cxx/ASTActionFactory.h @@ -21,7 +21,7 @@ public: virtual ~ASTActionFactory(); - virtual clang::FrontendAction* create(); + virtual clang::FrontendAction* create() override; private: std::shared_ptr m_client; diff --git a/src/lib_cxx/data/parser/cxx/ASTConsumer.h b/src/lib_cxx/data/parser/cxx/ASTConsumer.h index a114485b..d21a4d1d 100644 --- a/src/lib_cxx/data/parser/cxx/ASTConsumer.h +++ b/src/lib_cxx/data/parser/cxx/ASTConsumer.h @@ -24,7 +24,7 @@ public: virtual ~ASTConsumer(); - virtual void HandleTranslationUnit(clang::ASTContext& context); + virtual void HandleTranslationUnit(clang::ASTContext& context) override; private: std::shared_ptr m_visitor; diff --git a/src/lib_cxx/data/parser/cxx/CommentHandler.h b/src/lib_cxx/data/parser/cxx/CommentHandler.h index 0a3982ab..7ff05870 100644 --- a/src/lib_cxx/data/parser/cxx/CommentHandler.h +++ b/src/lib_cxx/data/parser/cxx/CommentHandler.h @@ -20,7 +20,7 @@ public: virtual ~CommentHandler(); - virtual bool HandleComment(clang::Preprocessor& preprocessor, clang::SourceRange sourceRange); + virtual bool HandleComment(clang::Preprocessor& preprocessor, clang::SourceRange sourceRange) override; private: std::shared_ptr m_client; diff --git a/src/lib_cxx/data/parser/cxx/CxxAstVisitorComponentImplicitCode.cpp b/src/lib_cxx/data/parser/cxx/CxxAstVisitorComponentImplicitCode.cpp index feaa7f56..91adcc4a 100644 --- a/src/lib_cxx/data/parser/cxx/CxxAstVisitorComponentImplicitCode.cpp +++ b/src/lib_cxx/data/parser/cxx/CxxAstVisitorComponentImplicitCode.cpp @@ -11,7 +11,6 @@ CxxAstVisitorComponentImplicitCode::~CxxAstVisitorComponentImplicitCode() bool CxxAstVisitorComponentImplicitCode::shouldVisitImplicitCode() const { -// return false; if (!m_stack.empty()) { return m_stack.back(); diff --git a/src/lib_cxx/data/parser/cxx/CxxParser.cpp b/src/lib_cxx/data/parser/cxx/CxxParser.cpp index 2b8bd093..3e7263a8 100644 --- a/src/lib_cxx/data/parser/cxx/CxxParser.cpp +++ b/src/lib_cxx/data/parser/cxx/CxxParser.cpp @@ -209,8 +209,9 @@ std::shared_ptr CxxParser::getCompilat argv[i] = args[i].c_str(); } + std::string errorMessage; std::shared_ptr compilationDatabase( - clang::tooling::FixedCompilationDatabase::loadFromCommandLine(argc, argv) + clang::tooling::FixedCompilationDatabase::loadFromCommandLine(argc, argv, errorMessage) ); delete[] argv; diff --git a/src/lib_cxx/data/parser/cxx/PreprocessorCallbacks.cpp b/src/lib_cxx/data/parser/cxx/PreprocessorCallbacks.cpp index 82a3f4fd..34e60e4e 100644 --- a/src/lib_cxx/data/parser/cxx/PreprocessorCallbacks.cpp +++ b/src/lib_cxx/data/parser/cxx/PreprocessorCallbacks.cpp @@ -100,7 +100,7 @@ void PreprocessorCallbacks::MacroDefined(const clang::Token& macroNameToken, con } void PreprocessorCallbacks::MacroUndefined( - const clang::Token& macroNameToken, const clang::MacroDefinition& macroDefinition) + const clang::Token& macroNameToken, const clang::MacroDefinition& macroDefinition, const clang::MacroDirective* macroUndefinition) { onMacroUsage(macroNameToken); } diff --git a/src/lib_cxx/data/parser/cxx/PreprocessorCallbacks.h b/src/lib_cxx/data/parser/cxx/PreprocessorCallbacks.h index 8ab22f41..23674923 100644 --- a/src/lib_cxx/data/parser/cxx/PreprocessorCallbacks.h +++ b/src/lib_cxx/data/parser/cxx/PreprocessorCallbacks.h @@ -27,27 +27,30 @@ public: std::shared_ptr canonicalFilePathCache); virtual void FileChanged( - clang::SourceLocation location, FileChangeReason reason, clang::SrcMgr::CharacteristicKind, clang::FileID); + clang::SourceLocation location, FileChangeReason reason, clang::SrcMgr::CharacteristicKind, clang::FileID) override; virtual void InclusionDirective( clang::SourceLocation hashLocation, const clang::Token& includeToken, llvm::StringRef fileName, bool isAngled, clang::CharSourceRange fileNameRange, const clang::FileEntry* fileEntry, llvm::StringRef searchPath, - llvm::StringRef relativePath, const clang::Module* imported); + llvm::StringRef relativePath, const clang::Module* imported) override; - virtual void MacroDefined(const clang::Token& macroNameToken, const clang::MacroDirective* macroDirective); - virtual void MacroUndefined(const clang::Token& macroNameToken, const clang::MacroDefinition& macroDefinition); + virtual void MacroDefined(const clang::Token& macroNameToken, const clang::MacroDirective* macroDirective) override; + virtual void MacroUndefined( + const clang::Token& macroNameToken, + const clang::MacroDefinition& macroDefinition, + const clang::MacroDirective* macroUndefinition) override; virtual void Defined( - const clang::Token& macroNameToken, const clang::MacroDefinition& macroDefinition, clang::SourceRange range); + const clang::Token& macroNameToken, const clang::MacroDefinition& macroDefinition, clang::SourceRange range) override; virtual void Ifdef(clang::SourceLocation location, const clang::Token& macroNameToken, - const clang::MacroDefinition& macroDefinition); + const clang::MacroDefinition& macroDefinition) override; virtual void Ifndef(clang::SourceLocation location, const clang::Token& macroNameToken, - const clang::MacroDefinition& macroDefinition); + const clang::MacroDefinition& macroDefinition) override; virtual void MacroExpands( const clang::Token& macroNameToken, const clang::MacroDefinition& macroDirective, clang::SourceRange range, const clang::MacroArgs* args - ); + ) override; private: void onMacroUsage(const clang::Token& macroNameToken);