forked from qt-creator/qt-creator
Clang: Fix build with clang 7.0
As an addition update the header with Clang-Tidy checks. Change-Id: Ib4a4d324e8cad95403a3e799e352205b05ed7475 Reviewed-by: Marco Bubke <marco.bubke@qt.io>
This commit is contained in:
@@ -95,7 +95,11 @@ public:
|
||||
const clang::FileEntry *file,
|
||||
llvm::StringRef /*searchPath*/,
|
||||
llvm::StringRef /*relativePath*/,
|
||||
const clang::Module * /*imported*/) override
|
||||
const clang::Module * /*imported*/
|
||||
#if LLVM_VERSION_MAJOR >= 7
|
||||
, clang::SrcMgr::CharacteristicKind /*fileType*/
|
||||
#endif
|
||||
) override
|
||||
{
|
||||
if (!m_skipInclude && file)
|
||||
addSourceDependency(file, hashLocation);
|
||||
|
||||
@@ -127,8 +127,12 @@ bool IndexDataConsumer::skipSymbol(clang::FileID fileId, clang::index::SymbolRol
|
||||
bool IndexDataConsumer::handleDeclOccurence(const clang::Decl *declaration,
|
||||
clang::index::SymbolRoleSet symbolRoles,
|
||||
llvm::ArrayRef<clang::index::SymbolRelation> symbolRelations,
|
||||
#if LLVM_VERSION_MAJOR >= 7
|
||||
clang::SourceLocation sourceLocation,
|
||||
#else
|
||||
clang::FileID fileId,
|
||||
unsigned offset,
|
||||
#endif
|
||||
IndexDataConsumer::ASTNodeInfo astNodeInfo)
|
||||
{
|
||||
const auto *namedDeclaration = clang::dyn_cast<clang::NamedDecl>(declaration);
|
||||
@@ -136,11 +140,17 @@ bool IndexDataConsumer::handleDeclOccurence(const clang::Decl *declaration,
|
||||
if (!namedDeclaration->getIdentifier())
|
||||
return true;
|
||||
|
||||
#if LLVM_VERSION_MAJOR >= 7
|
||||
if (skipSymbol(m_sourceManager->getFileID(sourceLocation), symbolRoles))
|
||||
#else
|
||||
if (skipSymbol(fileId, symbolRoles))
|
||||
#endif
|
||||
return true;
|
||||
|
||||
SymbolIndex globalId = toSymbolIndex(declaration->getCanonicalDecl());
|
||||
#if LLVM_VERSION_MAJOR < 7
|
||||
clang::SourceLocation sourceLocation = m_sourceManager->getLocForStartOfFile(fileId).getLocWithOffset(offset);
|
||||
#endif
|
||||
|
||||
auto found = m_symbolEntries.find(globalId);
|
||||
if (found == m_symbolEntries.end()) {
|
||||
|
||||
@@ -55,8 +55,12 @@ public:
|
||||
bool handleDeclOccurence(const clang::Decl *declaration,
|
||||
clang::index::SymbolRoleSet symbolRoles,
|
||||
llvm::ArrayRef<clang::index::SymbolRelation> symbolRelations,
|
||||
#if LLVM_VERSION_MAJOR >= 7
|
||||
clang::SourceLocation sourceLocation,
|
||||
#else
|
||||
clang::FileID fileId,
|
||||
unsigned offset,
|
||||
#endif
|
||||
ASTNodeInfo astNodeInfo) override;
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user