build: update source code to use Clang 5.0
This commit is contained in:
@@ -32,14 +32,13 @@ public:
|
||||
virtual ~ASTAction() {}
|
||||
|
||||
protected:
|
||||
virtual std::unique_ptr<clang::ASTConsumer> CreateASTConsumer(clang::CompilerInstance& compiler, llvm::StringRef inFile)
|
||||
virtual std::unique_ptr<clang::ASTConsumer> CreateASTConsumer(clang::CompilerInstance& compiler, llvm::StringRef inFile) override
|
||||
{
|
||||
// return std::make_unique<clang::ASTConsumer>(&compiler.getASTContext(), &compiler.getPreprocessor(), m_client, m_fileRegister, m_canonicalFilePathCache);
|
||||
return std::unique_ptr<clang::ASTConsumer>(
|
||||
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(
|
||||
|
||||
@@ -21,7 +21,7 @@ public:
|
||||
|
||||
virtual ~ASTActionFactory();
|
||||
|
||||
virtual clang::FrontendAction* create();
|
||||
virtual clang::FrontendAction* create() override;
|
||||
|
||||
private:
|
||||
std::shared_ptr<ParserClient> m_client;
|
||||
|
||||
@@ -24,7 +24,7 @@ public:
|
||||
|
||||
virtual ~ASTConsumer();
|
||||
|
||||
virtual void HandleTranslationUnit(clang::ASTContext& context);
|
||||
virtual void HandleTranslationUnit(clang::ASTContext& context) override;
|
||||
|
||||
private:
|
||||
std::shared_ptr<CxxAstVisitor> m_visitor;
|
||||
|
||||
@@ -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<ParserClient> m_client;
|
||||
|
||||
@@ -11,7 +11,6 @@ CxxAstVisitorComponentImplicitCode::~CxxAstVisitorComponentImplicitCode()
|
||||
|
||||
bool CxxAstVisitorComponentImplicitCode::shouldVisitImplicitCode() const
|
||||
{
|
||||
// return false;
|
||||
if (!m_stack.empty())
|
||||
{
|
||||
return m_stack.back();
|
||||
|
||||
@@ -209,8 +209,9 @@ std::shared_ptr<clang::tooling::FixedCompilationDatabase> CxxParser::getCompilat
|
||||
argv[i] = args[i].c_str();
|
||||
}
|
||||
|
||||
std::string errorMessage;
|
||||
std::shared_ptr<clang::tooling::FixedCompilationDatabase> compilationDatabase(
|
||||
clang::tooling::FixedCompilationDatabase::loadFromCommandLine(argc, argv)
|
||||
clang::tooling::FixedCompilationDatabase::loadFromCommandLine(argc, argv, errorMessage)
|
||||
);
|
||||
|
||||
delete[] argv;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -27,27 +27,30 @@ public:
|
||||
std::shared_ptr<FilePathCache> 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);
|
||||
|
||||
Reference in New Issue
Block a user