Mercurial > hg > CbC > CbC_llvm
comparison clang-tools-extra/clangd/FindTarget.cpp @ 252:1f2b6ac9f198 llvm-original
LLVM16-1
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 18 Aug 2023 09:04:13 +0900 |
parents | c4bab56944e8 |
children |
comparison
equal
deleted
inserted
replaced
237:c80f45b162ad | 252:1f2b6ac9f198 |
---|---|
286 } | 286 } |
287 void VisitDesignatedInitExpr(const DesignatedInitExpr *DIE) { | 287 void VisitDesignatedInitExpr(const DesignatedInitExpr *DIE) { |
288 for (const DesignatedInitExpr::Designator &D : | 288 for (const DesignatedInitExpr::Designator &D : |
289 llvm::reverse(DIE->designators())) | 289 llvm::reverse(DIE->designators())) |
290 if (D.isFieldDesignator()) { | 290 if (D.isFieldDesignator()) { |
291 Outer.add(D.getField(), Flags); | 291 Outer.add(D.getFieldDecl(), Flags); |
292 // We don't know which designator was intended, we assume the outer. | 292 // We don't know which designator was intended, we assume the outer. |
293 break; | 293 break; |
294 } | 294 } |
295 } | 295 } |
296 void VisitGotoStmt(const GotoStmt *Goto) { | 296 void VisitGotoStmt(const GotoStmt *Goto) { |
344 void VisitCXXNewExpr(const CXXNewExpr *CNE) { | 344 void VisitCXXNewExpr(const CXXNewExpr *CNE) { |
345 Outer.add(CNE->getOperatorNew(), Flags); | 345 Outer.add(CNE->getOperatorNew(), Flags); |
346 } | 346 } |
347 void VisitCXXDeleteExpr(const CXXDeleteExpr *CDE) { | 347 void VisitCXXDeleteExpr(const CXXDeleteExpr *CDE) { |
348 Outer.add(CDE->getOperatorDelete(), Flags); | 348 Outer.add(CDE->getOperatorDelete(), Flags); |
349 } | |
350 void | |
351 VisitCXXRewrittenBinaryOperator(const CXXRewrittenBinaryOperator *RBO) { | |
352 Outer.add(RBO->getDecomposedForm().InnerBinOp, Flags); | |
349 } | 353 } |
350 }; | 354 }; |
351 Visitor(*this, Flags).Visit(S); | 355 Visitor(*this, Flags).Visit(S); |
352 } | 356 } |
353 | 357 |
702 OCID->getLocation(), | 706 OCID->getLocation(), |
703 /*IsDecl=*/false, | 707 /*IsDecl=*/false, |
704 {OCID->getClassInterface()}}); | 708 {OCID->getClassInterface()}}); |
705 Refs.push_back(ReferenceLoc{NestedNameSpecifierLoc(), | 709 Refs.push_back(ReferenceLoc{NestedNameSpecifierLoc(), |
706 OCID->getCategoryNameLoc(), | 710 OCID->getCategoryNameLoc(), |
711 /*IsDecl=*/false, | |
712 {OCID->getCategoryDecl()}}); | |
713 Refs.push_back(ReferenceLoc{NestedNameSpecifierLoc(), | |
714 OCID->getCategoryNameLoc(), | |
707 /*IsDecl=*/true, | 715 /*IsDecl=*/true, |
708 {OCID->getCategoryDecl()}}); | 716 {OCID}}); |
717 } | |
718 | |
719 void VisitObjCImplementationDecl(const ObjCImplementationDecl *OIMD) { | |
720 Refs.push_back(ReferenceLoc{NestedNameSpecifierLoc(), | |
721 OIMD->getLocation(), | |
722 /*IsDecl=*/false, | |
723 {OIMD->getClassInterface()}}); | |
724 Refs.push_back(ReferenceLoc{NestedNameSpecifierLoc(), | |
725 OIMD->getLocation(), | |
726 /*IsDecl=*/true, | |
727 {OIMD}}); | |
709 } | 728 } |
710 }; | 729 }; |
711 | 730 |
712 Visitor V{Resolver}; | 731 Visitor V{Resolver}; |
713 V.Visit(D); | 732 V.Visit(D); |
806 continue; | 825 continue; |
807 | 826 |
808 Refs.push_back(ReferenceLoc{NestedNameSpecifierLoc(), | 827 Refs.push_back(ReferenceLoc{NestedNameSpecifierLoc(), |
809 D.getFieldLoc(), | 828 D.getFieldLoc(), |
810 /*IsDecl=*/false, | 829 /*IsDecl=*/false, |
811 {D.getField()}}); | 830 {D.getFieldDecl()}}); |
812 } | 831 } |
813 } | 832 } |
814 | 833 |
815 void VisitGotoStmt(const GotoStmt *GS) { | 834 void VisitGotoStmt(const GotoStmt *GS) { |
816 Refs.push_back(ReferenceLoc{NestedNameSpecifierLoc(), | 835 Refs.push_back(ReferenceLoc{NestedNameSpecifierLoc(), |
1042 bool TraverseConstructorInitializer(CXXCtorInitializer *Init) { | 1061 bool TraverseConstructorInitializer(CXXCtorInitializer *Init) { |
1043 visitNode(DynTypedNode::create(*Init)); | 1062 visitNode(DynTypedNode::create(*Init)); |
1044 return RecursiveASTVisitor::TraverseConstructorInitializer(Init); | 1063 return RecursiveASTVisitor::TraverseConstructorInitializer(Init); |
1045 } | 1064 } |
1046 | 1065 |
1066 bool TraverseTypeConstraint(const TypeConstraint *TC) { | |
1067 // We want to handle all ConceptReferences but RAV is missing a | |
1068 // polymorphic Visit or Traverse method for it, so we handle | |
1069 // TypeConstraints specially here. | |
1070 Out(ReferenceLoc{TC->getNestedNameSpecifierLoc(), | |
1071 TC->getConceptNameLoc(), | |
1072 /*IsDecl=*/false, | |
1073 {TC->getNamedConcept()}}); | |
1074 return RecursiveASTVisitor::TraverseTypeConstraint(TC); | |
1075 } | |
1076 | |
1047 private: | 1077 private: |
1048 /// Obtain information about a reference directly defined in \p N. Does not | 1078 /// Obtain information about a reference directly defined in \p N. Does not |
1049 /// recurse into child nodes, e.g. do not expect references for constructor | 1079 /// recurse into child nodes, e.g. do not expect references for constructor |
1050 /// initializers | 1080 /// initializers |
1051 /// | 1081 /// |