Refactoring: Fix unit tests

One if the LLVM 10 hot fixes was not working.

Change-Id: I1e6cab39ffd5c52f55fb83ff777f6eca457dea35
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
Marco Bubke
2020-06-13 16:06:33 +02:00
parent 36b72e2bab
commit c924a45fb2
10 changed files with 30 additions and 77 deletions

View File

@@ -48,11 +48,7 @@ class CollectSymbolsAction : public clang::WrapperFrontendAction
public:
CollectSymbolsAction(std::shared_ptr<IndexDataConsumer> indexDataConsumer)
: clang::WrapperFrontendAction(
clang::index::createIndexingAction(indexDataConsumer, createIndexingOptions()
#if LLVM_VERSION_MAJOR < 10
, nullptr
#endif
))
clang::index::createIndexingAction(indexDataConsumer, createIndexingOptions()))
, m_indexDataConsumer(indexDataConsumer)
{}

View File

@@ -118,11 +118,7 @@ bool IndexDataConsumer::isAlreadyParsed(clang::FileID fileId, SourcesManager &so
return sourcesManager.alreadyParsed(filePathId(fileEntry), fileEntry->getModificationTime());
}
#if LLVM_VERSION_MAJOR >= 10
bool IndexDataConsumer::handleDeclOccurrence(
#else
bool IndexDataConsumer::handleDeclOccurence(
#endif
const clang::Decl *declaration,
clang::index::SymbolRoleSet symbolRoles,
llvm::ArrayRef<clang::index::SymbolRelation> /*symbolRelations*/,
@@ -180,11 +176,7 @@ SourceLocationKind macroSymbolType(clang::index::SymbolRoleSet roles)
} // namespace
#if LLVM_VERSION_MAJOR >= 10
bool IndexDataConsumer::handleMacroOccurrence(
#else
bool IndexDataConsumer::handleMacroOccurence(
#endif
const clang::IdentifierInfo *identifierInfo,
const clang::MacroInfo *macroInfo,
clang::index::SymbolRoleSet roles,

View File

@@ -57,22 +57,14 @@ public:
IndexDataConsumer(const IndexDataConsumer &) = delete;
IndexDataConsumer &operator=(const IndexDataConsumer &) = delete;
#if LLVM_VERSION_MAJOR >= 10
bool handleDeclOccurrence(
#else
bool handleDeclOccurence(
#endif
const clang::Decl *declaration,
clang::index::SymbolRoleSet symbolRoles,
llvm::ArrayRef<clang::index::SymbolRelation> symbolRelations,
clang::SourceLocation sourceLocation,
ASTNodeInfo astNodeInfo) override;
#if LLVM_VERSION_MAJOR >= 10
bool handleMacroOccurrence(
#else
bool handleMacroOccurence(
#endif
const clang::IdentifierInfo *identifierInfo,
const clang::MacroInfo *macroInfo,
clang::index::SymbolRoleSet roles,

View File

@@ -74,11 +74,7 @@ std::unique_ptr<clang::tooling::FrontendActionFactory> newFrontendActionFactory(
: m_action(consumerFactory)
{}
#if LLVM_VERSION_MAJOR >= 10
std::unique_ptr<clang::FrontendAction> create() override { return std::make_unique<AdaptorAction>(m_action); }
#else
clang::FrontendAction *create() override { return new AdaptorAction(m_action); }
#endif
private:
class AdaptorAction : public clang::ASTFrontendAction