Clang: Fix build with clang-8

Clang-Tidy checks and Clazy flags updated.
CLANG-UPGRADE-CHECK done.

Change-Id: I1ca585c5c3c77a7f183719df9c262603150914e8
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
This commit is contained in:
Ivan Donchevskii
2019-04-04 14:50:10 +02:00
parent db89e78c63
commit 53c407bc0c
20 changed files with 117 additions and 95 deletions

View File

@@ -25,6 +25,8 @@
#pragma once
#include "clangrefactoringbackend_global.h"
#include <clang/AST/AST.h>
#include <clang/AST/ASTContext.h>
#include <clang/AST/RecursiveASTVisitor.h>
@@ -161,7 +163,7 @@ std::vector<const clang::NamedDecl *> namedDeclarationsAt(const clang::ASTContex
auto declarations = Context.getTranslationUnitDecl()->decls();
for (auto &currentDeclation : declarations) {
const auto &fileLocation = currentDeclation->getLocStart();
const auto &fileLocation = currentDeclation->getBeginLoc();
const auto &fileName = sourceManager.getFilename(fileLocation);
if (fileName == currentFile) {
visitor.TraverseDecl(currentDeclation);

View File

@@ -92,8 +92,9 @@ newFrontendActionFactory(Factory *consumerFactory,
m_sourceFileCallbacks(sourceFileCallbacks)
{}
std::unique_ptr<clang::ASTConsumer>
CreateASTConsumer(clang::CompilerInstance &instance, StringRef inFile) override {
std::unique_ptr<clang::ASTConsumer> CreateASTConsumer(clang::CompilerInstance &instance,
llvm::StringRef inFile) override
{
return m_consumerFactory->newASTConsumer(instance, inFile);
}