@@ -710,9 +710,6 @@ class IndexDataConsumer : public index::IndexDataConsumer {
710710public:
711711 IndexDataConsumer (IndexParam ¶m) : param(param) {}
712712 void initialize (ASTContext &ctx) override { this ->ctx = param.ctx = &ctx; }
713- #if LLVM_VERSION_MAJOR < 10 // llvmorg-10-init-12036-g3b9715cb219
714- # define handleDeclOccurrence handleDeclOccurence
715- #endif
716713 bool handleDeclOccurrence (const Decl *d, index::SymbolRoleSet roles,
717714 ArrayRef<index::SymbolRelation> relations,
718715 SourceLocation src_loc,
@@ -899,31 +896,6 @@ class IndexDataConsumer : public index::IndexDataConsumer {
899896 if (!isa<EnumConstantDecl>(d))
900897 db->toType (usr1).instances .push_back (usr);
901898 } else if (const Decl *d1 = getAdjustedDecl (getTypeDecl (t))) {
902- #if LLVM_VERSION_MAJOR < 9
903- if (isa<TemplateTypeParmDecl>(d1)) {
904- // e.g. TemplateTypeParmDecl is not handled by
905- // handleDeclOccurence.
906- SourceRange sr1 = d1->getSourceRange ();
907- if (sm.getFileID (sr1.getBegin ()) == fid) {
908- IndexParam::DeclInfo *info1;
909- Usr usr1 = getUsr (d1, &info1);
910- IndexType &type1 = db->toType (usr1);
911- SourceLocation sl1 = d1->getLocation ();
912- type1.def .spell = {
913- Use{{fromTokenRange (sm, lang, {sl1, sl1}), Role::Definition},
914- lid},
915- fromTokenRange (sm, lang, sr1)};
916- type1.def .detailed_name = intern (info1->short_name );
917- type1.def .short_name_size = int16_t (info1->short_name .size ());
918- type1.def .kind = SymbolKind::TypeParameter;
919- type1.def .parent_kind = SymbolKind::Class;
920- var->def .type = usr1;
921- type1.instances .push_back (usr);
922- break ;
923- }
924- }
925- #endif
926-
927899 IndexParam::DeclInfo *info1;
928900 Usr usr1 = getUsr (d1, &info1);
929901 var->def .type = usr1;
@@ -1237,10 +1209,8 @@ class IndexFrontendAction : public ASTFrontendAction {
12371209 std::make_unique<IndexPPCallbacks>(pp->getSourceManager (), param));
12381210 std::vector<std::unique_ptr<ASTConsumer>> consumers;
12391211 consumers.push_back (std::make_unique<SkipProcessed>(param));
1240- #if LLVM_VERSION_MAJOR >= 10 // rC370337
12411212 consumers.push_back (index::createIndexingASTConsumer (
12421213 dataConsumer, indexOpts, std::move (pp)));
1243- #endif
12441214 return std::make_unique<MultiplexConsumer>(std::move (consumers));
12451215 }
12461216};
@@ -1349,12 +1319,7 @@ index(SemaManager *manager, WorkingFiles *wfiles, VFS *vfs,
13491319 if (!clang->hasTarget ())
13501320 return {};
13511321 clang->getPreprocessorOpts ().RetainRemappedFileBuffers = true ;
1352- #if LLVM_VERSION_MAJOR >= 9 // rC357037
13531322 clang->createFileManager (fs);
1354- #else
1355- clang->setVirtualFileSystem (fs);
1356- clang->createFileManager ();
1357- #endif
13581323 clang->setSourceManager (new SourceManager (clang->getDiagnostics (),
13591324 clang->getFileManager (), true ));
13601325
@@ -1366,39 +1331,23 @@ index(SemaManager *manager, WorkingFiles *wfiles, VFS *vfs,
13661331 if (no_linkage) {
13671332 indexOpts.IndexFunctionLocals = true ;
13681333 indexOpts.IndexImplicitInstantiation = true ;
1369- #if LLVM_VERSION_MAJOR >= 9
1370-
13711334 indexOpts.IndexParametersInDeclarations =
13721335 g_config->index .parametersInDeclarations ;
13731336 indexOpts.IndexTemplateParameters = true ;
1374- #endif
13751337 }
13761338
1377- #if LLVM_VERSION_MAJOR >= 10 // rC370337
13781339 auto action = std::make_unique<IndexFrontendAction>(
13791340 std::make_shared<IndexDataConsumer>(param), indexOpts, param);
1380- #else
1381- auto dataConsumer = std::make_shared<IndexDataConsumer>(param);
1382- auto action = createIndexingAction (
1383- dataConsumer, indexOpts,
1384- std::make_unique<IndexFrontendAction>(dataConsumer, indexOpts, param));
1385- #endif
1386-
13871341 std::string reason;
13881342 {
13891343 llvm::CrashRecoveryContext crc;
13901344 auto parse = [&]() {
13911345 if (!action->BeginSourceFile (*clang, clang->getFrontendOpts ().Inputs [0 ]))
13921346 return ;
1393- #if LLVM_VERSION_MAJOR >= 9 // rL364464
13941347 if (llvm::Error e = action->Execute ()) {
13951348 reason = llvm::toString (std::move (e));
13961349 return ;
13971350 }
1398- #else
1399- if (!action->Execute ())
1400- return ;
1401- #endif
14021351 action->EndSourceFile ();
14031352 ok = true ;
14041353 };
0 commit comments