/Users/buildslave/jenkins/workspace/coverage/llvm-project/clang/include/clang/ExtractAPI/ExtractAPIVisitor.h
Line | Count | Source (jump to first uncovered line) |
1 | | //===- ExtractAPI/ExtractAPIVisitor.h ---------------------------*- C++ -*-===// |
2 | | // |
3 | | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
4 | | // See https://llvm.org/LICENSE.txt for license information. |
5 | | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
6 | | // |
7 | | //===----------------------------------------------------------------------===// |
8 | | /// |
9 | | /// \file |
10 | | /// This file defines the ExtractAPVisitor AST visitation interface. |
11 | | /// |
12 | | //===----------------------------------------------------------------------===// |
13 | | |
14 | | #ifndef LLVM_CLANG_EXTRACTAPI_EXTRACT_API_VISITOR_H |
15 | | #define LLVM_CLANG_EXTRACTAPI_EXTRACT_API_VISITOR_H |
16 | | |
17 | | #include "clang/AST/DeclCXX.h" |
18 | | #include "clang/AST/DeclTemplate.h" |
19 | | #include "clang/Basic/OperatorKinds.h" |
20 | | #include "clang/Basic/Specifiers.h" |
21 | | #include "clang/ExtractAPI/DeclarationFragments.h" |
22 | | #include "llvm/ADT/FunctionExtras.h" |
23 | | |
24 | | #include "clang/AST/ASTContext.h" |
25 | | #include "clang/AST/ParentMapContext.h" |
26 | | #include "clang/AST/RecursiveASTVisitor.h" |
27 | | #include "clang/Basic/SourceManager.h" |
28 | | #include "clang/ExtractAPI/API.h" |
29 | | #include "clang/ExtractAPI/TypedefUnderlyingTypeResolver.h" |
30 | | #include "clang/Index/USRGeneration.h" |
31 | | #include "llvm/ADT/StringRef.h" |
32 | | #include <type_traits> |
33 | | |
34 | | namespace clang { |
35 | | namespace extractapi { |
36 | | namespace impl { |
37 | | |
38 | | template <typename Derived> |
39 | | class ExtractAPIVisitorBase : public RecursiveASTVisitor<Derived> { |
40 | | protected: |
41 | | ExtractAPIVisitorBase(ASTContext &Context, APISet &API) |
42 | 75 | : Context(Context), API(API) {} ExtractAPIConsumer.cpp:clang::extractapi::impl::ExtractAPIVisitorBase<(anonymous namespace)::BatchExtractAPIVisitor>::ExtractAPIVisitorBase(clang::ASTContext&, clang::extractapi::APISet&) Line | Count | Source | 42 | 53 | : Context(Context), API(API) {} |
clang::extractapi::impl::ExtractAPIVisitorBase<clang::extractapi::ExtractAPIVisitor<void> >::ExtractAPIVisitorBase(clang::ASTContext&, clang::extractapi::APISet&) Line | Count | Source | 42 | 3 | : Context(Context), API(API) {} |
CXExtractAPI.cpp:clang::extractapi::impl::ExtractAPIVisitorBase<(anonymous namespace)::LibClangExtractAPIVisitor>::ExtractAPIVisitorBase(clang::ASTContext&, clang::extractapi::APISet&) Line | Count | Source | 42 | 19 | : Context(Context), API(API) {} |
|
43 | | |
44 | | public: |
45 | | const APISet &getAPI() const { return API; } |
46 | | |
47 | | bool VisitVarDecl(const VarDecl *Decl); |
48 | | |
49 | | bool VisitFunctionDecl(const FunctionDecl *Decl); |
50 | | |
51 | | bool VisitEnumDecl(const EnumDecl *Decl); |
52 | | |
53 | | bool WalkUpFromFunctionDecl(const FunctionDecl *Decl); |
54 | | |
55 | | bool WalkUpFromRecordDecl(const RecordDecl *Decl); |
56 | | |
57 | | bool WalkUpFromCXXRecordDecl(const CXXRecordDecl *Decl); |
58 | | |
59 | | bool WalkUpFromCXXMethodDecl(const CXXMethodDecl *Decl); |
60 | | |
61 | | bool WalkUpFromClassTemplateSpecializationDecl( |
62 | | const ClassTemplateSpecializationDecl *Decl); |
63 | | |
64 | | bool WalkUpFromClassTemplatePartialSpecializationDecl( |
65 | | const ClassTemplatePartialSpecializationDecl *Decl); |
66 | | |
67 | | bool WalkUpFromVarTemplateDecl(const VarTemplateDecl *Decl); |
68 | | |
69 | | bool WalkUpFromVarTemplateSpecializationDecl( |
70 | | const VarTemplateSpecializationDecl *Decl); |
71 | | |
72 | | bool WalkUpFromVarTemplatePartialSpecializationDecl( |
73 | | const VarTemplatePartialSpecializationDecl *Decl); |
74 | | |
75 | | bool WalkUpFromFunctionTemplateDecl(const FunctionTemplateDecl *Decl); |
76 | | |
77 | | bool WalkUpFromNamespaceDecl(const NamespaceDecl *Decl); |
78 | | |
79 | | bool VisitNamespaceDecl(const NamespaceDecl *Decl); |
80 | | |
81 | | bool VisitRecordDecl(const RecordDecl *Decl); |
82 | | |
83 | | bool VisitCXXRecordDecl(const CXXRecordDecl *Decl); |
84 | | |
85 | | bool VisitCXXMethodDecl(const CXXMethodDecl *Decl); |
86 | | |
87 | | bool VisitFieldDecl(const FieldDecl *Decl); |
88 | | |
89 | | bool VisitCXXConversionDecl(const CXXConversionDecl *Decl); |
90 | | |
91 | | bool VisitCXXConstructorDecl(const CXXConstructorDecl *Decl); |
92 | | |
93 | | bool VisitCXXDestructorDecl(const CXXDestructorDecl *Decl); |
94 | | |
95 | | bool VisitConceptDecl(const ConceptDecl *Decl); |
96 | | |
97 | | bool VisitClassTemplateSpecializationDecl( |
98 | | const ClassTemplateSpecializationDecl *Decl); |
99 | | |
100 | | bool VisitClassTemplatePartialSpecializationDecl( |
101 | | const ClassTemplatePartialSpecializationDecl *Decl); |
102 | | |
103 | | bool VisitVarTemplateDecl(const VarTemplateDecl *Decl); |
104 | | |
105 | | bool |
106 | | VisitVarTemplateSpecializationDecl(const VarTemplateSpecializationDecl *Decl); |
107 | | |
108 | | bool VisitVarTemplatePartialSpecializationDecl( |
109 | | const VarTemplatePartialSpecializationDecl *Decl); |
110 | | |
111 | | bool VisitFunctionTemplateDecl(const FunctionTemplateDecl *Decl); |
112 | | |
113 | | bool VisitObjCInterfaceDecl(const ObjCInterfaceDecl *Decl); |
114 | | |
115 | | bool VisitObjCProtocolDecl(const ObjCProtocolDecl *Decl); |
116 | | |
117 | | bool VisitTypedefNameDecl(const TypedefNameDecl *Decl); |
118 | | |
119 | | bool VisitObjCCategoryDecl(const ObjCCategoryDecl *Decl); |
120 | | |
121 | | bool shouldDeclBeIncluded(const Decl *Decl) const; |
122 | | |
123 | | const RawComment *fetchRawCommentForDecl(const Decl *Decl) const; |
124 | | |
125 | | protected: |
126 | | /// Collect API information for the enum constants and associate with the |
127 | | /// parent enum. |
128 | | void recordEnumConstants(EnumRecord *EnumRecord, |
129 | | const EnumDecl::enumerator_range Constants); |
130 | | |
131 | | /// Collect API information for the struct fields and associate with the |
132 | | /// parent struct. |
133 | | void recordStructFields(StructRecord *StructRecord, |
134 | | const RecordDecl::field_range Fields); |
135 | | |
136 | | /// Collect API information for the Objective-C methods and associate with the |
137 | | /// parent container. |
138 | | void recordObjCMethods(ObjCContainerRecord *Container, |
139 | | const ObjCContainerDecl::method_range Methods); |
140 | | |
141 | | void recordObjCProperties(ObjCContainerRecord *Container, |
142 | | const ObjCContainerDecl::prop_range Properties); |
143 | | |
144 | | void recordObjCInstanceVariables( |
145 | | ObjCContainerRecord *Container, |
146 | | const llvm::iterator_range< |
147 | | DeclContext::specific_decl_iterator<ObjCIvarDecl>> |
148 | | Ivars); |
149 | | |
150 | | void recordObjCProtocols(ObjCContainerRecord *Container, |
151 | | ObjCInterfaceDecl::protocol_range Protocols); |
152 | | |
153 | | ASTContext &Context; |
154 | | APISet &API; |
155 | | |
156 | 7 | StringRef getTypedefName(const TagDecl *Decl) { |
157 | 7 | if (const auto *TypedefDecl = Decl->getTypedefNameForAnonDecl()) |
158 | 3 | return TypedefDecl->getName(); |
159 | | |
160 | 4 | return {}; |
161 | 7 | } ExtractAPIConsumer.cpp:clang::extractapi::impl::ExtractAPIVisitorBase<(anonymous namespace)::BatchExtractAPIVisitor>::getTypedefName(clang::TagDecl const*) Line | Count | Source | 156 | 7 | StringRef getTypedefName(const TagDecl *Decl) { | 157 | 7 | if (const auto *TypedefDecl = Decl->getTypedefNameForAnonDecl()) | 158 | 3 | return TypedefDecl->getName(); | 159 | | | 160 | 4 | return {}; | 161 | 7 | } |
Unexecuted instantiation: clang::extractapi::impl::ExtractAPIVisitorBase<clang::extractapi::ExtractAPIVisitor<void> >::getTypedefName(clang::TagDecl const*) Unexecuted instantiation: CXExtractAPI.cpp:clang::extractapi::impl::ExtractAPIVisitorBase<(anonymous namespace)::LibClangExtractAPIVisitor>::getTypedefName(clang::TagDecl const*) |
162 | | |
163 | 302 | bool isInSystemHeader(const Decl *D) { |
164 | 302 | return Context.getSourceManager().isInSystemHeader(D->getLocation()); |
165 | 302 | } ExtractAPIConsumer.cpp:clang::extractapi::impl::ExtractAPIVisitorBase<(anonymous namespace)::BatchExtractAPIVisitor>::isInSystemHeader(clang::Decl const*) Line | Count | Source | 163 | 183 | bool isInSystemHeader(const Decl *D) { | 164 | 183 | return Context.getSourceManager().isInSystemHeader(D->getLocation()); | 165 | 183 | } |
clang::extractapi::impl::ExtractAPIVisitorBase<clang::extractapi::ExtractAPIVisitor<void> >::isInSystemHeader(clang::Decl const*) Line | Count | Source | 163 | 8 | bool isInSystemHeader(const Decl *D) { | 164 | 8 | return Context.getSourceManager().isInSystemHeader(D->getLocation()); | 165 | 8 | } |
CXExtractAPI.cpp:clang::extractapi::impl::ExtractAPIVisitorBase<(anonymous namespace)::LibClangExtractAPIVisitor>::isInSystemHeader(clang::Decl const*) Line | Count | Source | 163 | 111 | bool isInSystemHeader(const Decl *D) { | 164 | 111 | return Context.getSourceManager().isInSystemHeader(D->getLocation()); | 165 | 111 | } |
|
166 | | |
167 | | private: |
168 | 832 | Derived &getDerivedExtractAPIVisitor() { |
169 | 832 | return *static_cast<Derived *>(this); |
170 | 832 | } ExtractAPIConsumer.cpp:clang::extractapi::impl::ExtractAPIVisitorBase<(anonymous namespace)::BatchExtractAPIVisitor>::getDerivedExtractAPIVisitor() Line | Count | Source | 168 | 489 | Derived &getDerivedExtractAPIVisitor() { | 169 | 489 | return *static_cast<Derived *>(this); | 170 | 489 | } |
clang::extractapi::impl::ExtractAPIVisitorBase<clang::extractapi::ExtractAPIVisitor<void> >::getDerivedExtractAPIVisitor() Line | Count | Source | 168 | 24 | Derived &getDerivedExtractAPIVisitor() { | 169 | 24 | return *static_cast<Derived *>(this); | 170 | 24 | } |
CXExtractAPI.cpp:clang::extractapi::impl::ExtractAPIVisitorBase<(anonymous namespace)::LibClangExtractAPIVisitor>::getDerivedExtractAPIVisitor() Line | Count | Source | 168 | 319 | Derived &getDerivedExtractAPIVisitor() { | 169 | 319 | return *static_cast<Derived *>(this); | 170 | 319 | } |
|
171 | | |
172 | 21 | SmallVector<SymbolReference> getBases(const CXXRecordDecl *Decl) { |
173 | | // FIXME: store AccessSpecifier given by inheritance |
174 | 21 | SmallVector<SymbolReference> Bases; |
175 | 21 | for (const auto &BaseSpecifier : Decl->bases()) { |
176 | | // skip classes not inherited as public |
177 | 6 | if (BaseSpecifier.getAccessSpecifier() != AccessSpecifier::AS_public) |
178 | 0 | continue; |
179 | 6 | SymbolReference BaseClass; |
180 | 6 | if (BaseSpecifier.getType().getTypePtr()->isTemplateTypeParmType()) { |
181 | 1 | BaseClass.Name = API.copyString(BaseSpecifier.getType().getAsString()); |
182 | 1 | BaseClass.USR = API.recordUSR( |
183 | 1 | BaseSpecifier.getType()->getAs<TemplateTypeParmType>()->getDecl()); |
184 | 5 | } else { |
185 | 5 | CXXRecordDecl *BaseClassDecl = |
186 | 5 | BaseSpecifier.getType().getTypePtr()->getAsCXXRecordDecl(); |
187 | 5 | BaseClass.Name = BaseClassDecl->getName(); |
188 | 5 | BaseClass.USR = API.recordUSR(BaseClassDecl); |
189 | 5 | } |
190 | 6 | Bases.emplace_back(BaseClass); |
191 | 6 | } |
192 | 21 | return Bases; |
193 | 21 | } ExtractAPIConsumer.cpp:clang::extractapi::impl::ExtractAPIVisitorBase<(anonymous namespace)::BatchExtractAPIVisitor>::getBases(clang::CXXRecordDecl const*) Line | Count | Source | 172 | 21 | SmallVector<SymbolReference> getBases(const CXXRecordDecl *Decl) { | 173 | | // FIXME: store AccessSpecifier given by inheritance | 174 | 21 | SmallVector<SymbolReference> Bases; | 175 | 21 | for (const auto &BaseSpecifier : Decl->bases()) { | 176 | | // skip classes not inherited as public | 177 | 6 | if (BaseSpecifier.getAccessSpecifier() != AccessSpecifier::AS_public) | 178 | 0 | continue; | 179 | 6 | SymbolReference BaseClass; | 180 | 6 | if (BaseSpecifier.getType().getTypePtr()->isTemplateTypeParmType()) { | 181 | 1 | BaseClass.Name = API.copyString(BaseSpecifier.getType().getAsString()); | 182 | 1 | BaseClass.USR = API.recordUSR( | 183 | 1 | BaseSpecifier.getType()->getAs<TemplateTypeParmType>()->getDecl()); | 184 | 5 | } else { | 185 | 5 | CXXRecordDecl *BaseClassDecl = | 186 | 5 | BaseSpecifier.getType().getTypePtr()->getAsCXXRecordDecl(); | 187 | 5 | BaseClass.Name = BaseClassDecl->getName(); | 188 | 5 | BaseClass.USR = API.recordUSR(BaseClassDecl); | 189 | 5 | } | 190 | 6 | Bases.emplace_back(BaseClass); | 191 | 6 | } | 192 | 21 | return Bases; | 193 | 21 | } |
Unexecuted instantiation: clang::extractapi::impl::ExtractAPIVisitorBase<clang::extractapi::ExtractAPIVisitor<void> >::getBases(clang::CXXRecordDecl const*) Unexecuted instantiation: CXExtractAPI.cpp:clang::extractapi::impl::ExtractAPIVisitorBase<(anonymous namespace)::LibClangExtractAPIVisitor>::getBases(clang::CXXRecordDecl const*) |
194 | | |
195 | 24 | APIRecord *determineParentRecord(const DeclContext *Context) { |
196 | 24 | SmallString<128> ParentUSR; |
197 | 24 | if (Context->getDeclKind() == Decl::TranslationUnit) |
198 | 22 | return nullptr; |
199 | | |
200 | 2 | index::generateUSRForDecl(dyn_cast<Decl>(Context), ParentUSR); |
201 | | |
202 | 2 | APIRecord *Parent = API.findRecordForUSR(ParentUSR); |
203 | 2 | return Parent; |
204 | 24 | } ExtractAPIConsumer.cpp:clang::extractapi::impl::ExtractAPIVisitorBase<(anonymous namespace)::BatchExtractAPIVisitor>::determineParentRecord(clang::DeclContext const*) Line | Count | Source | 195 | 24 | APIRecord *determineParentRecord(const DeclContext *Context) { | 196 | 24 | SmallString<128> ParentUSR; | 197 | 24 | if (Context->getDeclKind() == Decl::TranslationUnit) | 198 | 22 | return nullptr; | 199 | | | 200 | 2 | index::generateUSRForDecl(dyn_cast<Decl>(Context), ParentUSR); | 201 | | | 202 | 2 | APIRecord *Parent = API.findRecordForUSR(ParentUSR); | 203 | 2 | return Parent; | 204 | 24 | } |
Unexecuted instantiation: clang::extractapi::impl::ExtractAPIVisitorBase<clang::extractapi::ExtractAPIVisitor<void> >::determineParentRecord(clang::DeclContext const*) Unexecuted instantiation: CXExtractAPI.cpp:clang::extractapi::impl::ExtractAPIVisitorBase<(anonymous namespace)::LibClangExtractAPIVisitor>::determineParentRecord(clang::DeclContext const*) |
205 | | }; |
206 | | |
207 | | template <typename T> |
208 | 2 | static void modifyRecords(const T &Records, const StringRef &Name) { |
209 | 2 | for (const auto &Record : Records) { |
210 | 2 | if (Name == Record.second.get()->Name) { |
211 | 2 | auto &DeclFragment = Record.second->Declaration; |
212 | 2 | DeclFragment.insert(DeclFragment.begin(), " ", |
213 | 2 | DeclarationFragments::FragmentKind::Text); |
214 | 2 | DeclFragment.insert(DeclFragment.begin(), "typedef", |
215 | 2 | DeclarationFragments::FragmentKind::Keyword, "", |
216 | 2 | nullptr); |
217 | 2 | DeclFragment.insert(--DeclFragment.end(), " { ... } ", |
218 | 2 | DeclarationFragments::FragmentKind::Text); |
219 | 2 | DeclFragment.insert(--DeclFragment.end(), Name, |
220 | 2 | DeclarationFragments::FragmentKind::Identifier); |
221 | 2 | break; |
222 | 2 | } |
223 | 2 | } |
224 | 2 | } ExtractAPIConsumer.cpp:void clang::extractapi::impl::modifyRecords<llvm::MapVector<llvm::StringRef, std::__1::unique_ptr<clang::extractapi::StructRecord, std::__1::default_delete<clang::extractapi::StructRecord> >, llvm::DenseMap<llvm::StringRef, unsigned int, llvm::DenseMapInfo<llvm::StringRef, void>, llvm::detail::DenseMapPair<llvm::StringRef, unsigned int> >, llvm::SmallVector<std::__1::pair<llvm::StringRef, std::__1::unique_ptr<clang::extractapi::StructRecord, std::__1::default_delete<clang::extractapi::StructRecord> > >, 0u> > >(llvm::MapVector<llvm::StringRef, std::__1::unique_ptr<clang::extractapi::StructRecord, std::__1::default_delete<clang::extractapi::StructRecord> >, llvm::DenseMap<llvm::StringRef, unsigned int, llvm::DenseMapInfo<llvm::StringRef, void>, llvm::detail::DenseMapPair<llvm::StringRef, unsigned int> >, llvm::SmallVector<std::__1::pair<llvm::StringRef, std::__1::unique_ptr<clang::extractapi::StructRecord, std::__1::default_delete<clang::extractapi::StructRecord> > >, 0u> > const&, llvm::StringRef const&) Line | Count | Source | 208 | 1 | static void modifyRecords(const T &Records, const StringRef &Name) { | 209 | 1 | for (const auto &Record : Records) { | 210 | 1 | if (Name == Record.second.get()->Name) { | 211 | 1 | auto &DeclFragment = Record.second->Declaration; | 212 | 1 | DeclFragment.insert(DeclFragment.begin(), " ", | 213 | 1 | DeclarationFragments::FragmentKind::Text); | 214 | 1 | DeclFragment.insert(DeclFragment.begin(), "typedef", | 215 | 1 | DeclarationFragments::FragmentKind::Keyword, "", | 216 | 1 | nullptr); | 217 | 1 | DeclFragment.insert(--DeclFragment.end(), " { ... } ", | 218 | 1 | DeclarationFragments::FragmentKind::Text); | 219 | 1 | DeclFragment.insert(--DeclFragment.end(), Name, | 220 | 1 | DeclarationFragments::FragmentKind::Identifier); | 221 | 1 | break; | 222 | 1 | } | 223 | 1 | } | 224 | 1 | } |
ExtractAPIConsumer.cpp:void clang::extractapi::impl::modifyRecords<llvm::MapVector<llvm::StringRef, std::__1::unique_ptr<clang::extractapi::EnumRecord, std::__1::default_delete<clang::extractapi::EnumRecord> >, llvm::DenseMap<llvm::StringRef, unsigned int, llvm::DenseMapInfo<llvm::StringRef, void>, llvm::detail::DenseMapPair<llvm::StringRef, unsigned int> >, llvm::SmallVector<std::__1::pair<llvm::StringRef, std::__1::unique_ptr<clang::extractapi::EnumRecord, std::__1::default_delete<clang::extractapi::EnumRecord> > >, 0u> > >(llvm::MapVector<llvm::StringRef, std::__1::unique_ptr<clang::extractapi::EnumRecord, std::__1::default_delete<clang::extractapi::EnumRecord> >, llvm::DenseMap<llvm::StringRef, unsigned int, llvm::DenseMapInfo<llvm::StringRef, void>, llvm::detail::DenseMapPair<llvm::StringRef, unsigned int> >, llvm::SmallVector<std::__1::pair<llvm::StringRef, std::__1::unique_ptr<clang::extractapi::EnumRecord, std::__1::default_delete<clang::extractapi::EnumRecord> > >, 0u> > const&, llvm::StringRef const&) Line | Count | Source | 208 | 1 | static void modifyRecords(const T &Records, const StringRef &Name) { | 209 | 1 | for (const auto &Record : Records) { | 210 | 1 | if (Name == Record.second.get()->Name) { | 211 | 1 | auto &DeclFragment = Record.second->Declaration; | 212 | 1 | DeclFragment.insert(DeclFragment.begin(), " ", | 213 | 1 | DeclarationFragments::FragmentKind::Text); | 214 | 1 | DeclFragment.insert(DeclFragment.begin(), "typedef", | 215 | 1 | DeclarationFragments::FragmentKind::Keyword, "", | 216 | 1 | nullptr); | 217 | 1 | DeclFragment.insert(--DeclFragment.end(), " { ... } ", | 218 | 1 | DeclarationFragments::FragmentKind::Text); | 219 | 1 | DeclFragment.insert(--DeclFragment.end(), Name, | 220 | 1 | DeclarationFragments::FragmentKind::Identifier); | 221 | 1 | break; | 222 | 1 | } | 223 | 1 | } | 224 | 1 | } |
Unexecuted instantiation: CXExtractAPI.cpp:void clang::extractapi::impl::modifyRecords<llvm::MapVector<llvm::StringRef, std::__1::unique_ptr<clang::extractapi::StructRecord, std::__1::default_delete<clang::extractapi::StructRecord> >, llvm::DenseMap<llvm::StringRef, unsigned int, llvm::DenseMapInfo<llvm::StringRef, void>, llvm::detail::DenseMapPair<llvm::StringRef, unsigned int> >, llvm::SmallVector<std::__1::pair<llvm::StringRef, std::__1::unique_ptr<clang::extractapi::StructRecord, std::__1::default_delete<clang::extractapi::StructRecord> > >, 0u> > >(llvm::MapVector<llvm::StringRef, std::__1::unique_ptr<clang::extractapi::StructRecord, std::__1::default_delete<clang::extractapi::StructRecord> >, llvm::DenseMap<llvm::StringRef, unsigned int, llvm::DenseMapInfo<llvm::StringRef, void>, llvm::detail::DenseMapPair<llvm::StringRef, unsigned int> >, llvm::SmallVector<std::__1::pair<llvm::StringRef, std::__1::unique_ptr<clang::extractapi::StructRecord, std::__1::default_delete<clang::extractapi::StructRecord> > >, 0u> > const&, llvm::StringRef const&) Unexecuted instantiation: CXExtractAPI.cpp:void clang::extractapi::impl::modifyRecords<llvm::MapVector<llvm::StringRef, std::__1::unique_ptr<clang::extractapi::EnumRecord, std::__1::default_delete<clang::extractapi::EnumRecord> >, llvm::DenseMap<llvm::StringRef, unsigned int, llvm::DenseMapInfo<llvm::StringRef, void>, llvm::detail::DenseMapPair<llvm::StringRef, unsigned int> >, llvm::SmallVector<std::__1::pair<llvm::StringRef, std::__1::unique_ptr<clang::extractapi::EnumRecord, std::__1::default_delete<clang::extractapi::EnumRecord> > >, 0u> > >(llvm::MapVector<llvm::StringRef, std::__1::unique_ptr<clang::extractapi::EnumRecord, std::__1::default_delete<clang::extractapi::EnumRecord> >, llvm::DenseMap<llvm::StringRef, unsigned int, llvm::DenseMapInfo<llvm::StringRef, void>, llvm::detail::DenseMapPair<llvm::StringRef, unsigned int> >, llvm::SmallVector<std::__1::pair<llvm::StringRef, std::__1::unique_ptr<clang::extractapi::EnumRecord, std::__1::default_delete<clang::extractapi::EnumRecord> > >, 0u> > const&, llvm::StringRef const&) |
225 | | |
226 | | template <typename Derived> |
227 | 66 | bool ExtractAPIVisitorBase<Derived>::VisitVarDecl(const VarDecl *Decl) { |
228 | | // skip function parameters. |
229 | 66 | if (isa<ParmVarDecl>(Decl)) |
230 | 47 | return true; |
231 | | |
232 | | // Skip non-global variables in records (struct/union/class) but not static |
233 | | // members. |
234 | 19 | if (Decl->getDeclContext()->isRecord() && !Decl->isStaticDataMember()1 ) |
235 | 0 | return true; |
236 | | |
237 | | // Skip local variables inside function or method. |
238 | 19 | if (!Decl->isDefinedOutsideFunctionOrMethod()) |
239 | 0 | return true; |
240 | | |
241 | | // If this is a template but not specialization or instantiation, skip. |
242 | 19 | if (Decl->getASTContext().getTemplateOrSpecializationInfo(Decl) && |
243 | 19 | Decl->getTemplateSpecializationKind() == TSK_Undeclared4 ) |
244 | 4 | return true; |
245 | | |
246 | 15 | if (!getDerivedExtractAPIVisitor().shouldDeclBeIncluded(Decl)) |
247 | 2 | return true; |
248 | | |
249 | | // Collect symbol information. |
250 | 13 | StringRef Name = Decl->getName(); |
251 | 13 | StringRef USR = API.recordUSR(Decl); |
252 | 13 | PresumedLoc Loc = |
253 | 13 | Context.getSourceManager().getPresumedLoc(Decl->getLocation()); |
254 | 13 | LinkageInfo Linkage = Decl->getLinkageAndVisibility(); |
255 | 13 | DocComment Comment; |
256 | 13 | if (auto *RawComment = |
257 | 13 | getDerivedExtractAPIVisitor().fetchRawCommentForDecl(Decl)) |
258 | 0 | Comment = RawComment->getFormattedLines(Context.getSourceManager(), |
259 | 0 | Context.getDiagnostics()); |
260 | | |
261 | | // Build declaration fragments and sub-heading for the variable. |
262 | 13 | DeclarationFragments Declaration = |
263 | 13 | DeclarationFragmentsBuilder::getFragmentsForVar(Decl); |
264 | 13 | DeclarationFragments SubHeading = |
265 | 13 | DeclarationFragmentsBuilder::getSubHeading(Decl); |
266 | | |
267 | 13 | if (Decl->isStaticDataMember()) { |
268 | 0 | SymbolReference Context; |
269 | | // getDeclContext() should return a RecordDecl since we |
270 | | // are currently handling a static data member. |
271 | 0 | auto *Record = cast<RecordDecl>(Decl->getDeclContext()); |
272 | 0 | Context.Name = Record->getName(); |
273 | 0 | Context.USR = API.recordUSR(Record); |
274 | 0 | auto Access = DeclarationFragmentsBuilder::getAccessControl(Decl); |
275 | 0 | API.addStaticField(Name, USR, Loc, AvailabilitySet(Decl), Linkage, Comment, |
276 | 0 | Declaration, SubHeading, Context, Access, |
277 | 0 | isInSystemHeader(Decl)); |
278 | 0 | } else |
279 | | // Add the global variable record to the API set. |
280 | 13 | API.addGlobalVar(Name, USR, Loc, AvailabilitySet(Decl), Linkage, Comment, |
281 | 13 | Declaration, SubHeading, isInSystemHeader(Decl)); |
282 | 13 | return true; |
283 | 15 | } ExtractAPIConsumer.cpp:clang::extractapi::impl::ExtractAPIVisitorBase<(anonymous namespace)::BatchExtractAPIVisitor>::VisitVarDecl(clang::VarDecl const*) Line | Count | Source | 227 | 42 | bool ExtractAPIVisitorBase<Derived>::VisitVarDecl(const VarDecl *Decl) { | 228 | | // skip function parameters. | 229 | 42 | if (isa<ParmVarDecl>(Decl)) | 230 | 23 | return true; | 231 | | | 232 | | // Skip non-global variables in records (struct/union/class) but not static | 233 | | // members. | 234 | 19 | if (Decl->getDeclContext()->isRecord() && !Decl->isStaticDataMember()1 ) | 235 | 0 | return true; | 236 | | | 237 | | // Skip local variables inside function or method. | 238 | 19 | if (!Decl->isDefinedOutsideFunctionOrMethod()) | 239 | 0 | return true; | 240 | | | 241 | | // If this is a template but not specialization or instantiation, skip. | 242 | 19 | if (Decl->getASTContext().getTemplateOrSpecializationInfo(Decl) && | 243 | 19 | Decl->getTemplateSpecializationKind() == TSK_Undeclared4 ) | 244 | 4 | return true; | 245 | | | 246 | 15 | if (!getDerivedExtractAPIVisitor().shouldDeclBeIncluded(Decl)) | 247 | 2 | return true; | 248 | | | 249 | | // Collect symbol information. | 250 | 13 | StringRef Name = Decl->getName(); | 251 | 13 | StringRef USR = API.recordUSR(Decl); | 252 | 13 | PresumedLoc Loc = | 253 | 13 | Context.getSourceManager().getPresumedLoc(Decl->getLocation()); | 254 | 13 | LinkageInfo Linkage = Decl->getLinkageAndVisibility(); | 255 | 13 | DocComment Comment; | 256 | 13 | if (auto *RawComment = | 257 | 13 | getDerivedExtractAPIVisitor().fetchRawCommentForDecl(Decl)) | 258 | 0 | Comment = RawComment->getFormattedLines(Context.getSourceManager(), | 259 | 0 | Context.getDiagnostics()); | 260 | | | 261 | | // Build declaration fragments and sub-heading for the variable. | 262 | 13 | DeclarationFragments Declaration = | 263 | 13 | DeclarationFragmentsBuilder::getFragmentsForVar(Decl); | 264 | 13 | DeclarationFragments SubHeading = | 265 | 13 | DeclarationFragmentsBuilder::getSubHeading(Decl); | 266 | | | 267 | 13 | if (Decl->isStaticDataMember()) { | 268 | 0 | SymbolReference Context; | 269 | | // getDeclContext() should return a RecordDecl since we | 270 | | // are currently handling a static data member. | 271 | 0 | auto *Record = cast<RecordDecl>(Decl->getDeclContext()); | 272 | 0 | Context.Name = Record->getName(); | 273 | 0 | Context.USR = API.recordUSR(Record); | 274 | 0 | auto Access = DeclarationFragmentsBuilder::getAccessControl(Decl); | 275 | 0 | API.addStaticField(Name, USR, Loc, AvailabilitySet(Decl), Linkage, Comment, | 276 | 0 | Declaration, SubHeading, Context, Access, | 277 | 0 | isInSystemHeader(Decl)); | 278 | 0 | } else | 279 | | // Add the global variable record to the API set. | 280 | 13 | API.addGlobalVar(Name, USR, Loc, AvailabilitySet(Decl), Linkage, Comment, | 281 | 13 | Declaration, SubHeading, isInSystemHeader(Decl)); | 282 | 13 | return true; | 283 | 15 | } |
clang::extractapi::impl::ExtractAPIVisitorBase<clang::extractapi::ExtractAPIVisitor<void> >::VisitVarDecl(clang::VarDecl const*) Line | Count | Source | 227 | 6 | bool ExtractAPIVisitorBase<Derived>::VisitVarDecl(const VarDecl *Decl) { | 228 | | // skip function parameters. | 229 | 6 | if (isa<ParmVarDecl>(Decl)) | 230 | 6 | return true; | 231 | | | 232 | | // Skip non-global variables in records (struct/union/class) but not static | 233 | | // members. | 234 | 0 | if (Decl->getDeclContext()->isRecord() && !Decl->isStaticDataMember()) | 235 | 0 | return true; | 236 | | | 237 | | // Skip local variables inside function or method. | 238 | 0 | if (!Decl->isDefinedOutsideFunctionOrMethod()) | 239 | 0 | return true; | 240 | | | 241 | | // If this is a template but not specialization or instantiation, skip. | 242 | 0 | if (Decl->getASTContext().getTemplateOrSpecializationInfo(Decl) && | 243 | 0 | Decl->getTemplateSpecializationKind() == TSK_Undeclared) | 244 | 0 | return true; | 245 | | | 246 | 0 | if (!getDerivedExtractAPIVisitor().shouldDeclBeIncluded(Decl)) | 247 | 0 | return true; | 248 | | | 249 | | // Collect symbol information. | 250 | 0 | StringRef Name = Decl->getName(); | 251 | 0 | StringRef USR = API.recordUSR(Decl); | 252 | 0 | PresumedLoc Loc = | 253 | 0 | Context.getSourceManager().getPresumedLoc(Decl->getLocation()); | 254 | 0 | LinkageInfo Linkage = Decl->getLinkageAndVisibility(); | 255 | 0 | DocComment Comment; | 256 | 0 | if (auto *RawComment = | 257 | 0 | getDerivedExtractAPIVisitor().fetchRawCommentForDecl(Decl)) | 258 | 0 | Comment = RawComment->getFormattedLines(Context.getSourceManager(), | 259 | 0 | Context.getDiagnostics()); | 260 | | | 261 | | // Build declaration fragments and sub-heading for the variable. | 262 | 0 | DeclarationFragments Declaration = | 263 | 0 | DeclarationFragmentsBuilder::getFragmentsForVar(Decl); | 264 | 0 | DeclarationFragments SubHeading = | 265 | 0 | DeclarationFragmentsBuilder::getSubHeading(Decl); | 266 | |
| 267 | 0 | if (Decl->isStaticDataMember()) { | 268 | 0 | SymbolReference Context; | 269 | | // getDeclContext() should return a RecordDecl since we | 270 | | // are currently handling a static data member. | 271 | 0 | auto *Record = cast<RecordDecl>(Decl->getDeclContext()); | 272 | 0 | Context.Name = Record->getName(); | 273 | 0 | Context.USR = API.recordUSR(Record); | 274 | 0 | auto Access = DeclarationFragmentsBuilder::getAccessControl(Decl); | 275 | 0 | API.addStaticField(Name, USR, Loc, AvailabilitySet(Decl), Linkage, Comment, | 276 | 0 | Declaration, SubHeading, Context, Access, | 277 | 0 | isInSystemHeader(Decl)); | 278 | 0 | } else | 279 | | // Add the global variable record to the API set. | 280 | 0 | API.addGlobalVar(Name, USR, Loc, AvailabilitySet(Decl), Linkage, Comment, | 281 | 0 | Declaration, SubHeading, isInSystemHeader(Decl)); | 282 | 0 | return true; | 283 | 0 | } |
CXExtractAPI.cpp:clang::extractapi::impl::ExtractAPIVisitorBase<(anonymous namespace)::LibClangExtractAPIVisitor>::VisitVarDecl(clang::VarDecl const*) Line | Count | Source | 227 | 18 | bool ExtractAPIVisitorBase<Derived>::VisitVarDecl(const VarDecl *Decl) { | 228 | | // skip function parameters. | 229 | 18 | if (isa<ParmVarDecl>(Decl)) | 230 | 18 | return true; | 231 | | | 232 | | // Skip non-global variables in records (struct/union/class) but not static | 233 | | // members. | 234 | 0 | if (Decl->getDeclContext()->isRecord() && !Decl->isStaticDataMember()) | 235 | 0 | return true; | 236 | | | 237 | | // Skip local variables inside function or method. | 238 | 0 | if (!Decl->isDefinedOutsideFunctionOrMethod()) | 239 | 0 | return true; | 240 | | | 241 | | // If this is a template but not specialization or instantiation, skip. | 242 | 0 | if (Decl->getASTContext().getTemplateOrSpecializationInfo(Decl) && | 243 | 0 | Decl->getTemplateSpecializationKind() == TSK_Undeclared) | 244 | 0 | return true; | 245 | | | 246 | 0 | if (!getDerivedExtractAPIVisitor().shouldDeclBeIncluded(Decl)) | 247 | 0 | return true; | 248 | | | 249 | | // Collect symbol information. | 250 | 0 | StringRef Name = Decl->getName(); | 251 | 0 | StringRef USR = API.recordUSR(Decl); | 252 | 0 | PresumedLoc Loc = | 253 | 0 | Context.getSourceManager().getPresumedLoc(Decl->getLocation()); | 254 | 0 | LinkageInfo Linkage = Decl->getLinkageAndVisibility(); | 255 | 0 | DocComment Comment; | 256 | 0 | if (auto *RawComment = | 257 | 0 | getDerivedExtractAPIVisitor().fetchRawCommentForDecl(Decl)) | 258 | 0 | Comment = RawComment->getFormattedLines(Context.getSourceManager(), | 259 | 0 | Context.getDiagnostics()); | 260 | | | 261 | | // Build declaration fragments and sub-heading for the variable. | 262 | 0 | DeclarationFragments Declaration = | 263 | 0 | DeclarationFragmentsBuilder::getFragmentsForVar(Decl); | 264 | 0 | DeclarationFragments SubHeading = | 265 | 0 | DeclarationFragmentsBuilder::getSubHeading(Decl); | 266 | |
| 267 | 0 | if (Decl->isStaticDataMember()) { | 268 | 0 | SymbolReference Context; | 269 | | // getDeclContext() should return a RecordDecl since we | 270 | | // are currently handling a static data member. | 271 | 0 | auto *Record = cast<RecordDecl>(Decl->getDeclContext()); | 272 | 0 | Context.Name = Record->getName(); | 273 | 0 | Context.USR = API.recordUSR(Record); | 274 | 0 | auto Access = DeclarationFragmentsBuilder::getAccessControl(Decl); | 275 | 0 | API.addStaticField(Name, USR, Loc, AvailabilitySet(Decl), Linkage, Comment, | 276 | 0 | Declaration, SubHeading, Context, Access, | 277 | 0 | isInSystemHeader(Decl)); | 278 | 0 | } else | 279 | | // Add the global variable record to the API set. | 280 | 0 | API.addGlobalVar(Name, USR, Loc, AvailabilitySet(Decl), Linkage, Comment, | 281 | 0 | Declaration, SubHeading, isInSystemHeader(Decl)); | 282 | 0 | return true; | 283 | 0 | } |
|
284 | | |
285 | | template <typename Derived> |
286 | | bool ExtractAPIVisitorBase<Derived>::VisitFunctionDecl( |
287 | 31 | const FunctionDecl *Decl) { |
288 | 31 | if (const auto *Method = dyn_cast<CXXMethodDecl>(Decl)) { |
289 | | // Skip member function in class templates. |
290 | 0 | if (Method->getParent()->getDescribedClassTemplate() != nullptr) |
291 | 0 | return true; |
292 | | |
293 | | // Skip methods in records. |
294 | 0 | for (const auto &P : Context.getParents(*Method)) { |
295 | 0 | if (P.template get<CXXRecordDecl>()) |
296 | 0 | return true; |
297 | 0 | } |
298 | | |
299 | | // Skip ConstructorDecl and DestructorDecl. |
300 | 0 | if (isa<CXXConstructorDecl>(Method) || isa<CXXDestructorDecl>(Method)) |
301 | 0 | return true; |
302 | 0 | } |
303 | | |
304 | | // Skip templated functions. |
305 | 31 | switch (Decl->getTemplatedKind()) { |
306 | 27 | case FunctionDecl::TK_NonTemplate: |
307 | 27 | case FunctionDecl::TK_DependentNonTemplate: |
308 | 28 | case FunctionDecl::TK_FunctionTemplateSpecialization: |
309 | 28 | break; |
310 | 3 | case FunctionDecl::TK_FunctionTemplate: |
311 | 3 | case FunctionDecl::TK_DependentFunctionTemplateSpecialization: |
312 | 3 | case FunctionDecl::TK_MemberSpecialization: |
313 | 3 | return true; |
314 | 31 | } |
315 | | |
316 | 28 | if (!getDerivedExtractAPIVisitor().shouldDeclBeIncluded(Decl)) |
317 | 1 | return true; |
318 | | |
319 | | // Collect symbol information. |
320 | 27 | StringRef Name = Decl->getName(); |
321 | 27 | StringRef USR = API.recordUSR(Decl); |
322 | 27 | PresumedLoc Loc = |
323 | 27 | Context.getSourceManager().getPresumedLoc(Decl->getLocation()); |
324 | 27 | LinkageInfo Linkage = Decl->getLinkageAndVisibility(); |
325 | 27 | DocComment Comment; |
326 | 27 | if (auto *RawComment = |
327 | 27 | getDerivedExtractAPIVisitor().fetchRawCommentForDecl(Decl)) |
328 | 2 | Comment = RawComment->getFormattedLines(Context.getSourceManager(), |
329 | 2 | Context.getDiagnostics()); |
330 | | |
331 | | // Build declaration fragments, sub-heading, and signature of the function. |
332 | 27 | DeclarationFragments SubHeading = |
333 | 27 | DeclarationFragmentsBuilder::getSubHeading(Decl); |
334 | 27 | FunctionSignature Signature = |
335 | 27 | DeclarationFragmentsBuilder::getFunctionSignature(Decl); |
336 | | |
337 | 27 | if (Decl->getTemplateSpecializationInfo()) |
338 | 1 | API.addGlobalFunctionTemplateSpecialization( |
339 | 1 | Name, USR, Loc, AvailabilitySet(Decl), Linkage, Comment, |
340 | 1 | DeclarationFragmentsBuilder:: |
341 | 1 | getFragmentsForFunctionTemplateSpecialization(Decl), |
342 | 1 | SubHeading, Signature, isInSystemHeader(Decl)); |
343 | 26 | else |
344 | | // Add the function record to the API set. |
345 | 26 | API.addGlobalFunction( |
346 | 26 | Name, USR, Loc, AvailabilitySet(Decl), Linkage, Comment, |
347 | 26 | DeclarationFragmentsBuilder::getFragmentsForFunction(Decl), SubHeading, |
348 | 26 | Signature, isInSystemHeader(Decl)); |
349 | 27 | return true; |
350 | 28 | } ExtractAPIConsumer.cpp:clang::extractapi::impl::ExtractAPIVisitorBase<(anonymous namespace)::BatchExtractAPIVisitor>::VisitFunctionDecl(clang::FunctionDecl const*) Line | Count | Source | 287 | 23 | const FunctionDecl *Decl) { | 288 | 23 | if (const auto *Method = dyn_cast<CXXMethodDecl>(Decl)) { | 289 | | // Skip member function in class templates. | 290 | 0 | if (Method->getParent()->getDescribedClassTemplate() != nullptr) | 291 | 0 | return true; | 292 | | | 293 | | // Skip methods in records. | 294 | 0 | for (const auto &P : Context.getParents(*Method)) { | 295 | 0 | if (P.template get<CXXRecordDecl>()) | 296 | 0 | return true; | 297 | 0 | } | 298 | | | 299 | | // Skip ConstructorDecl and DestructorDecl. | 300 | 0 | if (isa<CXXConstructorDecl>(Method) || isa<CXXDestructorDecl>(Method)) | 301 | 0 | return true; | 302 | 0 | } | 303 | | | 304 | | // Skip templated functions. | 305 | 23 | switch (Decl->getTemplatedKind()) { | 306 | 19 | case FunctionDecl::TK_NonTemplate: | 307 | 19 | case FunctionDecl::TK_DependentNonTemplate: | 308 | 20 | case FunctionDecl::TK_FunctionTemplateSpecialization: | 309 | 20 | break; | 310 | 3 | case FunctionDecl::TK_FunctionTemplate: | 311 | 3 | case FunctionDecl::TK_DependentFunctionTemplateSpecialization: | 312 | 3 | case FunctionDecl::TK_MemberSpecialization: | 313 | 3 | return true; | 314 | 23 | } | 315 | | | 316 | 20 | if (!getDerivedExtractAPIVisitor().shouldDeclBeIncluded(Decl)) | 317 | 1 | return true; | 318 | | | 319 | | // Collect symbol information. | 320 | 19 | StringRef Name = Decl->getName(); | 321 | 19 | StringRef USR = API.recordUSR(Decl); | 322 | 19 | PresumedLoc Loc = | 323 | 19 | Context.getSourceManager().getPresumedLoc(Decl->getLocation()); | 324 | 19 | LinkageInfo Linkage = Decl->getLinkageAndVisibility(); | 325 | 19 | DocComment Comment; | 326 | 19 | if (auto *RawComment = | 327 | 19 | getDerivedExtractAPIVisitor().fetchRawCommentForDecl(Decl)) | 328 | 2 | Comment = RawComment->getFormattedLines(Context.getSourceManager(), | 329 | 2 | Context.getDiagnostics()); | 330 | | | 331 | | // Build declaration fragments, sub-heading, and signature of the function. | 332 | 19 | DeclarationFragments SubHeading = | 333 | 19 | DeclarationFragmentsBuilder::getSubHeading(Decl); | 334 | 19 | FunctionSignature Signature = | 335 | 19 | DeclarationFragmentsBuilder::getFunctionSignature(Decl); | 336 | | | 337 | 19 | if (Decl->getTemplateSpecializationInfo()) | 338 | 1 | API.addGlobalFunctionTemplateSpecialization( | 339 | 1 | Name, USR, Loc, AvailabilitySet(Decl), Linkage, Comment, | 340 | 1 | DeclarationFragmentsBuilder:: | 341 | 1 | getFragmentsForFunctionTemplateSpecialization(Decl), | 342 | 1 | SubHeading, Signature, isInSystemHeader(Decl)); | 343 | 18 | else | 344 | | // Add the function record to the API set. | 345 | 18 | API.addGlobalFunction( | 346 | 18 | Name, USR, Loc, AvailabilitySet(Decl), Linkage, Comment, | 347 | 18 | DeclarationFragmentsBuilder::getFragmentsForFunction(Decl), SubHeading, | 348 | 18 | Signature, isInSystemHeader(Decl)); | 349 | 19 | return true; | 350 | 20 | } |
clang::extractapi::impl::ExtractAPIVisitorBase<clang::extractapi::ExtractAPIVisitor<void> >::VisitFunctionDecl(clang::FunctionDecl const*) Line | Count | Source | 287 | 8 | const FunctionDecl *Decl) { | 288 | 8 | if (const auto *Method = dyn_cast<CXXMethodDecl>(Decl)) { | 289 | | // Skip member function in class templates. | 290 | 0 | if (Method->getParent()->getDescribedClassTemplate() != nullptr) | 291 | 0 | return true; | 292 | | | 293 | | // Skip methods in records. | 294 | 0 | for (const auto &P : Context.getParents(*Method)) { | 295 | 0 | if (P.template get<CXXRecordDecl>()) | 296 | 0 | return true; | 297 | 0 | } | 298 | | | 299 | | // Skip ConstructorDecl and DestructorDecl. | 300 | 0 | if (isa<CXXConstructorDecl>(Method) || isa<CXXDestructorDecl>(Method)) | 301 | 0 | return true; | 302 | 0 | } | 303 | | | 304 | | // Skip templated functions. | 305 | 8 | switch (Decl->getTemplatedKind()) { | 306 | 8 | case FunctionDecl::TK_NonTemplate: | 307 | 8 | case FunctionDecl::TK_DependentNonTemplate: | 308 | 8 | case FunctionDecl::TK_FunctionTemplateSpecialization: | 309 | 8 | break; | 310 | 0 | case FunctionDecl::TK_FunctionTemplate: | 311 | 0 | case FunctionDecl::TK_DependentFunctionTemplateSpecialization: | 312 | 0 | case FunctionDecl::TK_MemberSpecialization: | 313 | 0 | return true; | 314 | 8 | } | 315 | | | 316 | 8 | if (!getDerivedExtractAPIVisitor().shouldDeclBeIncluded(Decl)) | 317 | 0 | return true; | 318 | | | 319 | | // Collect symbol information. | 320 | 8 | StringRef Name = Decl->getName(); | 321 | 8 | StringRef USR = API.recordUSR(Decl); | 322 | 8 | PresumedLoc Loc = | 323 | 8 | Context.getSourceManager().getPresumedLoc(Decl->getLocation()); | 324 | 8 | LinkageInfo Linkage = Decl->getLinkageAndVisibility(); | 325 | 8 | DocComment Comment; | 326 | 8 | if (auto *RawComment = | 327 | 8 | getDerivedExtractAPIVisitor().fetchRawCommentForDecl(Decl)) | 328 | 0 | Comment = RawComment->getFormattedLines(Context.getSourceManager(), | 329 | 0 | Context.getDiagnostics()); | 330 | | | 331 | | // Build declaration fragments, sub-heading, and signature of the function. | 332 | 8 | DeclarationFragments SubHeading = | 333 | 8 | DeclarationFragmentsBuilder::getSubHeading(Decl); | 334 | 8 | FunctionSignature Signature = | 335 | 8 | DeclarationFragmentsBuilder::getFunctionSignature(Decl); | 336 | | | 337 | 8 | if (Decl->getTemplateSpecializationInfo()) | 338 | 0 | API.addGlobalFunctionTemplateSpecialization( | 339 | 0 | Name, USR, Loc, AvailabilitySet(Decl), Linkage, Comment, | 340 | 0 | DeclarationFragmentsBuilder:: | 341 | 0 | getFragmentsForFunctionTemplateSpecialization(Decl), | 342 | 0 | SubHeading, Signature, isInSystemHeader(Decl)); | 343 | 8 | else | 344 | | // Add the function record to the API set. | 345 | 8 | API.addGlobalFunction( | 346 | 8 | Name, USR, Loc, AvailabilitySet(Decl), Linkage, Comment, | 347 | 8 | DeclarationFragmentsBuilder::getFragmentsForFunction(Decl), SubHeading, | 348 | 8 | Signature, isInSystemHeader(Decl)); | 349 | 8 | return true; | 350 | 8 | } |
Unexecuted instantiation: CXExtractAPI.cpp:clang::extractapi::impl::ExtractAPIVisitorBase<(anonymous namespace)::LibClangExtractAPIVisitor>::VisitFunctionDecl(clang::FunctionDecl const*) |
351 | | |
352 | | template <typename Derived> |
353 | 7 | bool ExtractAPIVisitorBase<Derived>::VisitEnumDecl(const EnumDecl *Decl) { |
354 | 7 | if (!getDerivedExtractAPIVisitor().shouldDeclBeIncluded(Decl)) |
355 | 0 | return true; |
356 | | |
357 | 7 | SmallString<128> QualifiedNameBuffer; |
358 | | // Collect symbol information. |
359 | 7 | StringRef Name = Decl->getName(); |
360 | 7 | if (Name.empty()) |
361 | 4 | Name = getTypedefName(Decl); |
362 | 7 | if (Name.empty()) { |
363 | 3 | llvm::raw_svector_ostream OS(QualifiedNameBuffer); |
364 | 3 | Decl->printQualifiedName(OS); |
365 | 3 | Name = QualifiedNameBuffer.str(); |
366 | 3 | } |
367 | | |
368 | 7 | StringRef USR = API.recordUSR(Decl); |
369 | 7 | PresumedLoc Loc = |
370 | 7 | Context.getSourceManager().getPresumedLoc(Decl->getLocation()); |
371 | 7 | DocComment Comment; |
372 | 7 | if (auto *RawComment = |
373 | 7 | getDerivedExtractAPIVisitor().fetchRawCommentForDecl(Decl)) |
374 | 2 | Comment = RawComment->getFormattedLines(Context.getSourceManager(), |
375 | 2 | Context.getDiagnostics()); |
376 | | |
377 | | // Build declaration fragments and sub-heading for the enum. |
378 | 7 | DeclarationFragments Declaration = |
379 | 7 | DeclarationFragmentsBuilder::getFragmentsForEnum(Decl); |
380 | 7 | DeclarationFragments SubHeading = |
381 | 7 | DeclarationFragmentsBuilder::getSubHeading(Decl); |
382 | | |
383 | 7 | EnumRecord *EnumRecord = |
384 | 7 | API.addEnum(API.copyString(Name), USR, Loc, AvailabilitySet(Decl), |
385 | 7 | Comment, Declaration, SubHeading, isInSystemHeader(Decl)); |
386 | | |
387 | | // Now collect information about the enumerators in this enum. |
388 | 7 | getDerivedExtractAPIVisitor().recordEnumConstants(EnumRecord, |
389 | 7 | Decl->enumerators()); |
390 | | |
391 | 7 | return true; |
392 | 7 | } ExtractAPIConsumer.cpp:clang::extractapi::impl::ExtractAPIVisitorBase<(anonymous namespace)::BatchExtractAPIVisitor>::VisitEnumDecl(clang::EnumDecl const*) Line | Count | Source | 353 | 7 | bool ExtractAPIVisitorBase<Derived>::VisitEnumDecl(const EnumDecl *Decl) { | 354 | 7 | if (!getDerivedExtractAPIVisitor().shouldDeclBeIncluded(Decl)) | 355 | 0 | return true; | 356 | | | 357 | 7 | SmallString<128> QualifiedNameBuffer; | 358 | | // Collect symbol information. | 359 | 7 | StringRef Name = Decl->getName(); | 360 | 7 | if (Name.empty()) | 361 | 4 | Name = getTypedefName(Decl); | 362 | 7 | if (Name.empty()) { | 363 | 3 | llvm::raw_svector_ostream OS(QualifiedNameBuffer); | 364 | 3 | Decl->printQualifiedName(OS); | 365 | 3 | Name = QualifiedNameBuffer.str(); | 366 | 3 | } | 367 | | | 368 | 7 | StringRef USR = API.recordUSR(Decl); | 369 | 7 | PresumedLoc Loc = | 370 | 7 | Context.getSourceManager().getPresumedLoc(Decl->getLocation()); | 371 | 7 | DocComment Comment; | 372 | 7 | if (auto *RawComment = | 373 | 7 | getDerivedExtractAPIVisitor().fetchRawCommentForDecl(Decl)) | 374 | 2 | Comment = RawComment->getFormattedLines(Context.getSourceManager(), | 375 | 2 | Context.getDiagnostics()); | 376 | | | 377 | | // Build declaration fragments and sub-heading for the enum. | 378 | 7 | DeclarationFragments Declaration = | 379 | 7 | DeclarationFragmentsBuilder::getFragmentsForEnum(Decl); | 380 | 7 | DeclarationFragments SubHeading = | 381 | 7 | DeclarationFragmentsBuilder::getSubHeading(Decl); | 382 | | | 383 | 7 | EnumRecord *EnumRecord = | 384 | 7 | API.addEnum(API.copyString(Name), USR, Loc, AvailabilitySet(Decl), | 385 | 7 | Comment, Declaration, SubHeading, isInSystemHeader(Decl)); | 386 | | | 387 | | // Now collect information about the enumerators in this enum. | 388 | 7 | getDerivedExtractAPIVisitor().recordEnumConstants(EnumRecord, | 389 | 7 | Decl->enumerators()); | 390 | | | 391 | 7 | return true; | 392 | 7 | } |
Unexecuted instantiation: clang::extractapi::impl::ExtractAPIVisitorBase<clang::extractapi::ExtractAPIVisitor<void> >::VisitEnumDecl(clang::EnumDecl const*) Unexecuted instantiation: CXExtractAPI.cpp:clang::extractapi::impl::ExtractAPIVisitorBase<(anonymous namespace)::LibClangExtractAPIVisitor>::VisitEnumDecl(clang::EnumDecl const*) |
393 | | |
394 | | template <typename Derived> |
395 | | bool ExtractAPIVisitorBase<Derived>::WalkUpFromFunctionDecl( |
396 | 31 | const FunctionDecl *Decl) { |
397 | 31 | getDerivedExtractAPIVisitor().VisitFunctionDecl(Decl); |
398 | 31 | return true; |
399 | 31 | } ExtractAPIConsumer.cpp:clang::extractapi::impl::ExtractAPIVisitorBase<(anonymous namespace)::BatchExtractAPIVisitor>::WalkUpFromFunctionDecl(clang::FunctionDecl const*) Line | Count | Source | 396 | 23 | const FunctionDecl *Decl) { | 397 | 23 | getDerivedExtractAPIVisitor().VisitFunctionDecl(Decl); | 398 | 23 | return true; | 399 | 23 | } |
clang::extractapi::impl::ExtractAPIVisitorBase<clang::extractapi::ExtractAPIVisitor<void> >::WalkUpFromFunctionDecl(clang::FunctionDecl const*) Line | Count | Source | 396 | 8 | const FunctionDecl *Decl) { | 397 | 8 | getDerivedExtractAPIVisitor().VisitFunctionDecl(Decl); | 398 | 8 | return true; | 399 | 8 | } |
Unexecuted instantiation: CXExtractAPI.cpp:clang::extractapi::impl::ExtractAPIVisitorBase<(anonymous namespace)::LibClangExtractAPIVisitor>::WalkUpFromFunctionDecl(clang::FunctionDecl const*) |
400 | | |
401 | | template <typename Derived> |
402 | | bool ExtractAPIVisitorBase<Derived>::WalkUpFromRecordDecl( |
403 | 24 | const RecordDecl *Decl) { |
404 | 24 | getDerivedExtractAPIVisitor().VisitRecordDecl(Decl); |
405 | 24 | return true; |
406 | 24 | } ExtractAPIConsumer.cpp:clang::extractapi::impl::ExtractAPIVisitorBase<(anonymous namespace)::BatchExtractAPIVisitor>::WalkUpFromRecordDecl(clang::RecordDecl const*) Line | Count | Source | 403 | 11 | const RecordDecl *Decl) { | 404 | 11 | getDerivedExtractAPIVisitor().VisitRecordDecl(Decl); | 405 | 11 | return true; | 406 | 11 | } |
Unexecuted instantiation: clang::extractapi::impl::ExtractAPIVisitorBase<clang::extractapi::ExtractAPIVisitor<void> >::WalkUpFromRecordDecl(clang::RecordDecl const*) CXExtractAPI.cpp:clang::extractapi::impl::ExtractAPIVisitorBase<(anonymous namespace)::LibClangExtractAPIVisitor>::WalkUpFromRecordDecl(clang::RecordDecl const*) Line | Count | Source | 403 | 13 | const RecordDecl *Decl) { | 404 | 13 | getDerivedExtractAPIVisitor().VisitRecordDecl(Decl); | 405 | 13 | return true; | 406 | 13 | } |
|
407 | | |
408 | | template <typename Derived> |
409 | | bool ExtractAPIVisitorBase<Derived>::WalkUpFromCXXRecordDecl( |
410 | 19 | const CXXRecordDecl *Decl) { |
411 | 19 | getDerivedExtractAPIVisitor().VisitCXXRecordDecl(Decl); |
412 | 19 | return true; |
413 | 19 | } ExtractAPIConsumer.cpp:clang::extractapi::impl::ExtractAPIVisitorBase<(anonymous namespace)::BatchExtractAPIVisitor>::WalkUpFromCXXRecordDecl(clang::CXXRecordDecl const*) Line | Count | Source | 410 | 19 | const CXXRecordDecl *Decl) { | 411 | 19 | getDerivedExtractAPIVisitor().VisitCXXRecordDecl(Decl); | 412 | 19 | return true; | 413 | 19 | } |
Unexecuted instantiation: clang::extractapi::impl::ExtractAPIVisitorBase<clang::extractapi::ExtractAPIVisitor<void> >::WalkUpFromCXXRecordDecl(clang::CXXRecordDecl const*) Unexecuted instantiation: CXExtractAPI.cpp:clang::extractapi::impl::ExtractAPIVisitorBase<(anonymous namespace)::LibClangExtractAPIVisitor>::WalkUpFromCXXRecordDecl(clang::CXXRecordDecl const*) |
414 | | |
415 | | template <typename Derived> |
416 | | bool ExtractAPIVisitorBase<Derived>::WalkUpFromCXXMethodDecl( |
417 | 12 | const CXXMethodDecl *Decl) { |
418 | 12 | getDerivedExtractAPIVisitor().VisitCXXMethodDecl(Decl); |
419 | 12 | return true; |
420 | 12 | } ExtractAPIConsumer.cpp:clang::extractapi::impl::ExtractAPIVisitorBase<(anonymous namespace)::BatchExtractAPIVisitor>::WalkUpFromCXXMethodDecl(clang::CXXMethodDecl const*) Line | Count | Source | 417 | 12 | const CXXMethodDecl *Decl) { | 418 | 12 | getDerivedExtractAPIVisitor().VisitCXXMethodDecl(Decl); | 419 | 12 | return true; | 420 | 12 | } |
Unexecuted instantiation: clang::extractapi::impl::ExtractAPIVisitorBase<clang::extractapi::ExtractAPIVisitor<void> >::WalkUpFromCXXMethodDecl(clang::CXXMethodDecl const*) Unexecuted instantiation: CXExtractAPI.cpp:clang::extractapi::impl::ExtractAPIVisitorBase<(anonymous namespace)::LibClangExtractAPIVisitor>::WalkUpFromCXXMethodDecl(clang::CXXMethodDecl const*) |
421 | | |
422 | | template <typename Derived> |
423 | | bool ExtractAPIVisitorBase<Derived>::WalkUpFromClassTemplateSpecializationDecl( |
424 | 1 | const ClassTemplateSpecializationDecl *Decl) { |
425 | 1 | getDerivedExtractAPIVisitor().VisitClassTemplateSpecializationDecl(Decl); |
426 | 1 | return true; |
427 | 1 | } ExtractAPIConsumer.cpp:clang::extractapi::impl::ExtractAPIVisitorBase<(anonymous namespace)::BatchExtractAPIVisitor>::WalkUpFromClassTemplateSpecializationDecl(clang::ClassTemplateSpecializationDecl const*) Line | Count | Source | 424 | 1 | const ClassTemplateSpecializationDecl *Decl) { | 425 | 1 | getDerivedExtractAPIVisitor().VisitClassTemplateSpecializationDecl(Decl); | 426 | 1 | return true; | 427 | 1 | } |
Unexecuted instantiation: clang::extractapi::impl::ExtractAPIVisitorBase<clang::extractapi::ExtractAPIVisitor<void> >::WalkUpFromClassTemplateSpecializationDecl(clang::ClassTemplateSpecializationDecl const*) Unexecuted instantiation: CXExtractAPI.cpp:clang::extractapi::impl::ExtractAPIVisitorBase<(anonymous namespace)::LibClangExtractAPIVisitor>::WalkUpFromClassTemplateSpecializationDecl(clang::ClassTemplateSpecializationDecl const*) |
428 | | |
429 | | template <typename Derived> |
430 | | bool ExtractAPIVisitorBase<Derived>:: |
431 | | WalkUpFromClassTemplatePartialSpecializationDecl( |
432 | 1 | const ClassTemplatePartialSpecializationDecl *Decl) { |
433 | 1 | getDerivedExtractAPIVisitor().VisitClassTemplatePartialSpecializationDecl( |
434 | 1 | Decl); |
435 | 1 | return true; |
436 | 1 | } ExtractAPIConsumer.cpp:clang::extractapi::impl::ExtractAPIVisitorBase<(anonymous namespace)::BatchExtractAPIVisitor>::WalkUpFromClassTemplatePartialSpecializationDecl(clang::ClassTemplatePartialSpecializationDecl const*) Line | Count | Source | 432 | 1 | const ClassTemplatePartialSpecializationDecl *Decl) { | 433 | 1 | getDerivedExtractAPIVisitor().VisitClassTemplatePartialSpecializationDecl( | 434 | 1 | Decl); | 435 | 1 | return true; | 436 | 1 | } |
Unexecuted instantiation: clang::extractapi::impl::ExtractAPIVisitorBase<clang::extractapi::ExtractAPIVisitor<void> >::WalkUpFromClassTemplatePartialSpecializationDecl(clang::ClassTemplatePartialSpecializationDecl const*) Unexecuted instantiation: CXExtractAPI.cpp:clang::extractapi::impl::ExtractAPIVisitorBase<(anonymous namespace)::LibClangExtractAPIVisitor>::WalkUpFromClassTemplatePartialSpecializationDecl(clang::ClassTemplatePartialSpecializationDecl const*) |
437 | | |
438 | | template <typename Derived> |
439 | | bool ExtractAPIVisitorBase<Derived>::WalkUpFromVarTemplateDecl( |
440 | 4 | const VarTemplateDecl *Decl) { |
441 | 4 | getDerivedExtractAPIVisitor().VisitVarTemplateDecl(Decl); |
442 | 4 | return true; |
443 | 4 | } ExtractAPIConsumer.cpp:clang::extractapi::impl::ExtractAPIVisitorBase<(anonymous namespace)::BatchExtractAPIVisitor>::WalkUpFromVarTemplateDecl(clang::VarTemplateDecl const*) Line | Count | Source | 440 | 4 | const VarTemplateDecl *Decl) { | 441 | 4 | getDerivedExtractAPIVisitor().VisitVarTemplateDecl(Decl); | 442 | 4 | return true; | 443 | 4 | } |
Unexecuted instantiation: clang::extractapi::impl::ExtractAPIVisitorBase<clang::extractapi::ExtractAPIVisitor<void> >::WalkUpFromVarTemplateDecl(clang::VarTemplateDecl const*) Unexecuted instantiation: CXExtractAPI.cpp:clang::extractapi::impl::ExtractAPIVisitorBase<(anonymous namespace)::LibClangExtractAPIVisitor>::WalkUpFromVarTemplateDecl(clang::VarTemplateDecl const*) |
444 | | |
445 | | template <typename Derived> |
446 | | bool ExtractAPIVisitorBase<Derived>::WalkUpFromVarTemplateSpecializationDecl( |
447 | 1 | const VarTemplateSpecializationDecl *Decl) { |
448 | 1 | getDerivedExtractAPIVisitor().VisitVarTemplateSpecializationDecl(Decl); |
449 | 1 | return true; |
450 | 1 | } ExtractAPIConsumer.cpp:clang::extractapi::impl::ExtractAPIVisitorBase<(anonymous namespace)::BatchExtractAPIVisitor>::WalkUpFromVarTemplateSpecializationDecl(clang::VarTemplateSpecializationDecl const*) Line | Count | Source | 447 | 1 | const VarTemplateSpecializationDecl *Decl) { | 448 | 1 | getDerivedExtractAPIVisitor().VisitVarTemplateSpecializationDecl(Decl); | 449 | 1 | return true; | 450 | 1 | } |
Unexecuted instantiation: clang::extractapi::impl::ExtractAPIVisitorBase<clang::extractapi::ExtractAPIVisitor<void> >::WalkUpFromVarTemplateSpecializationDecl(clang::VarTemplateSpecializationDecl const*) Unexecuted instantiation: CXExtractAPI.cpp:clang::extractapi::impl::ExtractAPIVisitorBase<(anonymous namespace)::LibClangExtractAPIVisitor>::WalkUpFromVarTemplateSpecializationDecl(clang::VarTemplateSpecializationDecl const*) |
451 | | |
452 | | template <typename Derived> |
453 | | bool ExtractAPIVisitorBase<Derived>:: |
454 | | WalkUpFromVarTemplatePartialSpecializationDecl( |
455 | 1 | const VarTemplatePartialSpecializationDecl *Decl) { |
456 | 1 | getDerivedExtractAPIVisitor().VisitVarTemplatePartialSpecializationDecl(Decl); |
457 | 1 | return true; |
458 | 1 | } ExtractAPIConsumer.cpp:clang::extractapi::impl::ExtractAPIVisitorBase<(anonymous namespace)::BatchExtractAPIVisitor>::WalkUpFromVarTemplatePartialSpecializationDecl(clang::VarTemplatePartialSpecializationDecl const*) Line | Count | Source | 455 | 1 | const VarTemplatePartialSpecializationDecl *Decl) { | 456 | 1 | getDerivedExtractAPIVisitor().VisitVarTemplatePartialSpecializationDecl(Decl); | 457 | 1 | return true; | 458 | 1 | } |
Unexecuted instantiation: clang::extractapi::impl::ExtractAPIVisitorBase<clang::extractapi::ExtractAPIVisitor<void> >::WalkUpFromVarTemplatePartialSpecializationDecl(clang::VarTemplatePartialSpecializationDecl const*) Unexecuted instantiation: CXExtractAPI.cpp:clang::extractapi::impl::ExtractAPIVisitorBase<(anonymous namespace)::LibClangExtractAPIVisitor>::WalkUpFromVarTemplatePartialSpecializationDecl(clang::VarTemplatePartialSpecializationDecl const*) |
459 | | |
460 | | template <typename Derived> |
461 | | bool ExtractAPIVisitorBase<Derived>::WalkUpFromFunctionTemplateDecl( |
462 | 5 | const FunctionTemplateDecl *Decl) { |
463 | 5 | getDerivedExtractAPIVisitor().VisitFunctionTemplateDecl(Decl); |
464 | 5 | return true; |
465 | 5 | } ExtractAPIConsumer.cpp:clang::extractapi::impl::ExtractAPIVisitorBase<(anonymous namespace)::BatchExtractAPIVisitor>::WalkUpFromFunctionTemplateDecl(clang::FunctionTemplateDecl const*) Line | Count | Source | 462 | 5 | const FunctionTemplateDecl *Decl) { | 463 | 5 | getDerivedExtractAPIVisitor().VisitFunctionTemplateDecl(Decl); | 464 | 5 | return true; | 465 | 5 | } |
Unexecuted instantiation: clang::extractapi::impl::ExtractAPIVisitorBase<clang::extractapi::ExtractAPIVisitor<void> >::WalkUpFromFunctionTemplateDecl(clang::FunctionTemplateDecl const*) Unexecuted instantiation: CXExtractAPI.cpp:clang::extractapi::impl::ExtractAPIVisitorBase<(anonymous namespace)::LibClangExtractAPIVisitor>::WalkUpFromFunctionTemplateDecl(clang::FunctionTemplateDecl const*) |
466 | | |
467 | | template <typename Derived> |
468 | | bool ExtractAPIVisitorBase<Derived>::WalkUpFromNamespaceDecl( |
469 | 3 | const NamespaceDecl *Decl) { |
470 | 3 | getDerivedExtractAPIVisitor().VisitNamespaceDecl(Decl); |
471 | 3 | return true; |
472 | 3 | } ExtractAPIConsumer.cpp:clang::extractapi::impl::ExtractAPIVisitorBase<(anonymous namespace)::BatchExtractAPIVisitor>::WalkUpFromNamespaceDecl(clang::NamespaceDecl const*) Line | Count | Source | 469 | 3 | const NamespaceDecl *Decl) { | 470 | 3 | getDerivedExtractAPIVisitor().VisitNamespaceDecl(Decl); | 471 | 3 | return true; | 472 | 3 | } |
Unexecuted instantiation: clang::extractapi::impl::ExtractAPIVisitorBase<clang::extractapi::ExtractAPIVisitor<void> >::WalkUpFromNamespaceDecl(clang::NamespaceDecl const*) Unexecuted instantiation: CXExtractAPI.cpp:clang::extractapi::impl::ExtractAPIVisitorBase<(anonymous namespace)::LibClangExtractAPIVisitor>::WalkUpFromNamespaceDecl(clang::NamespaceDecl const*) |
473 | | |
474 | | template <typename Derived> |
475 | | bool ExtractAPIVisitorBase<Derived>::VisitNamespaceDecl( |
476 | 3 | const NamespaceDecl *Decl) { |
477 | | |
478 | 3 | if (!getDerivedExtractAPIVisitor().shouldDeclBeIncluded(Decl)) |
479 | 0 | return true; |
480 | 3 | if (Decl->isAnonymousNamespace()) |
481 | 0 | return true; |
482 | 3 | StringRef Name = Decl->getName(); |
483 | 3 | StringRef USR = API.recordUSR(Decl); |
484 | 3 | LinkageInfo Linkage = Decl->getLinkageAndVisibility(); |
485 | 3 | PresumedLoc Loc = |
486 | 3 | Context.getSourceManager().getPresumedLoc(Decl->getLocation()); |
487 | 3 | DocComment Comment; |
488 | 3 | if (auto *RawComment = |
489 | 3 | getDerivedExtractAPIVisitor().fetchRawCommentForDecl(Decl)) |
490 | 0 | Comment = RawComment->getFormattedLines(Context.getSourceManager(), |
491 | 0 | Context.getDiagnostics()); |
492 | | |
493 | | // Build declaration fragments and sub-heading for the struct. |
494 | 3 | DeclarationFragments Declaration = |
495 | 3 | DeclarationFragmentsBuilder::getFragmentsForNamespace(Decl); |
496 | 3 | DeclarationFragments SubHeading = |
497 | 3 | DeclarationFragmentsBuilder::getSubHeading(Decl); |
498 | 3 | APIRecord *Parent = determineParentRecord(Decl->getDeclContext()); |
499 | 3 | API.addNamespace(Parent, Name, USR, Loc, AvailabilitySet(Decl), Linkage, |
500 | 3 | Comment, Declaration, SubHeading, isInSystemHeader(Decl)); |
501 | | |
502 | 3 | return true; |
503 | 3 | } ExtractAPIConsumer.cpp:clang::extractapi::impl::ExtractAPIVisitorBase<(anonymous namespace)::BatchExtractAPIVisitor>::VisitNamespaceDecl(clang::NamespaceDecl const*) Line | Count | Source | 476 | 3 | const NamespaceDecl *Decl) { | 477 | | | 478 | 3 | if (!getDerivedExtractAPIVisitor().shouldDeclBeIncluded(Decl)) | 479 | 0 | return true; | 480 | 3 | if (Decl->isAnonymousNamespace()) | 481 | 0 | return true; | 482 | 3 | StringRef Name = Decl->getName(); | 483 | 3 | StringRef USR = API.recordUSR(Decl); | 484 | 3 | LinkageInfo Linkage = Decl->getLinkageAndVisibility(); | 485 | 3 | PresumedLoc Loc = | 486 | 3 | Context.getSourceManager().getPresumedLoc(Decl->getLocation()); | 487 | 3 | DocComment Comment; | 488 | 3 | if (auto *RawComment = | 489 | 3 | getDerivedExtractAPIVisitor().fetchRawCommentForDecl(Decl)) | 490 | 0 | Comment = RawComment->getFormattedLines(Context.getSourceManager(), | 491 | 0 | Context.getDiagnostics()); | 492 | | | 493 | | // Build declaration fragments and sub-heading for the struct. | 494 | 3 | DeclarationFragments Declaration = | 495 | 3 | DeclarationFragmentsBuilder::getFragmentsForNamespace(Decl); | 496 | 3 | DeclarationFragments SubHeading = | 497 | 3 | DeclarationFragmentsBuilder::getSubHeading(Decl); | 498 | 3 | APIRecord *Parent = determineParentRecord(Decl->getDeclContext()); | 499 | 3 | API.addNamespace(Parent, Name, USR, Loc, AvailabilitySet(Decl), Linkage, | 500 | 3 | Comment, Declaration, SubHeading, isInSystemHeader(Decl)); | 501 | | | 502 | 3 | return true; | 503 | 3 | } |
Unexecuted instantiation: clang::extractapi::impl::ExtractAPIVisitorBase<clang::extractapi::ExtractAPIVisitor<void> >::VisitNamespaceDecl(clang::NamespaceDecl const*) Unexecuted instantiation: CXExtractAPI.cpp:clang::extractapi::impl::ExtractAPIVisitorBase<(anonymous namespace)::LibClangExtractAPIVisitor>::VisitNamespaceDecl(clang::NamespaceDecl const*) |
504 | | |
505 | | template <typename Derived> |
506 | 24 | bool ExtractAPIVisitorBase<Derived>::VisitRecordDecl(const RecordDecl *Decl) { |
507 | 24 | if (!getDerivedExtractAPIVisitor().shouldDeclBeIncluded(Decl)) |
508 | 2 | return true; |
509 | | // Collect symbol information. |
510 | 22 | StringRef Name = Decl->getName(); |
511 | 22 | if (Name.empty()) |
512 | 3 | Name = getTypedefName(Decl); |
513 | 22 | if (Name.empty()) |
514 | 1 | return true; |
515 | | |
516 | 21 | StringRef USR = API.recordUSR(Decl); |
517 | 21 | PresumedLoc Loc = |
518 | 21 | Context.getSourceManager().getPresumedLoc(Decl->getLocation()); |
519 | 21 | DocComment Comment; |
520 | 21 | if (auto *RawComment = |
521 | 21 | getDerivedExtractAPIVisitor().fetchRawCommentForDecl(Decl)) |
522 | 15 | Comment = RawComment->getFormattedLines(Context.getSourceManager(), |
523 | 15 | Context.getDiagnostics()); |
524 | | |
525 | | // Build declaration fragments and sub-heading for the struct. |
526 | 21 | DeclarationFragments Declaration = |
527 | 21 | DeclarationFragmentsBuilder::getFragmentsForStruct(Decl); |
528 | 21 | DeclarationFragments SubHeading = |
529 | 21 | DeclarationFragmentsBuilder::getSubHeading(Decl); |
530 | | |
531 | 21 | StructRecord *StructRecord = |
532 | 21 | API.addStruct(Name, USR, Loc, AvailabilitySet(Decl), Comment, Declaration, |
533 | 21 | SubHeading, isInSystemHeader(Decl)); |
534 | | |
535 | | // Now collect information about the fields in this struct. |
536 | 21 | getDerivedExtractAPIVisitor().recordStructFields(StructRecord, |
537 | 21 | Decl->fields()); |
538 | | |
539 | 21 | return true; |
540 | 22 | } ExtractAPIConsumer.cpp:clang::extractapi::impl::ExtractAPIVisitorBase<(anonymous namespace)::BatchExtractAPIVisitor>::VisitRecordDecl(clang::RecordDecl const*) Line | Count | Source | 506 | 11 | bool ExtractAPIVisitorBase<Derived>::VisitRecordDecl(const RecordDecl *Decl) { | 507 | 11 | if (!getDerivedExtractAPIVisitor().shouldDeclBeIncluded(Decl)) | 508 | 2 | return true; | 509 | | // Collect symbol information. | 510 | 9 | StringRef Name = Decl->getName(); | 511 | 9 | if (Name.empty()) | 512 | 3 | Name = getTypedefName(Decl); | 513 | 9 | if (Name.empty()) | 514 | 1 | return true; | 515 | | | 516 | 8 | StringRef USR = API.recordUSR(Decl); | 517 | 8 | PresumedLoc Loc = | 518 | 8 | Context.getSourceManager().getPresumedLoc(Decl->getLocation()); | 519 | 8 | DocComment Comment; | 520 | 8 | if (auto *RawComment = | 521 | 8 | getDerivedExtractAPIVisitor().fetchRawCommentForDecl(Decl)) | 522 | 2 | Comment = RawComment->getFormattedLines(Context.getSourceManager(), | 523 | 2 | Context.getDiagnostics()); | 524 | | | 525 | | // Build declaration fragments and sub-heading for the struct. | 526 | 8 | DeclarationFragments Declaration = | 527 | 8 | DeclarationFragmentsBuilder::getFragmentsForStruct(Decl); | 528 | 8 | DeclarationFragments SubHeading = | 529 | 8 | DeclarationFragmentsBuilder::getSubHeading(Decl); | 530 | | | 531 | 8 | StructRecord *StructRecord = | 532 | 8 | API.addStruct(Name, USR, Loc, AvailabilitySet(Decl), Comment, Declaration, | 533 | 8 | SubHeading, isInSystemHeader(Decl)); | 534 | | | 535 | | // Now collect information about the fields in this struct. | 536 | 8 | getDerivedExtractAPIVisitor().recordStructFields(StructRecord, | 537 | 8 | Decl->fields()); | 538 | | | 539 | 8 | return true; | 540 | 9 | } |
Unexecuted instantiation: clang::extractapi::impl::ExtractAPIVisitorBase<clang::extractapi::ExtractAPIVisitor<void> >::VisitRecordDecl(clang::RecordDecl const*) CXExtractAPI.cpp:clang::extractapi::impl::ExtractAPIVisitorBase<(anonymous namespace)::LibClangExtractAPIVisitor>::VisitRecordDecl(clang::RecordDecl const*) Line | Count | Source | 506 | 13 | bool ExtractAPIVisitorBase<Derived>::VisitRecordDecl(const RecordDecl *Decl) { | 507 | 13 | if (!getDerivedExtractAPIVisitor().shouldDeclBeIncluded(Decl)) | 508 | 0 | return true; | 509 | | // Collect symbol information. | 510 | 13 | StringRef Name = Decl->getName(); | 511 | 13 | if (Name.empty()) | 512 | 0 | Name = getTypedefName(Decl); | 513 | 13 | if (Name.empty()) | 514 | 0 | return true; | 515 | | | 516 | 13 | StringRef USR = API.recordUSR(Decl); | 517 | 13 | PresumedLoc Loc = | 518 | 13 | Context.getSourceManager().getPresumedLoc(Decl->getLocation()); | 519 | 13 | DocComment Comment; | 520 | 13 | if (auto *RawComment = | 521 | 13 | getDerivedExtractAPIVisitor().fetchRawCommentForDecl(Decl)) | 522 | 13 | Comment = RawComment->getFormattedLines(Context.getSourceManager(), | 523 | 13 | Context.getDiagnostics()); | 524 | | | 525 | | // Build declaration fragments and sub-heading for the struct. | 526 | 13 | DeclarationFragments Declaration = | 527 | 13 | DeclarationFragmentsBuilder::getFragmentsForStruct(Decl); | 528 | 13 | DeclarationFragments SubHeading = | 529 | 13 | DeclarationFragmentsBuilder::getSubHeading(Decl); | 530 | | | 531 | 13 | StructRecord *StructRecord = | 532 | 13 | API.addStruct(Name, USR, Loc, AvailabilitySet(Decl), Comment, Declaration, | 533 | 13 | SubHeading, isInSystemHeader(Decl)); | 534 | | | 535 | | // Now collect information about the fields in this struct. | 536 | 13 | getDerivedExtractAPIVisitor().recordStructFields(StructRecord, | 537 | 13 | Decl->fields()); | 538 | | | 539 | 13 | return true; | 540 | 13 | } |
|
541 | | |
542 | | template <typename Derived> |
543 | | bool ExtractAPIVisitorBase<Derived>::VisitCXXRecordDecl( |
544 | 19 | const CXXRecordDecl *Decl) { |
545 | 19 | if (!getDerivedExtractAPIVisitor().shouldDeclBeIncluded(Decl) || |
546 | 19 | Decl->isImplicit()) |
547 | 0 | return true; |
548 | | |
549 | 19 | StringRef Name = Decl->getName(); |
550 | 19 | StringRef USR = API.recordUSR(Decl); |
551 | 19 | PresumedLoc Loc = |
552 | 19 | Context.getSourceManager().getPresumedLoc(Decl->getLocation()); |
553 | 19 | DocComment Comment; |
554 | 19 | if (auto *RawComment = |
555 | 19 | getDerivedExtractAPIVisitor().fetchRawCommentForDecl(Decl)) |
556 | 0 | Comment = RawComment->getFormattedLines(Context.getSourceManager(), |
557 | 0 | Context.getDiagnostics()); |
558 | 19 | DeclarationFragments Declaration = |
559 | 19 | DeclarationFragmentsBuilder::getFragmentsForCXXClass(Decl); |
560 | 19 | DeclarationFragments SubHeading = |
561 | 19 | DeclarationFragmentsBuilder::getSubHeading(Decl); |
562 | | |
563 | 19 | APIRecord::RecordKind Kind; |
564 | 19 | if (Decl->isUnion()) |
565 | 0 | Kind = APIRecord::RecordKind::RK_Union; |
566 | 19 | else if (Decl->isStruct()) |
567 | 0 | Kind = APIRecord::RecordKind::RK_Struct; |
568 | 19 | else |
569 | 19 | Kind = APIRecord::RecordKind::RK_CXXClass; |
570 | 19 | auto Access = DeclarationFragmentsBuilder::getAccessControl(Decl); |
571 | | |
572 | 19 | APIRecord *Parent = determineParentRecord(Decl->getDeclContext()); |
573 | 19 | CXXClassRecord *CXXClassRecord; |
574 | 19 | if (Decl->getDescribedClassTemplate()) { |
575 | | // Inject template fragments before class fragments. |
576 | 4 | Declaration.insert( |
577 | 4 | Declaration.begin(), |
578 | 4 | DeclarationFragmentsBuilder::getFragmentsForRedeclarableTemplate( |
579 | 4 | Decl->getDescribedClassTemplate())); |
580 | 4 | CXXClassRecord = API.addClassTemplate( |
581 | 4 | Parent, Name, USR, Loc, AvailabilitySet(Decl), Comment, Declaration, |
582 | 4 | SubHeading, Template(Decl->getDescribedClassTemplate()), Access, |
583 | 4 | isInSystemHeader(Decl)); |
584 | 4 | } else |
585 | 15 | CXXClassRecord = API.addCXXClass( |
586 | 15 | Parent, Name, USR, Loc, AvailabilitySet(Decl), Comment, Declaration, |
587 | 15 | SubHeading, Kind, Access, isInSystemHeader(Decl)); |
588 | | |
589 | 19 | CXXClassRecord->Bases = getBases(Decl); |
590 | | |
591 | 19 | return true; |
592 | 19 | } ExtractAPIConsumer.cpp:clang::extractapi::impl::ExtractAPIVisitorBase<(anonymous namespace)::BatchExtractAPIVisitor>::VisitCXXRecordDecl(clang::CXXRecordDecl const*) Line | Count | Source | 544 | 19 | const CXXRecordDecl *Decl) { | 545 | 19 | if (!getDerivedExtractAPIVisitor().shouldDeclBeIncluded(Decl) || | 546 | 19 | Decl->isImplicit()) | 547 | 0 | return true; | 548 | | | 549 | 19 | StringRef Name = Decl->getName(); | 550 | 19 | StringRef USR = API.recordUSR(Decl); | 551 | 19 | PresumedLoc Loc = | 552 | 19 | Context.getSourceManager().getPresumedLoc(Decl->getLocation()); | 553 | 19 | DocComment Comment; | 554 | 19 | if (auto *RawComment = | 555 | 19 | getDerivedExtractAPIVisitor().fetchRawCommentForDecl(Decl)) | 556 | 0 | Comment = RawComment->getFormattedLines(Context.getSourceManager(), | 557 | 0 | Context.getDiagnostics()); | 558 | 19 | DeclarationFragments Declaration = | 559 | 19 | DeclarationFragmentsBuilder::getFragmentsForCXXClass(Decl); | 560 | 19 | DeclarationFragments SubHeading = | 561 | 19 | DeclarationFragmentsBuilder::getSubHeading(Decl); | 562 | | | 563 | 19 | APIRecord::RecordKind Kind; | 564 | 19 | if (Decl->isUnion()) | 565 | 0 | Kind = APIRecord::RecordKind::RK_Union; | 566 | 19 | else if (Decl->isStruct()) | 567 | 0 | Kind = APIRecord::RecordKind::RK_Struct; | 568 | 19 | else | 569 | 19 | Kind = APIRecord::RecordKind::RK_CXXClass; | 570 | 19 | auto Access = DeclarationFragmentsBuilder::getAccessControl(Decl); | 571 | | | 572 | 19 | APIRecord *Parent = determineParentRecord(Decl->getDeclContext()); | 573 | 19 | CXXClassRecord *CXXClassRecord; | 574 | 19 | if (Decl->getDescribedClassTemplate()) { | 575 | | // Inject template fragments before class fragments. | 576 | 4 | Declaration.insert( | 577 | 4 | Declaration.begin(), | 578 | 4 | DeclarationFragmentsBuilder::getFragmentsForRedeclarableTemplate( | 579 | 4 | Decl->getDescribedClassTemplate())); | 580 | 4 | CXXClassRecord = API.addClassTemplate( | 581 | 4 | Parent, Name, USR, Loc, AvailabilitySet(Decl), Comment, Declaration, | 582 | 4 | SubHeading, Template(Decl->getDescribedClassTemplate()), Access, | 583 | 4 | isInSystemHeader(Decl)); | 584 | 4 | } else | 585 | 15 | CXXClassRecord = API.addCXXClass( | 586 | 15 | Parent, Name, USR, Loc, AvailabilitySet(Decl), Comment, Declaration, | 587 | 15 | SubHeading, Kind, Access, isInSystemHeader(Decl)); | 588 | | | 589 | 19 | CXXClassRecord->Bases = getBases(Decl); | 590 | | | 591 | 19 | return true; | 592 | 19 | } |
Unexecuted instantiation: clang::extractapi::impl::ExtractAPIVisitorBase<clang::extractapi::ExtractAPIVisitor<void> >::VisitCXXRecordDecl(clang::CXXRecordDecl const*) Unexecuted instantiation: CXExtractAPI.cpp:clang::extractapi::impl::ExtractAPIVisitorBase<(anonymous namespace)::LibClangExtractAPIVisitor>::VisitCXXRecordDecl(clang::CXXRecordDecl const*) |
593 | | |
594 | | template <typename Derived> |
595 | | bool ExtractAPIVisitorBase<Derived>::VisitCXXMethodDecl( |
596 | 12 | const CXXMethodDecl *Decl) { |
597 | 12 | if (!getDerivedExtractAPIVisitor().shouldDeclBeIncluded(Decl) || |
598 | 12 | Decl->isImplicit()) |
599 | 0 | return true; |
600 | | |
601 | 12 | if (isa<CXXConversionDecl>(Decl)) |
602 | 2 | return true; |
603 | 10 | if (isa<CXXConstructorDecl>(Decl) || isa<CXXDestructorDecl>(Decl)9 ) |
604 | 2 | return true; |
605 | | |
606 | 8 | StringRef USR = API.recordUSR(Decl); |
607 | 8 | PresumedLoc Loc = |
608 | 8 | Context.getSourceManager().getPresumedLoc(Decl->getLocation()); |
609 | 8 | DocComment Comment; |
610 | 8 | if (auto *RawComment = |
611 | 8 | getDerivedExtractAPIVisitor().fetchRawCommentForDecl(Decl)) |
612 | 0 | Comment = RawComment->getFormattedLines(Context.getSourceManager(), |
613 | 0 | Context.getDiagnostics()); |
614 | 8 | DeclarationFragments SubHeading = |
615 | 8 | DeclarationFragmentsBuilder::getSubHeading(Decl); |
616 | 8 | auto Access = DeclarationFragmentsBuilder::getAccessControl(Decl); |
617 | 8 | auto Signature = DeclarationFragmentsBuilder::getFunctionSignature(Decl); |
618 | | |
619 | 8 | SmallString<128> ParentUSR; |
620 | 8 | index::generateUSRForDecl(dyn_cast<CXXRecordDecl>(Decl->getDeclContext()), |
621 | 8 | ParentUSR); |
622 | 8 | auto *Parent = API.findRecordForUSR(ParentUSR); |
623 | 8 | if (Decl->isTemplated()) { |
624 | 2 | FunctionTemplateDecl *TemplateDecl = Decl->getDescribedFunctionTemplate(); |
625 | 2 | API.addCXXMethodTemplate( |
626 | 2 | API.findRecordForUSR(ParentUSR), Decl->getName(), USR, Loc, |
627 | 2 | AvailabilitySet(Decl), Comment, |
628 | 2 | DeclarationFragmentsBuilder::getFragmentsForFunctionTemplate( |
629 | 2 | TemplateDecl), |
630 | 2 | SubHeading, DeclarationFragmentsBuilder::getFunctionSignature(Decl), |
631 | 2 | DeclarationFragmentsBuilder::getAccessControl(TemplateDecl), |
632 | 2 | Template(TemplateDecl), isInSystemHeader(Decl)); |
633 | 6 | } else if (Decl->getTemplateSpecializationInfo()) |
634 | 1 | API.addCXXMethodTemplateSpec( |
635 | 1 | Parent, Decl->getName(), USR, Loc, AvailabilitySet(Decl), Comment, |
636 | 1 | DeclarationFragmentsBuilder:: |
637 | 1 | getFragmentsForFunctionTemplateSpecialization(Decl), |
638 | 1 | SubHeading, Signature, Access, isInSystemHeader(Decl)); |
639 | 5 | else if (Decl->isOverloadedOperator()) |
640 | 1 | API.addCXXInstanceMethod( |
641 | 1 | Parent, API.copyString(Decl->getNameAsString()), USR, Loc, |
642 | 1 | AvailabilitySet(Decl), Comment, |
643 | 1 | DeclarationFragmentsBuilder::getFragmentsForOverloadedOperator(Decl), |
644 | 1 | SubHeading, Signature, Access, isInSystemHeader(Decl)); |
645 | 4 | else if (Decl->isStatic()) |
646 | 1 | API.addCXXStaticMethod( |
647 | 1 | Parent, Decl->getName(), USR, Loc, AvailabilitySet(Decl), Comment, |
648 | 1 | DeclarationFragmentsBuilder::getFragmentsForCXXMethod(Decl), SubHeading, |
649 | 1 | Signature, Access, isInSystemHeader(Decl)); |
650 | 3 | else |
651 | 3 | API.addCXXInstanceMethod( |
652 | 3 | Parent, Decl->getName(), USR, Loc, AvailabilitySet(Decl), Comment, |
653 | 3 | DeclarationFragmentsBuilder::getFragmentsForCXXMethod(Decl), SubHeading, |
654 | 3 | Signature, Access, isInSystemHeader(Decl)); |
655 | | |
656 | 8 | return true; |
657 | 10 | } ExtractAPIConsumer.cpp:clang::extractapi::impl::ExtractAPIVisitorBase<(anonymous namespace)::BatchExtractAPIVisitor>::VisitCXXMethodDecl(clang::CXXMethodDecl const*) Line | Count | Source | 596 | 12 | const CXXMethodDecl *Decl) { | 597 | 12 | if (!getDerivedExtractAPIVisitor().shouldDeclBeIncluded(Decl) || | 598 | 12 | Decl->isImplicit()) | 599 | 0 | return true; | 600 | | | 601 | 12 | if (isa<CXXConversionDecl>(Decl)) | 602 | 2 | return true; | 603 | 10 | if (isa<CXXConstructorDecl>(Decl) || isa<CXXDestructorDecl>(Decl)9 ) | 604 | 2 | return true; | 605 | | | 606 | 8 | StringRef USR = API.recordUSR(Decl); | 607 | 8 | PresumedLoc Loc = | 608 | 8 | Context.getSourceManager().getPresumedLoc(Decl->getLocation()); | 609 | 8 | DocComment Comment; | 610 | 8 | if (auto *RawComment = | 611 | 8 | getDerivedExtractAPIVisitor().fetchRawCommentForDecl(Decl)) | 612 | 0 | Comment = RawComment->getFormattedLines(Context.getSourceManager(), | 613 | 0 | Context.getDiagnostics()); | 614 | 8 | DeclarationFragments SubHeading = | 615 | 8 | DeclarationFragmentsBuilder::getSubHeading(Decl); | 616 | 8 | auto Access = DeclarationFragmentsBuilder::getAccessControl(Decl); | 617 | 8 | auto Signature = DeclarationFragmentsBuilder::getFunctionSignature(Decl); | 618 | | | 619 | 8 | SmallString<128> ParentUSR; | 620 | 8 | index::generateUSRForDecl(dyn_cast<CXXRecordDecl>(Decl->getDeclContext()), | 621 | 8 | ParentUSR); | 622 | 8 | auto *Parent = API.findRecordForUSR(ParentUSR); | 623 | 8 | if (Decl->isTemplated()) { | 624 | 2 | FunctionTemplateDecl *TemplateDecl = Decl->getDescribedFunctionTemplate(); | 625 | 2 | API.addCXXMethodTemplate( | 626 | 2 | API.findRecordForUSR(ParentUSR), Decl->getName(), USR, Loc, | 627 | 2 | AvailabilitySet(Decl), Comment, | 628 | 2 | DeclarationFragmentsBuilder::getFragmentsForFunctionTemplate( | 629 | 2 | TemplateDecl), | 630 | 2 | SubHeading, DeclarationFragmentsBuilder::getFunctionSignature(Decl), | 631 | 2 | DeclarationFragmentsBuilder::getAccessControl(TemplateDecl), | 632 | 2 | Template(TemplateDecl), isInSystemHeader(Decl)); | 633 | 6 | } else if (Decl->getTemplateSpecializationInfo()) | 634 | 1 | API.addCXXMethodTemplateSpec( | 635 | 1 | Parent, Decl->getName(), USR, Loc, AvailabilitySet(Decl), Comment, | 636 | 1 | DeclarationFragmentsBuilder:: | 637 | 1 | getFragmentsForFunctionTemplateSpecialization(Decl), | 638 | 1 | SubHeading, Signature, Access, isInSystemHeader(Decl)); | 639 | 5 | else if (Decl->isOverloadedOperator()) | 640 | 1 | API.addCXXInstanceMethod( | 641 | 1 | Parent, API.copyString(Decl->getNameAsString()), USR, Loc, | 642 | 1 | AvailabilitySet(Decl), Comment, | 643 | 1 | DeclarationFragmentsBuilder::getFragmentsForOverloadedOperator(Decl), | 644 | 1 | SubHeading, Signature, Access, isInSystemHeader(Decl)); | 645 | 4 | else if (Decl->isStatic()) | 646 | 1 | API.addCXXStaticMethod( | 647 | 1 | Parent, Decl->getName(), USR, Loc, AvailabilitySet(Decl), Comment, | 648 | 1 | DeclarationFragmentsBuilder::getFragmentsForCXXMethod(Decl), SubHeading, | 649 | 1 | Signature, Access, isInSystemHeader(Decl)); | 650 | 3 | else | 651 | 3 | API.addCXXInstanceMethod( | 652 | 3 | Parent, Decl->getName(), USR, Loc, AvailabilitySet(Decl), Comment, | 653 | 3 | DeclarationFragmentsBuilder::getFragmentsForCXXMethod(Decl), SubHeading, | 654 | 3 | Signature, Access, isInSystemHeader(Decl)); | 655 | | | 656 | 8 | return true; | 657 | 10 | } |
Unexecuted instantiation: clang::extractapi::impl::ExtractAPIVisitorBase<clang::extractapi::ExtractAPIVisitor<void> >::VisitCXXMethodDecl(clang::CXXMethodDecl const*) Unexecuted instantiation: CXExtractAPI.cpp:clang::extractapi::impl::ExtractAPIVisitorBase<(anonymous namespace)::LibClangExtractAPIVisitor>::VisitCXXMethodDecl(clang::CXXMethodDecl const*) |
658 | | |
659 | | template <typename Derived> |
660 | | bool ExtractAPIVisitorBase<Derived>::VisitCXXConstructorDecl( |
661 | 1 | const CXXConstructorDecl *Decl) { |
662 | | |
663 | 1 | StringRef Name = API.copyString(Decl->getNameAsString()); |
664 | 1 | StringRef USR = API.recordUSR(Decl); |
665 | 1 | PresumedLoc Loc = |
666 | 1 | Context.getSourceManager().getPresumedLoc(Decl->getLocation()); |
667 | 1 | DocComment Comment; |
668 | 1 | if (auto *RawComment = |
669 | 1 | getDerivedExtractAPIVisitor().fetchRawCommentForDecl(Decl)) |
670 | 0 | Comment = RawComment->getFormattedLines(Context.getSourceManager(), |
671 | 0 | Context.getDiagnostics()); |
672 | | |
673 | | // Build declaration fragments, sub-heading, and signature for the method. |
674 | 1 | DeclarationFragments Declaration = |
675 | 1 | DeclarationFragmentsBuilder::getFragmentsForSpecialCXXMethod(Decl); |
676 | 1 | DeclarationFragments SubHeading = |
677 | 1 | DeclarationFragmentsBuilder::getSubHeading(Decl); |
678 | 1 | FunctionSignature Signature = |
679 | 1 | DeclarationFragmentsBuilder::getFunctionSignature(Decl); |
680 | 1 | AccessControl Access = DeclarationFragmentsBuilder::getAccessControl(Decl); |
681 | | |
682 | 1 | SmallString<128> ParentUSR; |
683 | 1 | index::generateUSRForDecl(dyn_cast<CXXRecordDecl>(Decl->getDeclContext()), |
684 | 1 | ParentUSR); |
685 | 1 | API.addCXXInstanceMethod(API.findRecordForUSR(ParentUSR), Name, USR, Loc, |
686 | 1 | AvailabilitySet(Decl), Comment, Declaration, |
687 | 1 | SubHeading, Signature, Access, |
688 | 1 | isInSystemHeader(Decl)); |
689 | 1 | return true; |
690 | 1 | } ExtractAPIConsumer.cpp:clang::extractapi::impl::ExtractAPIVisitorBase<(anonymous namespace)::BatchExtractAPIVisitor>::VisitCXXConstructorDecl(clang::CXXConstructorDecl const*) Line | Count | Source | 661 | 1 | const CXXConstructorDecl *Decl) { | 662 | | | 663 | 1 | StringRef Name = API.copyString(Decl->getNameAsString()); | 664 | 1 | StringRef USR = API.recordUSR(Decl); | 665 | 1 | PresumedLoc Loc = | 666 | 1 | Context.getSourceManager().getPresumedLoc(Decl->getLocation()); | 667 | 1 | DocComment Comment; | 668 | 1 | if (auto *RawComment = | 669 | 1 | getDerivedExtractAPIVisitor().fetchRawCommentForDecl(Decl)) | 670 | 0 | Comment = RawComment->getFormattedLines(Context.getSourceManager(), | 671 | 0 | Context.getDiagnostics()); | 672 | | | 673 | | // Build declaration fragments, sub-heading, and signature for the method. | 674 | 1 | DeclarationFragments Declaration = | 675 | 1 | DeclarationFragmentsBuilder::getFragmentsForSpecialCXXMethod(Decl); | 676 | 1 | DeclarationFragments SubHeading = | 677 | 1 | DeclarationFragmentsBuilder::getSubHeading(Decl); | 678 | 1 | FunctionSignature Signature = | 679 | 1 | DeclarationFragmentsBuilder::getFunctionSignature(Decl); | 680 | 1 | AccessControl Access = DeclarationFragmentsBuilder::getAccessControl(Decl); | 681 | | | 682 | 1 | SmallString<128> ParentUSR; | 683 | 1 | index::generateUSRForDecl(dyn_cast<CXXRecordDecl>(Decl->getDeclContext()), | 684 | 1 | ParentUSR); | 685 | 1 | API.addCXXInstanceMethod(API.findRecordForUSR(ParentUSR), Name, USR, Loc, | 686 | 1 | AvailabilitySet(Decl), Comment, Declaration, | 687 | 1 | SubHeading, Signature, Access, | 688 | 1 | isInSystemHeader(Decl)); | 689 | 1 | return true; | 690 | 1 | } |
Unexecuted instantiation: clang::extractapi::impl::ExtractAPIVisitorBase<clang::extractapi::ExtractAPIVisitor<void> >::VisitCXXConstructorDecl(clang::CXXConstructorDecl const*) Unexecuted instantiation: CXExtractAPI.cpp:clang::extractapi::impl::ExtractAPIVisitorBase<(anonymous namespace)::LibClangExtractAPIVisitor>::VisitCXXConstructorDecl(clang::CXXConstructorDecl const*) |
691 | | |
692 | | template <typename Derived> |
693 | | bool ExtractAPIVisitorBase<Derived>::VisitCXXDestructorDecl( |
694 | 1 | const CXXDestructorDecl *Decl) { |
695 | | |
696 | 1 | StringRef Name = API.copyString(Decl->getNameAsString()); |
697 | 1 | StringRef USR = API.recordUSR(Decl); |
698 | 1 | PresumedLoc Loc = |
699 | 1 | Context.getSourceManager().getPresumedLoc(Decl->getLocation()); |
700 | 1 | DocComment Comment; |
701 | 1 | if (auto *RawComment = |
702 | 1 | getDerivedExtractAPIVisitor().fetchRawCommentForDecl(Decl)) |
703 | 0 | Comment = RawComment->getFormattedLines(Context.getSourceManager(), |
704 | 0 | Context.getDiagnostics()); |
705 | | |
706 | | // Build declaration fragments, sub-heading, and signature for the method. |
707 | 1 | DeclarationFragments Declaration = |
708 | 1 | DeclarationFragmentsBuilder::getFragmentsForSpecialCXXMethod(Decl); |
709 | 1 | DeclarationFragments SubHeading = |
710 | 1 | DeclarationFragmentsBuilder::getSubHeading(Decl); |
711 | 1 | FunctionSignature Signature = |
712 | 1 | DeclarationFragmentsBuilder::getFunctionSignature(Decl); |
713 | 1 | AccessControl Access = DeclarationFragmentsBuilder::getAccessControl(Decl); |
714 | | |
715 | 1 | SmallString<128> ParentUSR; |
716 | 1 | index::generateUSRForDecl(dyn_cast<CXXRecordDecl>(Decl->getDeclContext()), |
717 | 1 | ParentUSR); |
718 | 1 | API.addCXXInstanceMethod(API.findRecordForUSR(ParentUSR), Name, USR, Loc, |
719 | 1 | AvailabilitySet(Decl), Comment, Declaration, |
720 | 1 | SubHeading, Signature, Access, |
721 | 1 | isInSystemHeader(Decl)); |
722 | 1 | return true; |
723 | 1 | } ExtractAPIConsumer.cpp:clang::extractapi::impl::ExtractAPIVisitorBase<(anonymous namespace)::BatchExtractAPIVisitor>::VisitCXXDestructorDecl(clang::CXXDestructorDecl const*) Line | Count | Source | 694 | 1 | const CXXDestructorDecl *Decl) { | 695 | | | 696 | 1 | StringRef Name = API.copyString(Decl->getNameAsString()); | 697 | 1 | StringRef USR = API.recordUSR(Decl); | 698 | 1 | PresumedLoc Loc = | 699 | 1 | Context.getSourceManager().getPresumedLoc(Decl->getLocation()); | 700 | 1 | DocComment Comment; | 701 | 1 | if (auto *RawComment = | 702 | 1 | getDerivedExtractAPIVisitor().fetchRawCommentForDecl(Decl)) | 703 | 0 | Comment = RawComment->getFormattedLines(Context.getSourceManager(), | 704 | 0 | Context.getDiagnostics()); | 705 | | | 706 | | // Build declaration fragments, sub-heading, and signature for the method. | 707 | 1 | DeclarationFragments Declaration = | 708 | 1 | DeclarationFragmentsBuilder::getFragmentsForSpecialCXXMethod(Decl); | 709 | 1 | DeclarationFragments SubHeading = | 710 | 1 | DeclarationFragmentsBuilder::getSubHeading(Decl); | 711 | 1 | FunctionSignature Signature = | 712 | 1 | DeclarationFragmentsBuilder::getFunctionSignature(Decl); | 713 | 1 | AccessControl Access = DeclarationFragmentsBuilder::getAccessControl(Decl); | 714 | | | 715 | 1 | SmallString<128> ParentUSR; | 716 | 1 | index::generateUSRForDecl(dyn_cast<CXXRecordDecl>(Decl->getDeclContext()), | 717 | 1 | ParentUSR); | 718 | 1 | API.addCXXInstanceMethod(API.findRecordForUSR(ParentUSR), Name, USR, Loc, | 719 | 1 | AvailabilitySet(Decl), Comment, Declaration, | 720 | 1 | SubHeading, Signature, Access, | 721 | 1 | isInSystemHeader(Decl)); | 722 | 1 | return true; | 723 | 1 | } |
Unexecuted instantiation: clang::extractapi::impl::ExtractAPIVisitorBase<clang::extractapi::ExtractAPIVisitor<void> >::VisitCXXDestructorDecl(clang::CXXDestructorDecl const*) Unexecuted instantiation: CXExtractAPI.cpp:clang::extractapi::impl::ExtractAPIVisitorBase<(anonymous namespace)::LibClangExtractAPIVisitor>::VisitCXXDestructorDecl(clang::CXXDestructorDecl const*) |
724 | | |
725 | | template <typename Derived> |
726 | 1 | bool ExtractAPIVisitorBase<Derived>::VisitConceptDecl(const ConceptDecl *Decl) { |
727 | 1 | if (!getDerivedExtractAPIVisitor().shouldDeclBeIncluded(Decl)) |
728 | 0 | return true; |
729 | | |
730 | 1 | StringRef Name = Decl->getName(); |
731 | 1 | StringRef USR = API.recordUSR(Decl); |
732 | 1 | PresumedLoc Loc = |
733 | 1 | Context.getSourceManager().getPresumedLoc(Decl->getLocation()); |
734 | 1 | DocComment Comment; |
735 | 1 | if (auto *RawComment = |
736 | 1 | getDerivedExtractAPIVisitor().fetchRawCommentForDecl(Decl)) |
737 | 0 | Comment = RawComment->getFormattedLines(Context.getSourceManager(), |
738 | 0 | Context.getDiagnostics()); |
739 | 1 | DeclarationFragments Declaration = |
740 | 1 | DeclarationFragmentsBuilder::getFragmentsForConcept(Decl); |
741 | 1 | DeclarationFragments SubHeading = |
742 | 1 | DeclarationFragmentsBuilder::getSubHeading(Decl); |
743 | 1 | API.addConcept(Name, USR, Loc, AvailabilitySet(Decl), Comment, Declaration, |
744 | 1 | SubHeading, Template(Decl), isInSystemHeader(Decl)); |
745 | 1 | return true; |
746 | 1 | } ExtractAPIConsumer.cpp:clang::extractapi::impl::ExtractAPIVisitorBase<(anonymous namespace)::BatchExtractAPIVisitor>::VisitConceptDecl(clang::ConceptDecl const*) Line | Count | Source | 726 | 1 | bool ExtractAPIVisitorBase<Derived>::VisitConceptDecl(const ConceptDecl *Decl) { | 727 | 1 | if (!getDerivedExtractAPIVisitor().shouldDeclBeIncluded(Decl)) | 728 | 0 | return true; | 729 | | | 730 | 1 | StringRef Name = Decl->getName(); | 731 | 1 | StringRef USR = API.recordUSR(Decl); | 732 | 1 | PresumedLoc Loc = | 733 | 1 | Context.getSourceManager().getPresumedLoc(Decl->getLocation()); | 734 | 1 | DocComment Comment; | 735 | 1 | if (auto *RawComment = | 736 | 1 | getDerivedExtractAPIVisitor().fetchRawCommentForDecl(Decl)) | 737 | 0 | Comment = RawComment->getFormattedLines(Context.getSourceManager(), | 738 | 0 | Context.getDiagnostics()); | 739 | 1 | DeclarationFragments Declaration = | 740 | 1 | DeclarationFragmentsBuilder::getFragmentsForConcept(Decl); | 741 | 1 | DeclarationFragments SubHeading = | 742 | 1 | DeclarationFragmentsBuilder::getSubHeading(Decl); | 743 | 1 | API.addConcept(Name, USR, Loc, AvailabilitySet(Decl), Comment, Declaration, | 744 | 1 | SubHeading, Template(Decl), isInSystemHeader(Decl)); | 745 | 1 | return true; | 746 | 1 | } |
Unexecuted instantiation: clang::extractapi::impl::ExtractAPIVisitorBase<clang::extractapi::ExtractAPIVisitor<void> >::VisitConceptDecl(clang::ConceptDecl const*) Unexecuted instantiation: CXExtractAPI.cpp:clang::extractapi::impl::ExtractAPIVisitorBase<(anonymous namespace)::LibClangExtractAPIVisitor>::VisitConceptDecl(clang::ConceptDecl const*) |
747 | | |
748 | | template <typename Derived> |
749 | | bool ExtractAPIVisitorBase<Derived>::VisitClassTemplateSpecializationDecl( |
750 | 1 | const ClassTemplateSpecializationDecl *Decl) { |
751 | 1 | if (!getDerivedExtractAPIVisitor().shouldDeclBeIncluded(Decl)) |
752 | 0 | return true; |
753 | | |
754 | 1 | StringRef Name = Decl->getName(); |
755 | 1 | StringRef USR = API.recordUSR(Decl); |
756 | 1 | PresumedLoc Loc = |
757 | 1 | Context.getSourceManager().getPresumedLoc(Decl->getLocation()); |
758 | 1 | DocComment Comment; |
759 | 1 | if (auto *RawComment = |
760 | 1 | getDerivedExtractAPIVisitor().fetchRawCommentForDecl(Decl)) |
761 | 0 | Comment = RawComment->getFormattedLines(Context.getSourceManager(), |
762 | 0 | Context.getDiagnostics()); |
763 | 1 | DeclarationFragments Declaration = |
764 | 1 | DeclarationFragmentsBuilder::getFragmentsForClassTemplateSpecialization( |
765 | 1 | Decl); |
766 | 1 | DeclarationFragments SubHeading = |
767 | 1 | DeclarationFragmentsBuilder::getSubHeading(Decl); |
768 | | |
769 | 1 | APIRecord *Parent = determineParentRecord(Decl->getDeclContext()); |
770 | 1 | auto *ClassTemplateSpecializationRecord = API.addClassTemplateSpecialization( |
771 | 1 | Parent, Name, USR, Loc, AvailabilitySet(Decl), Comment, Declaration, |
772 | 1 | SubHeading, DeclarationFragmentsBuilder::getAccessControl(Decl), |
773 | 1 | isInSystemHeader(Decl)); |
774 | | |
775 | 1 | ClassTemplateSpecializationRecord->Bases = getBases(Decl); |
776 | | |
777 | 1 | return true; |
778 | 1 | } ExtractAPIConsumer.cpp:clang::extractapi::impl::ExtractAPIVisitorBase<(anonymous namespace)::BatchExtractAPIVisitor>::VisitClassTemplateSpecializationDecl(clang::ClassTemplateSpecializationDecl const*) Line | Count | Source | 750 | 1 | const ClassTemplateSpecializationDecl *Decl) { | 751 | 1 | if (!getDerivedExtractAPIVisitor().shouldDeclBeIncluded(Decl)) | 752 | 0 | return true; | 753 | | | 754 | 1 | StringRef Name = Decl->getName(); | 755 | 1 | StringRef USR = API.recordUSR(Decl); | 756 | 1 | PresumedLoc Loc = | 757 | 1 | Context.getSourceManager().getPresumedLoc(Decl->getLocation()); | 758 | 1 | DocComment Comment; | 759 | 1 | if (auto *RawComment = | 760 | 1 | getDerivedExtractAPIVisitor().fetchRawCommentForDecl(Decl)) | 761 | 0 | Comment = RawComment->getFormattedLines(Context.getSourceManager(), | 762 | 0 | Context.getDiagnostics()); | 763 | 1 | DeclarationFragments Declaration = | 764 | 1 | DeclarationFragmentsBuilder::getFragmentsForClassTemplateSpecialization( | 765 | 1 | Decl); | 766 | 1 | DeclarationFragments SubHeading = | 767 | 1 | DeclarationFragmentsBuilder::getSubHeading(Decl); | 768 | | | 769 | 1 | APIRecord *Parent = determineParentRecord(Decl->getDeclContext()); | 770 | 1 | auto *ClassTemplateSpecializationRecord = API.addClassTemplateSpecialization( | 771 | 1 | Parent, Name, USR, Loc, AvailabilitySet(Decl), Comment, Declaration, | 772 | 1 | SubHeading, DeclarationFragmentsBuilder::getAccessControl(Decl), | 773 | 1 | isInSystemHeader(Decl)); | 774 | | | 775 | 1 | ClassTemplateSpecializationRecord->Bases = getBases(Decl); | 776 | | | 777 | 1 | return true; | 778 | 1 | } |
Unexecuted instantiation: clang::extractapi::impl::ExtractAPIVisitorBase<clang::extractapi::ExtractAPIVisitor<void> >::VisitClassTemplateSpecializationDecl(clang::ClassTemplateSpecializationDecl const*) Unexecuted instantiation: CXExtractAPI.cpp:clang::extractapi::impl::ExtractAPIVisitorBase<(anonymous namespace)::LibClangExtractAPIVisitor>::VisitClassTemplateSpecializationDecl(clang::ClassTemplateSpecializationDecl const*) |
779 | | |
780 | | template <typename Derived> |
781 | | bool ExtractAPIVisitorBase<Derived>:: |
782 | | VisitClassTemplatePartialSpecializationDecl( |
783 | 1 | const ClassTemplatePartialSpecializationDecl *Decl) { |
784 | 1 | if (!getDerivedExtractAPIVisitor().shouldDeclBeIncluded(Decl)) |
785 | 0 | return true; |
786 | | |
787 | 1 | StringRef Name = Decl->getName(); |
788 | 1 | StringRef USR = API.recordUSR(Decl); |
789 | 1 | PresumedLoc Loc = |
790 | 1 | Context.getSourceManager().getPresumedLoc(Decl->getLocation()); |
791 | 1 | DocComment Comment; |
792 | 1 | if (auto *RawComment = |
793 | 1 | getDerivedExtractAPIVisitor().fetchRawCommentForDecl(Decl)) |
794 | 0 | Comment = RawComment->getFormattedLines(Context.getSourceManager(), |
795 | 0 | Context.getDiagnostics()); |
796 | 1 | DeclarationFragments Declaration = DeclarationFragmentsBuilder:: |
797 | 1 | getFragmentsForClassTemplatePartialSpecialization(Decl); |
798 | 1 | DeclarationFragments SubHeading = |
799 | 1 | DeclarationFragmentsBuilder::getSubHeading(Decl); |
800 | | |
801 | 1 | APIRecord *Parent = determineParentRecord(Decl->getDeclContext()); |
802 | 1 | auto *ClassTemplatePartialSpecRecord = |
803 | 1 | API.addClassTemplatePartialSpecialization( |
804 | 1 | Parent, Name, USR, Loc, AvailabilitySet(Decl), Comment, Declaration, |
805 | 1 | SubHeading, Template(Decl), |
806 | 1 | DeclarationFragmentsBuilder::getAccessControl(Decl), |
807 | 1 | isInSystemHeader(Decl)); |
808 | | |
809 | 1 | ClassTemplatePartialSpecRecord->Bases = getBases(Decl); |
810 | | |
811 | 1 | return true; |
812 | 1 | } ExtractAPIConsumer.cpp:clang::extractapi::impl::ExtractAPIVisitorBase<(anonymous namespace)::BatchExtractAPIVisitor>::VisitClassTemplatePartialSpecializationDecl(clang::ClassTemplatePartialSpecializationDecl const*) Line | Count | Source | 783 | 1 | const ClassTemplatePartialSpecializationDecl *Decl) { | 784 | 1 | if (!getDerivedExtractAPIVisitor().shouldDeclBeIncluded(Decl)) | 785 | 0 | return true; | 786 | | | 787 | 1 | StringRef Name = Decl->getName(); | 788 | 1 | StringRef USR = API.recordUSR(Decl); | 789 | 1 | PresumedLoc Loc = | 790 | 1 | Context.getSourceManager().getPresumedLoc(Decl->getLocation()); | 791 | 1 | DocComment Comment; | 792 | 1 | if (auto *RawComment = | 793 | 1 | getDerivedExtractAPIVisitor().fetchRawCommentForDecl(Decl)) | 794 | 0 | Comment = RawComment->getFormattedLines(Context.getSourceManager(), | 795 | 0 | Context.getDiagnostics()); | 796 | 1 | DeclarationFragments Declaration = DeclarationFragmentsBuilder:: | 797 | 1 | getFragmentsForClassTemplatePartialSpecialization(Decl); | 798 | 1 | DeclarationFragments SubHeading = | 799 | 1 | DeclarationFragmentsBuilder::getSubHeading(Decl); | 800 | | | 801 | 1 | APIRecord *Parent = determineParentRecord(Decl->getDeclContext()); | 802 | 1 | auto *ClassTemplatePartialSpecRecord = | 803 | 1 | API.addClassTemplatePartialSpecialization( | 804 | 1 | Parent, Name, USR, Loc, AvailabilitySet(Decl), Comment, Declaration, | 805 | 1 | SubHeading, Template(Decl), | 806 | 1 | DeclarationFragmentsBuilder::getAccessControl(Decl), | 807 | 1 | isInSystemHeader(Decl)); | 808 | | | 809 | 1 | ClassTemplatePartialSpecRecord->Bases = getBases(Decl); | 810 | | | 811 | 1 | return true; | 812 | 1 | } |
Unexecuted instantiation: clang::extractapi::impl::ExtractAPIVisitorBase<clang::extractapi::ExtractAPIVisitor<void> >::VisitClassTemplatePartialSpecializationDecl(clang::ClassTemplatePartialSpecializationDecl const*) Unexecuted instantiation: CXExtractAPI.cpp:clang::extractapi::impl::ExtractAPIVisitorBase<(anonymous namespace)::LibClangExtractAPIVisitor>::VisitClassTemplatePartialSpecializationDecl(clang::ClassTemplatePartialSpecializationDecl const*) |
813 | | |
814 | | template <typename Derived> |
815 | | bool ExtractAPIVisitorBase<Derived>::VisitVarTemplateDecl( |
816 | 4 | const VarTemplateDecl *Decl) { |
817 | 4 | if (!getDerivedExtractAPIVisitor().shouldDeclBeIncluded(Decl)) |
818 | 0 | return true; |
819 | | |
820 | | // Collect symbol information. |
821 | 4 | StringRef Name = Decl->getName(); |
822 | 4 | StringRef USR = API.recordUSR(Decl); |
823 | 4 | PresumedLoc Loc = |
824 | 4 | Context.getSourceManager().getPresumedLoc(Decl->getLocation()); |
825 | 4 | LinkageInfo Linkage = Decl->getLinkageAndVisibility(); |
826 | 4 | DocComment Comment; |
827 | 4 | if (auto *RawComment = |
828 | 4 | getDerivedExtractAPIVisitor().fetchRawCommentForDecl(Decl)) |
829 | 0 | Comment = RawComment->getFormattedLines(Context.getSourceManager(), |
830 | 0 | Context.getDiagnostics()); |
831 | | |
832 | | // Build declaration fragments and sub-heading for the variable. |
833 | 4 | DeclarationFragments Declaration; |
834 | 4 | Declaration |
835 | 4 | .append(DeclarationFragmentsBuilder::getFragmentsForRedeclarableTemplate( |
836 | 4 | Decl)) |
837 | 4 | .append(DeclarationFragmentsBuilder::getFragmentsForVarTemplate( |
838 | 4 | Decl->getTemplatedDecl())); |
839 | | // Inject template fragments before var fragments. |
840 | 4 | DeclarationFragments SubHeading = |
841 | 4 | DeclarationFragmentsBuilder::getSubHeading(Decl); |
842 | | |
843 | 4 | SmallString<128> ParentUSR; |
844 | 4 | index::generateUSRForDecl(dyn_cast<CXXRecordDecl>(Decl->getDeclContext()), |
845 | 4 | ParentUSR); |
846 | 4 | if (Decl->getDeclContext()->getDeclKind() == Decl::CXXRecord) |
847 | 1 | API.addCXXFieldTemplate(API.findRecordForUSR(ParentUSR), Name, USR, Loc, |
848 | 1 | AvailabilitySet(Decl), Comment, Declaration, |
849 | 1 | SubHeading, |
850 | 1 | DeclarationFragmentsBuilder::getAccessControl(Decl), |
851 | 1 | Template(Decl), isInSystemHeader(Decl)); |
852 | 3 | else |
853 | 3 | API.addGlobalVariableTemplate(Name, USR, Loc, AvailabilitySet(Decl), |
854 | 3 | Linkage, Comment, Declaration, SubHeading, |
855 | 3 | Template(Decl), isInSystemHeader(Decl)); |
856 | 4 | return true; |
857 | 4 | } ExtractAPIConsumer.cpp:clang::extractapi::impl::ExtractAPIVisitorBase<(anonymous namespace)::BatchExtractAPIVisitor>::VisitVarTemplateDecl(clang::VarTemplateDecl const*) Line | Count | Source | 816 | 4 | const VarTemplateDecl *Decl) { | 817 | 4 | if (!getDerivedExtractAPIVisitor().shouldDeclBeIncluded(Decl)) | 818 | 0 | return true; | 819 | | | 820 | | // Collect symbol information. | 821 | 4 | StringRef Name = Decl->getName(); | 822 | 4 | StringRef USR = API.recordUSR(Decl); | 823 | 4 | PresumedLoc Loc = | 824 | 4 | Context.getSourceManager().getPresumedLoc(Decl->getLocation()); | 825 | 4 | LinkageInfo Linkage = Decl->getLinkageAndVisibility(); | 826 | 4 | DocComment Comment; | 827 | 4 | if (auto *RawComment = | 828 | 4 | getDerivedExtractAPIVisitor().fetchRawCommentForDecl(Decl)) | 829 | 0 | Comment = RawComment->getFormattedLines(Context.getSourceManager(), | 830 | 0 | Context.getDiagnostics()); | 831 | | | 832 | | // Build declaration fragments and sub-heading for the variable. | 833 | 4 | DeclarationFragments Declaration; | 834 | 4 | Declaration | 835 | 4 | .append(DeclarationFragmentsBuilder::getFragmentsForRedeclarableTemplate( | 836 | 4 | Decl)) | 837 | 4 | .append(DeclarationFragmentsBuilder::getFragmentsForVarTemplate( | 838 | 4 | Decl->getTemplatedDecl())); | 839 | | // Inject template fragments before var fragments. | 840 | 4 | DeclarationFragments SubHeading = | 841 | 4 | DeclarationFragmentsBuilder::getSubHeading(Decl); | 842 | | | 843 | 4 | SmallString<128> ParentUSR; | 844 | 4 | index::generateUSRForDecl(dyn_cast<CXXRecordDecl>(Decl->getDeclContext()), | 845 | 4 | ParentUSR); | 846 | 4 | if (Decl->getDeclContext()->getDeclKind() == Decl::CXXRecord) | 847 | 1 | API.addCXXFieldTemplate(API.findRecordForUSR(ParentUSR), Name, USR, Loc, | 848 | 1 | AvailabilitySet(Decl), Comment, Declaration, | 849 | 1 | SubHeading, | 850 | 1 | DeclarationFragmentsBuilder::getAccessControl(Decl), | 851 | 1 | Template(Decl), isInSystemHeader(Decl)); | 852 | 3 | else | 853 | 3 | API.addGlobalVariableTemplate(Name, USR, Loc, AvailabilitySet(Decl), | 854 | 3 | Linkage, Comment, Declaration, SubHeading, | 855 | 3 | Template(Decl), isInSystemHeader(Decl)); | 856 | 4 | return true; | 857 | 4 | } |
Unexecuted instantiation: clang::extractapi::impl::ExtractAPIVisitorBase<clang::extractapi::ExtractAPIVisitor<void> >::VisitVarTemplateDecl(clang::VarTemplateDecl const*) Unexecuted instantiation: CXExtractAPI.cpp:clang::extractapi::impl::ExtractAPIVisitorBase<(anonymous namespace)::LibClangExtractAPIVisitor>::VisitVarTemplateDecl(clang::VarTemplateDecl const*) |
858 | | |
859 | | template <typename Derived> |
860 | | bool ExtractAPIVisitorBase<Derived>::VisitVarTemplateSpecializationDecl( |
861 | 1 | const VarTemplateSpecializationDecl *Decl) { |
862 | 1 | if (!getDerivedExtractAPIVisitor().shouldDeclBeIncluded(Decl)) |
863 | 0 | return true; |
864 | | |
865 | | // Collect symbol information. |
866 | 1 | StringRef Name = Decl->getName(); |
867 | 1 | StringRef USR = API.recordUSR(Decl); |
868 | 1 | PresumedLoc Loc = |
869 | 1 | Context.getSourceManager().getPresumedLoc(Decl->getLocation()); |
870 | 1 | LinkageInfo Linkage = Decl->getLinkageAndVisibility(); |
871 | 1 | DocComment Comment; |
872 | 1 | if (auto *RawComment = |
873 | 1 | getDerivedExtractAPIVisitor().fetchRawCommentForDecl(Decl)) |
874 | 0 | Comment = RawComment->getFormattedLines(Context.getSourceManager(), |
875 | 0 | Context.getDiagnostics()); |
876 | | |
877 | | // Build declaration fragments and sub-heading for the variable. |
878 | 1 | DeclarationFragments Declaration = |
879 | 1 | DeclarationFragmentsBuilder::getFragmentsForVarTemplateSpecialization( |
880 | 1 | Decl); |
881 | 1 | DeclarationFragments SubHeading = |
882 | 1 | DeclarationFragmentsBuilder::getSubHeading(Decl); |
883 | | |
884 | 1 | API.addGlobalVariableTemplateSpecialization( |
885 | 1 | Name, USR, Loc, AvailabilitySet(Decl), Linkage, Comment, Declaration, |
886 | 1 | SubHeading, isInSystemHeader(Decl)); |
887 | 1 | return true; |
888 | 1 | } ExtractAPIConsumer.cpp:clang::extractapi::impl::ExtractAPIVisitorBase<(anonymous namespace)::BatchExtractAPIVisitor>::VisitVarTemplateSpecializationDecl(clang::VarTemplateSpecializationDecl const*) Line | Count | Source | 861 | 1 | const VarTemplateSpecializationDecl *Decl) { | 862 | 1 | if (!getDerivedExtractAPIVisitor().shouldDeclBeIncluded(Decl)) | 863 | 0 | return true; | 864 | | | 865 | | // Collect symbol information. | 866 | 1 | StringRef Name = Decl->getName(); | 867 | 1 | StringRef USR = API.recordUSR(Decl); | 868 | 1 | PresumedLoc Loc = | 869 | 1 | Context.getSourceManager().getPresumedLoc(Decl->getLocation()); | 870 | 1 | LinkageInfo Linkage = Decl->getLinkageAndVisibility(); | 871 | 1 | DocComment Comment; | 872 | 1 | if (auto *RawComment = | 873 | 1 | getDerivedExtractAPIVisitor().fetchRawCommentForDecl(Decl)) | 874 | 0 | Comment = RawComment->getFormattedLines(Context.getSourceManager(), | 875 | 0 | Context.getDiagnostics()); | 876 | | | 877 | | // Build declaration fragments and sub-heading for the variable. | 878 | 1 | DeclarationFragments Declaration = | 879 | 1 | DeclarationFragmentsBuilder::getFragmentsForVarTemplateSpecialization( | 880 | 1 | Decl); | 881 | 1 | DeclarationFragments SubHeading = | 882 | 1 | DeclarationFragmentsBuilder::getSubHeading(Decl); | 883 | | | 884 | 1 | API.addGlobalVariableTemplateSpecialization( | 885 | 1 | Name, USR, Loc, AvailabilitySet(Decl), Linkage, Comment, Declaration, | 886 | 1 | SubHeading, isInSystemHeader(Decl)); | 887 | 1 | return true; | 888 | 1 | } |
Unexecuted instantiation: clang::extractapi::impl::ExtractAPIVisitorBase<clang::extractapi::ExtractAPIVisitor<void> >::VisitVarTemplateSpecializationDecl(clang::VarTemplateSpecializationDecl const*) Unexecuted instantiation: CXExtractAPI.cpp:clang::extractapi::impl::ExtractAPIVisitorBase<(anonymous namespace)::LibClangExtractAPIVisitor>::VisitVarTemplateSpecializationDecl(clang::VarTemplateSpecializationDecl const*) |
889 | | |
890 | | template <typename Derived> |
891 | | bool ExtractAPIVisitorBase<Derived>::VisitVarTemplatePartialSpecializationDecl( |
892 | 1 | const VarTemplatePartialSpecializationDecl *Decl) { |
893 | 1 | if (!getDerivedExtractAPIVisitor().shouldDeclBeIncluded(Decl)) |
894 | 0 | return true; |
895 | | |
896 | | // Collect symbol information. |
897 | 1 | StringRef Name = Decl->getName(); |
898 | 1 | StringRef USR = API.recordUSR(Decl); |
899 | 1 | PresumedLoc Loc = |
900 | 1 | Context.getSourceManager().getPresumedLoc(Decl->getLocation()); |
901 | 1 | LinkageInfo Linkage = Decl->getLinkageAndVisibility(); |
902 | 1 | DocComment Comment; |
903 | 1 | if (auto *RawComment = |
904 | 1 | getDerivedExtractAPIVisitor().fetchRawCommentForDecl(Decl)) |
905 | 0 | Comment = RawComment->getFormattedLines(Context.getSourceManager(), |
906 | 0 | Context.getDiagnostics()); |
907 | | |
908 | | // Build declaration fragments and sub-heading for the variable. |
909 | 1 | DeclarationFragments Declaration = DeclarationFragmentsBuilder:: |
910 | 1 | getFragmentsForVarTemplatePartialSpecialization(Decl); |
911 | 1 | DeclarationFragments SubHeading = |
912 | 1 | DeclarationFragmentsBuilder::getSubHeading(Decl); |
913 | | |
914 | 1 | API.addGlobalVariableTemplatePartialSpecialization( |
915 | 1 | Name, USR, Loc, AvailabilitySet(Decl), Linkage, Comment, Declaration, |
916 | 1 | SubHeading, Template(Decl), isInSystemHeader(Decl)); |
917 | 1 | return true; |
918 | 1 | } ExtractAPIConsumer.cpp:clang::extractapi::impl::ExtractAPIVisitorBase<(anonymous namespace)::BatchExtractAPIVisitor>::VisitVarTemplatePartialSpecializationDecl(clang::VarTemplatePartialSpecializationDecl const*) Line | Count | Source | 892 | 1 | const VarTemplatePartialSpecializationDecl *Decl) { | 893 | 1 | if (!getDerivedExtractAPIVisitor().shouldDeclBeIncluded(Decl)) | 894 | 0 | return true; | 895 | | | 896 | | // Collect symbol information. | 897 | 1 | StringRef Name = Decl->getName(); | 898 | 1 | StringRef USR = API.recordUSR(Decl); | 899 | 1 | PresumedLoc Loc = | 900 | 1 | Context.getSourceManager().getPresumedLoc(Decl->getLocation()); | 901 | 1 | LinkageInfo Linkage = Decl->getLinkageAndVisibility(); | 902 | 1 | DocComment Comment; | 903 | 1 | if (auto *RawComment = | 904 | 1 | getDerivedExtractAPIVisitor().fetchRawCommentForDecl(Decl)) | 905 | 0 | Comment = RawComment->getFormattedLines(Context.getSourceManager(), | 906 | 0 | Context.getDiagnostics()); | 907 | | | 908 | | // Build declaration fragments and sub-heading for the variable. | 909 | 1 | DeclarationFragments Declaration = DeclarationFragmentsBuilder:: | 910 | 1 | getFragmentsForVarTemplatePartialSpecialization(Decl); | 911 | 1 | DeclarationFragments SubHeading = | 912 | 1 | DeclarationFragmentsBuilder::getSubHeading(Decl); | 913 | | | 914 | 1 | API.addGlobalVariableTemplatePartialSpecialization( | 915 | 1 | Name, USR, Loc, AvailabilitySet(Decl), Linkage, Comment, Declaration, | 916 | 1 | SubHeading, Template(Decl), isInSystemHeader(Decl)); | 917 | 1 | return true; | 918 | 1 | } |
Unexecuted instantiation: clang::extractapi::impl::ExtractAPIVisitorBase<clang::extractapi::ExtractAPIVisitor<void> >::VisitVarTemplatePartialSpecializationDecl(clang::VarTemplatePartialSpecializationDecl const*) Unexecuted instantiation: CXExtractAPI.cpp:clang::extractapi::impl::ExtractAPIVisitorBase<(anonymous namespace)::LibClangExtractAPIVisitor>::VisitVarTemplatePartialSpecializationDecl(clang::VarTemplatePartialSpecializationDecl const*) |
919 | | |
920 | | template <typename Derived> |
921 | | bool ExtractAPIVisitorBase<Derived>::VisitFunctionTemplateDecl( |
922 | 5 | const FunctionTemplateDecl *Decl) { |
923 | 5 | if (isa<CXXMethodDecl>(Decl->getTemplatedDecl())) |
924 | 2 | return true; |
925 | 3 | if (!getDerivedExtractAPIVisitor().shouldDeclBeIncluded(Decl)) |
926 | 0 | return true; |
927 | | |
928 | | // Collect symbol information. |
929 | 3 | StringRef Name = Decl->getName(); |
930 | 3 | StringRef USR = API.recordUSR(Decl); |
931 | 3 | PresumedLoc Loc = |
932 | 3 | Context.getSourceManager().getPresumedLoc(Decl->getLocation()); |
933 | 3 | LinkageInfo Linkage = Decl->getLinkageAndVisibility(); |
934 | 3 | DocComment Comment; |
935 | 3 | if (auto *RawComment = |
936 | 3 | getDerivedExtractAPIVisitor().fetchRawCommentForDecl(Decl)) |
937 | 0 | Comment = RawComment->getFormattedLines(Context.getSourceManager(), |
938 | 0 | Context.getDiagnostics()); |
939 | | |
940 | 3 | DeclarationFragments SubHeading = |
941 | 3 | DeclarationFragmentsBuilder::getSubHeading(Decl); |
942 | 3 | FunctionSignature Signature = |
943 | 3 | DeclarationFragmentsBuilder::getFunctionSignature( |
944 | 3 | Decl->getTemplatedDecl()); |
945 | | |
946 | 3 | API.addGlobalFunctionTemplate( |
947 | 3 | Name, USR, Loc, AvailabilitySet(Decl), Linkage, Comment, |
948 | 3 | DeclarationFragmentsBuilder::getFragmentsForFunctionTemplate(Decl), |
949 | 3 | SubHeading, Signature, Template(Decl), isInSystemHeader(Decl)); |
950 | | |
951 | 3 | return true; |
952 | 3 | } ExtractAPIConsumer.cpp:clang::extractapi::impl::ExtractAPIVisitorBase<(anonymous namespace)::BatchExtractAPIVisitor>::VisitFunctionTemplateDecl(clang::FunctionTemplateDecl const*) Line | Count | Source | 922 | 5 | const FunctionTemplateDecl *Decl) { | 923 | 5 | if (isa<CXXMethodDecl>(Decl->getTemplatedDecl())) | 924 | 2 | return true; | 925 | 3 | if (!getDerivedExtractAPIVisitor().shouldDeclBeIncluded(Decl)) | 926 | 0 | return true; | 927 | | | 928 | | // Collect symbol information. | 929 | 3 | StringRef Name = Decl->getName(); | 930 | 3 | StringRef USR = API.recordUSR(Decl); | 931 | 3 | PresumedLoc Loc = | 932 | 3 | Context.getSourceManager().getPresumedLoc(Decl->getLocation()); | 933 | 3 | LinkageInfo Linkage = Decl->getLinkageAndVisibility(); | 934 | 3 | DocComment Comment; | 935 | 3 | if (auto *RawComment = | 936 | 3 | getDerivedExtractAPIVisitor().fetchRawCommentForDecl(Decl)) | 937 | 0 | Comment = RawComment->getFormattedLines(Context.getSourceManager(), | 938 | 0 | Context.getDiagnostics()); | 939 | | | 940 | 3 | DeclarationFragments SubHeading = | 941 | 3 | DeclarationFragmentsBuilder::getSubHeading(Decl); | 942 | 3 | FunctionSignature Signature = | 943 | 3 | DeclarationFragmentsBuilder::getFunctionSignature( | 944 | 3 | Decl->getTemplatedDecl()); | 945 | | | 946 | 3 | API.addGlobalFunctionTemplate( | 947 | 3 | Name, USR, Loc, AvailabilitySet(Decl), Linkage, Comment, | 948 | 3 | DeclarationFragmentsBuilder::getFragmentsForFunctionTemplate(Decl), | 949 | 3 | SubHeading, Signature, Template(Decl), isInSystemHeader(Decl)); | 950 | | | 951 | 3 | return true; | 952 | 3 | } |
Unexecuted instantiation: clang::extractapi::impl::ExtractAPIVisitorBase<clang::extractapi::ExtractAPIVisitor<void> >::VisitFunctionTemplateDecl(clang::FunctionTemplateDecl const*) Unexecuted instantiation: CXExtractAPI.cpp:clang::extractapi::impl::ExtractAPIVisitorBase<(anonymous namespace)::LibClangExtractAPIVisitor>::VisitFunctionTemplateDecl(clang::FunctionTemplateDecl const*) |
953 | | |
954 | | template <typename Derived> |
955 | | bool ExtractAPIVisitorBase<Derived>::VisitObjCInterfaceDecl( |
956 | 34 | const ObjCInterfaceDecl *Decl) { |
957 | 34 | if (!getDerivedExtractAPIVisitor().shouldDeclBeIncluded(Decl)) |
958 | 2 | return true; |
959 | | |
960 | | // Collect symbol information. |
961 | 32 | StringRef Name = Decl->getName(); |
962 | 32 | StringRef USR = API.recordUSR(Decl); |
963 | 32 | PresumedLoc Loc = |
964 | 32 | Context.getSourceManager().getPresumedLoc(Decl->getLocation()); |
965 | 32 | LinkageInfo Linkage = Decl->getLinkageAndVisibility(); |
966 | 32 | DocComment Comment; |
967 | 32 | if (auto *RawComment = |
968 | 32 | getDerivedExtractAPIVisitor().fetchRawCommentForDecl(Decl)) |
969 | 25 | Comment = RawComment->getFormattedLines(Context.getSourceManager(), |
970 | 25 | Context.getDiagnostics()); |
971 | | |
972 | | // Build declaration fragments and sub-heading for the interface. |
973 | 32 | DeclarationFragments Declaration = |
974 | 32 | DeclarationFragmentsBuilder::getFragmentsForObjCInterface(Decl); |
975 | 32 | DeclarationFragments SubHeading = |
976 | 32 | DeclarationFragmentsBuilder::getSubHeading(Decl); |
977 | | |
978 | | // Collect super class information. |
979 | 32 | SymbolReference SuperClass; |
980 | 32 | if (const auto *SuperClassDecl = Decl->getSuperClass()) { |
981 | 13 | SuperClass.Name = SuperClassDecl->getObjCRuntimeNameAsString(); |
982 | 13 | SuperClass.USR = API.recordUSR(SuperClassDecl); |
983 | 13 | } |
984 | | |
985 | 32 | ObjCInterfaceRecord *ObjCInterfaceRecord = API.addObjCInterface( |
986 | 32 | Name, USR, Loc, AvailabilitySet(Decl), Linkage, Comment, Declaration, |
987 | 32 | SubHeading, SuperClass, isInSystemHeader(Decl)); |
988 | | |
989 | | // Record all methods (selectors). This doesn't include automatically |
990 | | // synthesized property methods. |
991 | 32 | getDerivedExtractAPIVisitor().recordObjCMethods(ObjCInterfaceRecord, |
992 | 32 | Decl->methods()); |
993 | 32 | getDerivedExtractAPIVisitor().recordObjCProperties(ObjCInterfaceRecord, |
994 | 32 | Decl->properties()); |
995 | 32 | getDerivedExtractAPIVisitor().recordObjCInstanceVariables(ObjCInterfaceRecord, |
996 | 32 | Decl->ivars()); |
997 | 32 | getDerivedExtractAPIVisitor().recordObjCProtocols(ObjCInterfaceRecord, |
998 | 32 | Decl->protocols()); |
999 | | |
1000 | 32 | return true; |
1001 | 34 | } ExtractAPIConsumer.cpp:clang::extractapi::impl::ExtractAPIVisitorBase<(anonymous namespace)::BatchExtractAPIVisitor>::VisitObjCInterfaceDecl(clang::ObjCInterfaceDecl const*) Line | Count | Source | 956 | 9 | const ObjCInterfaceDecl *Decl) { | 957 | 9 | if (!getDerivedExtractAPIVisitor().shouldDeclBeIncluded(Decl)) | 958 | 2 | return true; | 959 | | | 960 | | // Collect symbol information. | 961 | 7 | StringRef Name = Decl->getName(); | 962 | 7 | StringRef USR = API.recordUSR(Decl); | 963 | 7 | PresumedLoc Loc = | 964 | 7 | Context.getSourceManager().getPresumedLoc(Decl->getLocation()); | 965 | 7 | LinkageInfo Linkage = Decl->getLinkageAndVisibility(); | 966 | 7 | DocComment Comment; | 967 | 7 | if (auto *RawComment = | 968 | 7 | getDerivedExtractAPIVisitor().fetchRawCommentForDecl(Decl)) | 969 | 0 | Comment = RawComment->getFormattedLines(Context.getSourceManager(), | 970 | 0 | Context.getDiagnostics()); | 971 | | | 972 | | // Build declaration fragments and sub-heading for the interface. | 973 | 7 | DeclarationFragments Declaration = | 974 | 7 | DeclarationFragmentsBuilder::getFragmentsForObjCInterface(Decl); | 975 | 7 | DeclarationFragments SubHeading = | 976 | 7 | DeclarationFragmentsBuilder::getSubHeading(Decl); | 977 | | | 978 | | // Collect super class information. | 979 | 7 | SymbolReference SuperClass; | 980 | 7 | if (const auto *SuperClassDecl = Decl->getSuperClass()) { | 981 | 1 | SuperClass.Name = SuperClassDecl->getObjCRuntimeNameAsString(); | 982 | 1 | SuperClass.USR = API.recordUSR(SuperClassDecl); | 983 | 1 | } | 984 | | | 985 | 7 | ObjCInterfaceRecord *ObjCInterfaceRecord = API.addObjCInterface( | 986 | 7 | Name, USR, Loc, AvailabilitySet(Decl), Linkage, Comment, Declaration, | 987 | 7 | SubHeading, SuperClass, isInSystemHeader(Decl)); | 988 | | | 989 | | // Record all methods (selectors). This doesn't include automatically | 990 | | // synthesized property methods. | 991 | 7 | getDerivedExtractAPIVisitor().recordObjCMethods(ObjCInterfaceRecord, | 992 | 7 | Decl->methods()); | 993 | 7 | getDerivedExtractAPIVisitor().recordObjCProperties(ObjCInterfaceRecord, | 994 | 7 | Decl->properties()); | 995 | 7 | getDerivedExtractAPIVisitor().recordObjCInstanceVariables(ObjCInterfaceRecord, | 996 | 7 | Decl->ivars()); | 997 | 7 | getDerivedExtractAPIVisitor().recordObjCProtocols(ObjCInterfaceRecord, | 998 | 7 | Decl->protocols()); | 999 | | | 1000 | 7 | return true; | 1001 | 9 | } |
Unexecuted instantiation: clang::extractapi::impl::ExtractAPIVisitorBase<clang::extractapi::ExtractAPIVisitor<void> >::VisitObjCInterfaceDecl(clang::ObjCInterfaceDecl const*) CXExtractAPI.cpp:clang::extractapi::impl::ExtractAPIVisitorBase<(anonymous namespace)::LibClangExtractAPIVisitor>::VisitObjCInterfaceDecl(clang::ObjCInterfaceDecl const*) Line | Count | Source | 956 | 25 | const ObjCInterfaceDecl *Decl) { | 957 | 25 | if (!getDerivedExtractAPIVisitor().shouldDeclBeIncluded(Decl)) | 958 | 0 | return true; | 959 | | | 960 | | // Collect symbol information. | 961 | 25 | StringRef Name = Decl->getName(); | 962 | 25 | StringRef USR = API.recordUSR(Decl); | 963 | 25 | PresumedLoc Loc = | 964 | 25 | Context.getSourceManager().getPresumedLoc(Decl->getLocation()); | 965 | 25 | LinkageInfo Linkage = Decl->getLinkageAndVisibility(); | 966 | 25 | DocComment Comment; | 967 | 25 | if (auto *RawComment = | 968 | 25 | getDerivedExtractAPIVisitor().fetchRawCommentForDecl(Decl)) | 969 | 25 | Comment = RawComment->getFormattedLines(Context.getSourceManager(), | 970 | 25 | Context.getDiagnostics()); | 971 | | | 972 | | // Build declaration fragments and sub-heading for the interface. | 973 | 25 | DeclarationFragments Declaration = | 974 | 25 | DeclarationFragmentsBuilder::getFragmentsForObjCInterface(Decl); | 975 | 25 | DeclarationFragments SubHeading = | 976 | 25 | DeclarationFragmentsBuilder::getSubHeading(Decl); | 977 | | | 978 | | // Collect super class information. | 979 | 25 | SymbolReference SuperClass; | 980 | 25 | if (const auto *SuperClassDecl = Decl->getSuperClass()) { | 981 | 12 | SuperClass.Name = SuperClassDecl->getObjCRuntimeNameAsString(); | 982 | 12 | SuperClass.USR = API.recordUSR(SuperClassDecl); | 983 | 12 | } | 984 | | | 985 | 25 | ObjCInterfaceRecord *ObjCInterfaceRecord = API.addObjCInterface( | 986 | 25 | Name, USR, Loc, AvailabilitySet(Decl), Linkage, Comment, Declaration, | 987 | 25 | SubHeading, SuperClass, isInSystemHeader(Decl)); | 988 | | | 989 | | // Record all methods (selectors). This doesn't include automatically | 990 | | // synthesized property methods. | 991 | 25 | getDerivedExtractAPIVisitor().recordObjCMethods(ObjCInterfaceRecord, | 992 | 25 | Decl->methods()); | 993 | 25 | getDerivedExtractAPIVisitor().recordObjCProperties(ObjCInterfaceRecord, | 994 | 25 | Decl->properties()); | 995 | 25 | getDerivedExtractAPIVisitor().recordObjCInstanceVariables(ObjCInterfaceRecord, | 996 | 25 | Decl->ivars()); | 997 | 25 | getDerivedExtractAPIVisitor().recordObjCProtocols(ObjCInterfaceRecord, | 998 | 25 | Decl->protocols()); | 999 | | | 1000 | 25 | return true; | 1001 | 25 | } |
|
1002 | | |
1003 | | template <typename Derived> |
1004 | | bool ExtractAPIVisitorBase<Derived>::VisitObjCProtocolDecl( |
1005 | 17 | const ObjCProtocolDecl *Decl) { |
1006 | 17 | if (!getDerivedExtractAPIVisitor().shouldDeclBeIncluded(Decl)) |
1007 | 2 | return true; |
1008 | | |
1009 | | // Collect symbol information. |
1010 | 15 | StringRef Name = Decl->getName(); |
1011 | 15 | StringRef USR = API.recordUSR(Decl); |
1012 | 15 | PresumedLoc Loc = |
1013 | 15 | Context.getSourceManager().getPresumedLoc(Decl->getLocation()); |
1014 | 15 | DocComment Comment; |
1015 | 15 | if (auto *RawComment = |
1016 | 15 | getDerivedExtractAPIVisitor().fetchRawCommentForDecl(Decl)) |
1017 | 11 | Comment = RawComment->getFormattedLines(Context.getSourceManager(), |
1018 | 11 | Context.getDiagnostics()); |
1019 | | |
1020 | | // Build declaration fragments and sub-heading for the protocol. |
1021 | 15 | DeclarationFragments Declaration = |
1022 | 15 | DeclarationFragmentsBuilder::getFragmentsForObjCProtocol(Decl); |
1023 | 15 | DeclarationFragments SubHeading = |
1024 | 15 | DeclarationFragmentsBuilder::getSubHeading(Decl); |
1025 | | |
1026 | 15 | ObjCProtocolRecord *ObjCProtocolRecord = |
1027 | 15 | API.addObjCProtocol(Name, USR, Loc, AvailabilitySet(Decl), Comment, |
1028 | 15 | Declaration, SubHeading, isInSystemHeader(Decl)); |
1029 | | |
1030 | 15 | getDerivedExtractAPIVisitor().recordObjCMethods(ObjCProtocolRecord, |
1031 | 15 | Decl->methods()); |
1032 | 15 | getDerivedExtractAPIVisitor().recordObjCProperties(ObjCProtocolRecord, |
1033 | 15 | Decl->properties()); |
1034 | 15 | getDerivedExtractAPIVisitor().recordObjCProtocols(ObjCProtocolRecord, |
1035 | 15 | Decl->protocols()); |
1036 | | |
1037 | 15 | return true; |
1038 | 17 | } ExtractAPIConsumer.cpp:clang::extractapi::impl::ExtractAPIVisitorBase<(anonymous namespace)::BatchExtractAPIVisitor>::VisitObjCProtocolDecl(clang::ObjCProtocolDecl const*) Line | Count | Source | 1005 | 6 | const ObjCProtocolDecl *Decl) { | 1006 | 6 | if (!getDerivedExtractAPIVisitor().shouldDeclBeIncluded(Decl)) | 1007 | 2 | return true; | 1008 | | | 1009 | | // Collect symbol information. | 1010 | 4 | StringRef Name = Decl->getName(); | 1011 | 4 | StringRef USR = API.recordUSR(Decl); | 1012 | 4 | PresumedLoc Loc = | 1013 | 4 | Context.getSourceManager().getPresumedLoc(Decl->getLocation()); | 1014 | 4 | DocComment Comment; | 1015 | 4 | if (auto *RawComment = | 1016 | 4 | getDerivedExtractAPIVisitor().fetchRawCommentForDecl(Decl)) | 1017 | 0 | Comment = RawComment->getFormattedLines(Context.getSourceManager(), | 1018 | 0 | Context.getDiagnostics()); | 1019 | | | 1020 | | // Build declaration fragments and sub-heading for the protocol. | 1021 | 4 | DeclarationFragments Declaration = | 1022 | 4 | DeclarationFragmentsBuilder::getFragmentsForObjCProtocol(Decl); | 1023 | 4 | DeclarationFragments SubHeading = | 1024 | 4 | DeclarationFragmentsBuilder::getSubHeading(Decl); | 1025 | | | 1026 | 4 | ObjCProtocolRecord *ObjCProtocolRecord = | 1027 | 4 | API.addObjCProtocol(Name, USR, Loc, AvailabilitySet(Decl), Comment, | 1028 | 4 | Declaration, SubHeading, isInSystemHeader(Decl)); | 1029 | | | 1030 | 4 | getDerivedExtractAPIVisitor().recordObjCMethods(ObjCProtocolRecord, | 1031 | 4 | Decl->methods()); | 1032 | 4 | getDerivedExtractAPIVisitor().recordObjCProperties(ObjCProtocolRecord, | 1033 | 4 | Decl->properties()); | 1034 | 4 | getDerivedExtractAPIVisitor().recordObjCProtocols(ObjCProtocolRecord, | 1035 | 4 | Decl->protocols()); | 1036 | | | 1037 | 4 | return true; | 1038 | 6 | } |
Unexecuted instantiation: clang::extractapi::impl::ExtractAPIVisitorBase<clang::extractapi::ExtractAPIVisitor<void> >::VisitObjCProtocolDecl(clang::ObjCProtocolDecl const*) CXExtractAPI.cpp:clang::extractapi::impl::ExtractAPIVisitorBase<(anonymous namespace)::LibClangExtractAPIVisitor>::VisitObjCProtocolDecl(clang::ObjCProtocolDecl const*) Line | Count | Source | 1005 | 11 | const ObjCProtocolDecl *Decl) { | 1006 | 11 | if (!getDerivedExtractAPIVisitor().shouldDeclBeIncluded(Decl)) | 1007 | 0 | return true; | 1008 | | | 1009 | | // Collect symbol information. | 1010 | 11 | StringRef Name = Decl->getName(); | 1011 | 11 | StringRef USR = API.recordUSR(Decl); | 1012 | 11 | PresumedLoc Loc = | 1013 | 11 | Context.getSourceManager().getPresumedLoc(Decl->getLocation()); | 1014 | 11 | DocComment Comment; | 1015 | 11 | if (auto *RawComment = | 1016 | 11 | getDerivedExtractAPIVisitor().fetchRawCommentForDecl(Decl)) | 1017 | 11 | Comment = RawComment->getFormattedLines(Context.getSourceManager(), | 1018 | 11 | Context.getDiagnostics()); | 1019 | | | 1020 | | // Build declaration fragments and sub-heading for the protocol. | 1021 | 11 | DeclarationFragments Declaration = | 1022 | 11 | DeclarationFragmentsBuilder::getFragmentsForObjCProtocol(Decl); | 1023 | 11 | DeclarationFragments SubHeading = | 1024 | 11 | DeclarationFragmentsBuilder::getSubHeading(Decl); | 1025 | | | 1026 | 11 | ObjCProtocolRecord *ObjCProtocolRecord = | 1027 | 11 | API.addObjCProtocol(Name, USR, Loc, AvailabilitySet(Decl), Comment, | 1028 | 11 | Declaration, SubHeading, isInSystemHeader(Decl)); | 1029 | | | 1030 | 11 | getDerivedExtractAPIVisitor().recordObjCMethods(ObjCProtocolRecord, | 1031 | 11 | Decl->methods()); | 1032 | 11 | getDerivedExtractAPIVisitor().recordObjCProperties(ObjCProtocolRecord, | 1033 | 11 | Decl->properties()); | 1034 | 11 | getDerivedExtractAPIVisitor().recordObjCProtocols(ObjCProtocolRecord, | 1035 | 11 | Decl->protocols()); | 1036 | | | 1037 | 11 | return true; | 1038 | 11 | } |
|
1039 | | |
1040 | | template <typename Derived> |
1041 | | bool ExtractAPIVisitorBase<Derived>::VisitTypedefNameDecl( |
1042 | 21 | const TypedefNameDecl *Decl) { |
1043 | | // Skip ObjC Type Parameter for now. |
1044 | 21 | if (isa<ObjCTypeParamDecl>(Decl)) |
1045 | 0 | return true; |
1046 | | |
1047 | 21 | if (!Decl->isDefinedOutsideFunctionOrMethod()) |
1048 | 0 | return true; |
1049 | | |
1050 | 21 | if (!getDerivedExtractAPIVisitor().shouldDeclBeIncluded(Decl)) |
1051 | 0 | return true; |
1052 | | |
1053 | | // Add the notion of typedef for tag type (struct or enum) of the same name. |
1054 | 21 | if (const ElaboratedType *ET = |
1055 | 21 | dyn_cast<ElaboratedType>(Decl->getUnderlyingType())) { |
1056 | 13 | if (const TagType *TagTy = dyn_cast<TagType>(ET->desugar())) { |
1057 | 6 | if (Decl->getName() == TagTy->getDecl()->getName()) { |
1058 | 2 | if (TagTy->getDecl()->isStruct()) { |
1059 | 1 | modifyRecords(API.getStructs(), Decl->getName()); |
1060 | 1 | } |
1061 | 2 | if (TagTy->getDecl()->isEnum()) { |
1062 | 1 | modifyRecords(API.getEnums(), Decl->getName()); |
1063 | 1 | } |
1064 | 2 | } |
1065 | 6 | } |
1066 | 13 | } |
1067 | | |
1068 | 21 | PresumedLoc Loc = |
1069 | 21 | Context.getSourceManager().getPresumedLoc(Decl->getLocation()); |
1070 | 21 | StringRef Name = Decl->getName(); |
1071 | 21 | StringRef USR = API.recordUSR(Decl); |
1072 | 21 | DocComment Comment; |
1073 | 21 | if (auto *RawComment = |
1074 | 21 | getDerivedExtractAPIVisitor().fetchRawCommentForDecl(Decl)) |
1075 | 0 | Comment = RawComment->getFormattedLines(Context.getSourceManager(), |
1076 | 0 | Context.getDiagnostics()); |
1077 | | |
1078 | 21 | QualType Type = Decl->getUnderlyingType(); |
1079 | 21 | SymbolReference SymRef = |
1080 | 21 | TypedefUnderlyingTypeResolver(Context).getSymbolReferenceForType(Type, |
1081 | 21 | API); |
1082 | | |
1083 | 21 | API.addTypedef(Name, USR, Loc, AvailabilitySet(Decl), Comment, |
1084 | 21 | DeclarationFragmentsBuilder::getFragmentsForTypedef(Decl), |
1085 | 21 | DeclarationFragmentsBuilder::getSubHeading(Decl), SymRef, |
1086 | 21 | isInSystemHeader(Decl)); |
1087 | | |
1088 | 21 | return true; |
1089 | 21 | } ExtractAPIConsumer.cpp:clang::extractapi::impl::ExtractAPIVisitorBase<(anonymous namespace)::BatchExtractAPIVisitor>::VisitTypedefNameDecl(clang::TypedefNameDecl const*) Line | Count | Source | 1042 | 21 | const TypedefNameDecl *Decl) { | 1043 | | // Skip ObjC Type Parameter for now. | 1044 | 21 | if (isa<ObjCTypeParamDecl>(Decl)) | 1045 | 0 | return true; | 1046 | | | 1047 | 21 | if (!Decl->isDefinedOutsideFunctionOrMethod()) | 1048 | 0 | return true; | 1049 | | | 1050 | 21 | if (!getDerivedExtractAPIVisitor().shouldDeclBeIncluded(Decl)) | 1051 | 0 | return true; | 1052 | | | 1053 | | // Add the notion of typedef for tag type (struct or enum) of the same name. | 1054 | 21 | if (const ElaboratedType *ET = | 1055 | 21 | dyn_cast<ElaboratedType>(Decl->getUnderlyingType())) { | 1056 | 13 | if (const TagType *TagTy = dyn_cast<TagType>(ET->desugar())) { | 1057 | 6 | if (Decl->getName() == TagTy->getDecl()->getName()) { | 1058 | 2 | if (TagTy->getDecl()->isStruct()) { | 1059 | 1 | modifyRecords(API.getStructs(), Decl->getName()); | 1060 | 1 | } | 1061 | 2 | if (TagTy->getDecl()->isEnum()) { | 1062 | 1 | modifyRecords(API.getEnums(), Decl->getName()); | 1063 | 1 | } | 1064 | 2 | } | 1065 | 6 | } | 1066 | 13 | } | 1067 | | | 1068 | 21 | PresumedLoc Loc = | 1069 | 21 | Context.getSourceManager().getPresumedLoc(Decl->getLocation()); | 1070 | 21 | StringRef Name = Decl->getName(); | 1071 | 21 | StringRef USR = API.recordUSR(Decl); | 1072 | 21 | DocComment Comment; | 1073 | 21 | if (auto *RawComment = | 1074 | 21 | getDerivedExtractAPIVisitor().fetchRawCommentForDecl(Decl)) | 1075 | 0 | Comment = RawComment->getFormattedLines(Context.getSourceManager(), | 1076 | 0 | Context.getDiagnostics()); | 1077 | | | 1078 | 21 | QualType Type = Decl->getUnderlyingType(); | 1079 | 21 | SymbolReference SymRef = | 1080 | 21 | TypedefUnderlyingTypeResolver(Context).getSymbolReferenceForType(Type, | 1081 | 21 | API); | 1082 | | | 1083 | 21 | API.addTypedef(Name, USR, Loc, AvailabilitySet(Decl), Comment, | 1084 | 21 | DeclarationFragmentsBuilder::getFragmentsForTypedef(Decl), | 1085 | 21 | DeclarationFragmentsBuilder::getSubHeading(Decl), SymRef, | 1086 | 21 | isInSystemHeader(Decl)); | 1087 | | | 1088 | 21 | return true; | 1089 | 21 | } |
Unexecuted instantiation: clang::extractapi::impl::ExtractAPIVisitorBase<clang::extractapi::ExtractAPIVisitor<void> >::VisitTypedefNameDecl(clang::TypedefNameDecl const*) Unexecuted instantiation: CXExtractAPI.cpp:clang::extractapi::impl::ExtractAPIVisitorBase<(anonymous namespace)::LibClangExtractAPIVisitor>::VisitTypedefNameDecl(clang::TypedefNameDecl const*) |
1090 | | |
1091 | | template <typename Derived> |
1092 | | bool ExtractAPIVisitorBase<Derived>::VisitObjCCategoryDecl( |
1093 | 7 | const ObjCCategoryDecl *Decl) { |
1094 | 7 | if (!getDerivedExtractAPIVisitor().shouldDeclBeIncluded(Decl)) |
1095 | 0 | return true; |
1096 | | |
1097 | 7 | StringRef Name = Decl->getName(); |
1098 | 7 | StringRef USR = API.recordUSR(Decl); |
1099 | 7 | PresumedLoc Loc = |
1100 | 7 | Context.getSourceManager().getPresumedLoc(Decl->getLocation()); |
1101 | 7 | DocComment Comment; |
1102 | 7 | if (auto *RawComment = |
1103 | 7 | getDerivedExtractAPIVisitor().fetchRawCommentForDecl(Decl)) |
1104 | 2 | Comment = RawComment->getFormattedLines(Context.getSourceManager(), |
1105 | 2 | Context.getDiagnostics()); |
1106 | | // Build declaration fragments and sub-heading for the category. |
1107 | 7 | DeclarationFragments Declaration = |
1108 | 7 | DeclarationFragmentsBuilder::getFragmentsForObjCCategory(Decl); |
1109 | 7 | DeclarationFragments SubHeading = |
1110 | 7 | DeclarationFragmentsBuilder::getSubHeading(Decl); |
1111 | | |
1112 | 7 | const ObjCInterfaceDecl *InterfaceDecl = Decl->getClassInterface(); |
1113 | 7 | SymbolReference Interface(InterfaceDecl->getName(), |
1114 | 7 | API.recordUSR(InterfaceDecl)); |
1115 | | |
1116 | 7 | bool IsFromExternalModule = true; |
1117 | 7 | for (const auto &Interface : API.getObjCInterfaces()) { |
1118 | 5 | if (InterfaceDecl->getName() == Interface.second.get()->Name) { |
1119 | 3 | IsFromExternalModule = false; |
1120 | 3 | break; |
1121 | 3 | } |
1122 | 5 | } |
1123 | | |
1124 | 7 | ObjCCategoryRecord *ObjCCategoryRecord = API.addObjCCategory( |
1125 | 7 | Name, USR, Loc, AvailabilitySet(Decl), Comment, Declaration, SubHeading, |
1126 | 7 | Interface, isInSystemHeader(Decl), IsFromExternalModule); |
1127 | | |
1128 | 7 | getDerivedExtractAPIVisitor().recordObjCMethods(ObjCCategoryRecord, |
1129 | 7 | Decl->methods()); |
1130 | 7 | getDerivedExtractAPIVisitor().recordObjCProperties(ObjCCategoryRecord, |
1131 | 7 | Decl->properties()); |
1132 | 7 | getDerivedExtractAPIVisitor().recordObjCInstanceVariables(ObjCCategoryRecord, |
1133 | 7 | Decl->ivars()); |
1134 | 7 | getDerivedExtractAPIVisitor().recordObjCProtocols(ObjCCategoryRecord, |
1135 | 7 | Decl->protocols()); |
1136 | | |
1137 | 7 | return true; |
1138 | 7 | } ExtractAPIConsumer.cpp:clang::extractapi::impl::ExtractAPIVisitorBase<(anonymous namespace)::BatchExtractAPIVisitor>::VisitObjCCategoryDecl(clang::ObjCCategoryDecl const*) Line | Count | Source | 1093 | 7 | const ObjCCategoryDecl *Decl) { | 1094 | 7 | if (!getDerivedExtractAPIVisitor().shouldDeclBeIncluded(Decl)) | 1095 | 0 | return true; | 1096 | | | 1097 | 7 | StringRef Name = Decl->getName(); | 1098 | 7 | StringRef USR = API.recordUSR(Decl); | 1099 | 7 | PresumedLoc Loc = | 1100 | 7 | Context.getSourceManager().getPresumedLoc(Decl->getLocation()); | 1101 | 7 | DocComment Comment; | 1102 | 7 | if (auto *RawComment = | 1103 | 7 | getDerivedExtractAPIVisitor().fetchRawCommentForDecl(Decl)) | 1104 | 2 | Comment = RawComment->getFormattedLines(Context.getSourceManager(), | 1105 | 2 | Context.getDiagnostics()); | 1106 | | // Build declaration fragments and sub-heading for the category. | 1107 | 7 | DeclarationFragments Declaration = | 1108 | 7 | DeclarationFragmentsBuilder::getFragmentsForObjCCategory(Decl); | 1109 | 7 | DeclarationFragments SubHeading = | 1110 | 7 | DeclarationFragmentsBuilder::getSubHeading(Decl); | 1111 | | | 1112 | 7 | const ObjCInterfaceDecl *InterfaceDecl = Decl->getClassInterface(); | 1113 | 7 | SymbolReference Interface(InterfaceDecl->getName(), | 1114 | 7 | API.recordUSR(InterfaceDecl)); | 1115 | | | 1116 | 7 | bool IsFromExternalModule = true; | 1117 | 7 | for (const auto &Interface : API.getObjCInterfaces()) { | 1118 | 5 | if (InterfaceDecl->getName() == Interface.second.get()->Name) { | 1119 | 3 | IsFromExternalModule = false; | 1120 | 3 | break; | 1121 | 3 | } | 1122 | 5 | } | 1123 | | | 1124 | 7 | ObjCCategoryRecord *ObjCCategoryRecord = API.addObjCCategory( | 1125 | 7 | Name, USR, Loc, AvailabilitySet(Decl), Comment, Declaration, SubHeading, | 1126 | 7 | Interface, isInSystemHeader(Decl), IsFromExternalModule); | 1127 | | | 1128 | 7 | getDerivedExtractAPIVisitor().recordObjCMethods(ObjCCategoryRecord, | 1129 | 7 | Decl->methods()); | 1130 | 7 | getDerivedExtractAPIVisitor().recordObjCProperties(ObjCCategoryRecord, | 1131 | 7 | Decl->properties()); | 1132 | 7 | getDerivedExtractAPIVisitor().recordObjCInstanceVariables(ObjCCategoryRecord, | 1133 | 7 | Decl->ivars()); | 1134 | 7 | getDerivedExtractAPIVisitor().recordObjCProtocols(ObjCCategoryRecord, | 1135 | 7 | Decl->protocols()); | 1136 | | | 1137 | 7 | return true; | 1138 | 7 | } |
Unexecuted instantiation: clang::extractapi::impl::ExtractAPIVisitorBase<clang::extractapi::ExtractAPIVisitor<void> >::VisitObjCCategoryDecl(clang::ObjCCategoryDecl const*) Unexecuted instantiation: CXExtractAPI.cpp:clang::extractapi::impl::ExtractAPIVisitorBase<(anonymous namespace)::LibClangExtractAPIVisitor>::VisitObjCCategoryDecl(clang::ObjCCategoryDecl const*) |
1139 | | |
1140 | | /// Collect API information for the enum constants and associate with the |
1141 | | /// parent enum. |
1142 | | template <typename Derived> |
1143 | | void ExtractAPIVisitorBase<Derived>::recordEnumConstants( |
1144 | 7 | EnumRecord *EnumRecord, const EnumDecl::enumerator_range Constants) { |
1145 | 15 | for (const auto *Constant : Constants) { |
1146 | | // Collect symbol information. |
1147 | 15 | StringRef Name = Constant->getName(); |
1148 | 15 | StringRef USR = API.recordUSR(Constant); |
1149 | 15 | PresumedLoc Loc = |
1150 | 15 | Context.getSourceManager().getPresumedLoc(Constant->getLocation()); |
1151 | 15 | DocComment Comment; |
1152 | 15 | if (auto *RawComment = |
1153 | 15 | getDerivedExtractAPIVisitor().fetchRawCommentForDecl(Constant)) |
1154 | 1 | Comment = RawComment->getFormattedLines(Context.getSourceManager(), |
1155 | 1 | Context.getDiagnostics()); |
1156 | | |
1157 | | // Build declaration fragments and sub-heading for the enum constant. |
1158 | 15 | DeclarationFragments Declaration = |
1159 | 15 | DeclarationFragmentsBuilder::getFragmentsForEnumConstant(Constant); |
1160 | 15 | DeclarationFragments SubHeading = |
1161 | 15 | DeclarationFragmentsBuilder::getSubHeading(Constant); |
1162 | | |
1163 | 15 | API.addEnumConstant(EnumRecord, Name, USR, Loc, AvailabilitySet(Constant), |
1164 | 15 | Comment, Declaration, SubHeading, |
1165 | 15 | isInSystemHeader(Constant)); |
1166 | 15 | } |
1167 | 7 | } ExtractAPIConsumer.cpp:clang::extractapi::impl::ExtractAPIVisitorBase<(anonymous namespace)::BatchExtractAPIVisitor>::recordEnumConstants(clang::extractapi::EnumRecord*, llvm::iterator_range<clang::DeclContext::specific_decl_iterator<clang::EnumConstantDecl> >) Line | Count | Source | 1144 | 7 | EnumRecord *EnumRecord, const EnumDecl::enumerator_range Constants) { | 1145 | 15 | for (const auto *Constant : Constants) { | 1146 | | // Collect symbol information. | 1147 | 15 | StringRef Name = Constant->getName(); | 1148 | 15 | StringRef USR = API.recordUSR(Constant); | 1149 | 15 | PresumedLoc Loc = | 1150 | 15 | Context.getSourceManager().getPresumedLoc(Constant->getLocation()); | 1151 | 15 | DocComment Comment; | 1152 | 15 | if (auto *RawComment = | 1153 | 15 | getDerivedExtractAPIVisitor().fetchRawCommentForDecl(Constant)) | 1154 | 1 | Comment = RawComment->getFormattedLines(Context.getSourceManager(), | 1155 | 1 | Context.getDiagnostics()); | 1156 | | | 1157 | | // Build declaration fragments and sub-heading for the enum constant. | 1158 | 15 | DeclarationFragments Declaration = | 1159 | 15 | DeclarationFragmentsBuilder::getFragmentsForEnumConstant(Constant); | 1160 | 15 | DeclarationFragments SubHeading = | 1161 | 15 | DeclarationFragmentsBuilder::getSubHeading(Constant); | 1162 | | | 1163 | 15 | API.addEnumConstant(EnumRecord, Name, USR, Loc, AvailabilitySet(Constant), | 1164 | 15 | Comment, Declaration, SubHeading, | 1165 | 15 | isInSystemHeader(Constant)); | 1166 | 15 | } | 1167 | 7 | } |
Unexecuted instantiation: clang::extractapi::impl::ExtractAPIVisitorBase<clang::extractapi::ExtractAPIVisitor<void> >::recordEnumConstants(clang::extractapi::EnumRecord*, llvm::iterator_range<clang::DeclContext::specific_decl_iterator<clang::EnumConstantDecl> >) Unexecuted instantiation: CXExtractAPI.cpp:clang::extractapi::impl::ExtractAPIVisitorBase<(anonymous namespace)::LibClangExtractAPIVisitor>::recordEnumConstants(clang::extractapi::EnumRecord*, llvm::iterator_range<clang::DeclContext::specific_decl_iterator<clang::EnumConstantDecl> >) |
1168 | | |
1169 | | /// Collect API information for the struct fields and associate with the |
1170 | | /// parent struct. |
1171 | | template <typename Derived> |
1172 | | void ExtractAPIVisitorBase<Derived>::recordStructFields( |
1173 | 21 | StructRecord *StructRecord, const RecordDecl::field_range Fields) { |
1174 | 22 | for (const auto *Field : Fields) { |
1175 | | // Collect symbol information. |
1176 | 22 | StringRef Name = Field->getName(); |
1177 | 22 | StringRef USR = API.recordUSR(Field); |
1178 | 22 | PresumedLoc Loc = |
1179 | 22 | Context.getSourceManager().getPresumedLoc(Field->getLocation()); |
1180 | 22 | DocComment Comment; |
1181 | 22 | if (auto *RawComment = |
1182 | 22 | getDerivedExtractAPIVisitor().fetchRawCommentForDecl(Field)) |
1183 | 14 | Comment = RawComment->getFormattedLines(Context.getSourceManager(), |
1184 | 14 | Context.getDiagnostics()); |
1185 | | |
1186 | | // Build declaration fragments and sub-heading for the struct field. |
1187 | 22 | DeclarationFragments Declaration = |
1188 | 22 | DeclarationFragmentsBuilder::getFragmentsForField(Field); |
1189 | 22 | DeclarationFragments SubHeading = |
1190 | 22 | DeclarationFragmentsBuilder::getSubHeading(Field); |
1191 | | |
1192 | 22 | API.addStructField(StructRecord, Name, USR, Loc, AvailabilitySet(Field), |
1193 | 22 | Comment, Declaration, SubHeading, |
1194 | 22 | isInSystemHeader(Field)); |
1195 | 22 | } |
1196 | 21 | } ExtractAPIConsumer.cpp:clang::extractapi::impl::ExtractAPIVisitorBase<(anonymous namespace)::BatchExtractAPIVisitor>::recordStructFields(clang::extractapi::StructRecord*, llvm::iterator_range<clang::DeclContext::specific_decl_iterator<clang::FieldDecl> >) Line | Count | Source | 1173 | 8 | StructRecord *StructRecord, const RecordDecl::field_range Fields) { | 1174 | 9 | for (const auto *Field : Fields) { | 1175 | | // Collect symbol information. | 1176 | 9 | StringRef Name = Field->getName(); | 1177 | 9 | StringRef USR = API.recordUSR(Field); | 1178 | 9 | PresumedLoc Loc = | 1179 | 9 | Context.getSourceManager().getPresumedLoc(Field->getLocation()); | 1180 | 9 | DocComment Comment; | 1181 | 9 | if (auto *RawComment = | 1182 | 9 | getDerivedExtractAPIVisitor().fetchRawCommentForDecl(Field)) | 1183 | 1 | Comment = RawComment->getFormattedLines(Context.getSourceManager(), | 1184 | 1 | Context.getDiagnostics()); | 1185 | | | 1186 | | // Build declaration fragments and sub-heading for the struct field. | 1187 | 9 | DeclarationFragments Declaration = | 1188 | 9 | DeclarationFragmentsBuilder::getFragmentsForField(Field); | 1189 | 9 | DeclarationFragments SubHeading = | 1190 | 9 | DeclarationFragmentsBuilder::getSubHeading(Field); | 1191 | | | 1192 | 9 | API.addStructField(StructRecord, Name, USR, Loc, AvailabilitySet(Field), | 1193 | 9 | Comment, Declaration, SubHeading, | 1194 | 9 | isInSystemHeader(Field)); | 1195 | 9 | } | 1196 | 8 | } |
Unexecuted instantiation: clang::extractapi::impl::ExtractAPIVisitorBase<clang::extractapi::ExtractAPIVisitor<void> >::recordStructFields(clang::extractapi::StructRecord*, llvm::iterator_range<clang::DeclContext::specific_decl_iterator<clang::FieldDecl> >) CXExtractAPI.cpp:clang::extractapi::impl::ExtractAPIVisitorBase<(anonymous namespace)::LibClangExtractAPIVisitor>::recordStructFields(clang::extractapi::StructRecord*, llvm::iterator_range<clang::DeclContext::specific_decl_iterator<clang::FieldDecl> >) Line | Count | Source | 1173 | 13 | StructRecord *StructRecord, const RecordDecl::field_range Fields) { | 1174 | 13 | for (const auto *Field : Fields) { | 1175 | | // Collect symbol information. | 1176 | 13 | StringRef Name = Field->getName(); | 1177 | 13 | StringRef USR = API.recordUSR(Field); | 1178 | 13 | PresumedLoc Loc = | 1179 | 13 | Context.getSourceManager().getPresumedLoc(Field->getLocation()); | 1180 | 13 | DocComment Comment; | 1181 | 13 | if (auto *RawComment = | 1182 | 13 | getDerivedExtractAPIVisitor().fetchRawCommentForDecl(Field)) | 1183 | 13 | Comment = RawComment->getFormattedLines(Context.getSourceManager(), | 1184 | 13 | Context.getDiagnostics()); | 1185 | | | 1186 | | // Build declaration fragments and sub-heading for the struct field. | 1187 | 13 | DeclarationFragments Declaration = | 1188 | 13 | DeclarationFragmentsBuilder::getFragmentsForField(Field); | 1189 | 13 | DeclarationFragments SubHeading = | 1190 | 13 | DeclarationFragmentsBuilder::getSubHeading(Field); | 1191 | | | 1192 | 13 | API.addStructField(StructRecord, Name, USR, Loc, AvailabilitySet(Field), | 1193 | 13 | Comment, Declaration, SubHeading, | 1194 | 13 | isInSystemHeader(Field)); | 1195 | 13 | } | 1196 | 13 | } |
|
1197 | | |
1198 | | template <typename Derived> |
1199 | 27 | bool ExtractAPIVisitorBase<Derived>::VisitFieldDecl(const FieldDecl *Decl) { |
1200 | 27 | if (Decl->getDeclContext()->getDeclKind() == Decl::Record) |
1201 | 22 | return true; |
1202 | 5 | if (isa<ObjCIvarDecl>(Decl)) |
1203 | 1 | return true; |
1204 | | // Collect symbol information. |
1205 | 4 | StringRef Name = Decl->getName(); |
1206 | 4 | StringRef USR = API.recordUSR(Decl); |
1207 | 4 | PresumedLoc Loc = |
1208 | 4 | Context.getSourceManager().getPresumedLoc(Decl->getLocation()); |
1209 | 4 | DocComment Comment; |
1210 | 4 | if (auto *RawComment = |
1211 | 4 | getDerivedExtractAPIVisitor().fetchRawCommentForDecl(Decl)) |
1212 | 0 | Comment = RawComment->getFormattedLines(Context.getSourceManager(), |
1213 | 0 | Context.getDiagnostics()); |
1214 | | |
1215 | | // Build declaration fragments and sub-heading for the struct field. |
1216 | 4 | DeclarationFragments Declaration = |
1217 | 4 | DeclarationFragmentsBuilder::getFragmentsForField(Decl); |
1218 | 4 | DeclarationFragments SubHeading = |
1219 | 4 | DeclarationFragmentsBuilder::getSubHeading(Decl); |
1220 | 4 | AccessControl Access = DeclarationFragmentsBuilder::getAccessControl(Decl); |
1221 | | |
1222 | 4 | SmallString<128> ParentUSR; |
1223 | 4 | index::generateUSRForDecl(dyn_cast<CXXRecordDecl>(Decl->getDeclContext()), |
1224 | 4 | ParentUSR); |
1225 | 4 | API.addCXXField(API.findRecordForUSR(ParentUSR), Name, USR, Loc, |
1226 | 4 | AvailabilitySet(Decl), Comment, Declaration, SubHeading, |
1227 | 4 | Access, isInSystemHeader(Decl)); |
1228 | 4 | return true; |
1229 | 5 | } ExtractAPIConsumer.cpp:clang::extractapi::impl::ExtractAPIVisitorBase<(anonymous namespace)::BatchExtractAPIVisitor>::VisitFieldDecl(clang::FieldDecl const*) Line | Count | Source | 1199 | 17 | bool ExtractAPIVisitorBase<Derived>::VisitFieldDecl(const FieldDecl *Decl) { | 1200 | 17 | if (Decl->getDeclContext()->getDeclKind() == Decl::Record) | 1201 | 12 | return true; | 1202 | 5 | if (isa<ObjCIvarDecl>(Decl)) | 1203 | 1 | return true; | 1204 | | // Collect symbol information. | 1205 | 4 | StringRef Name = Decl->getName(); | 1206 | 4 | StringRef USR = API.recordUSR(Decl); | 1207 | 4 | PresumedLoc Loc = | 1208 | 4 | Context.getSourceManager().getPresumedLoc(Decl->getLocation()); | 1209 | 4 | DocComment Comment; | 1210 | 4 | if (auto *RawComment = | 1211 | 4 | getDerivedExtractAPIVisitor().fetchRawCommentForDecl(Decl)) | 1212 | 0 | Comment = RawComment->getFormattedLines(Context.getSourceManager(), | 1213 | 0 | Context.getDiagnostics()); | 1214 | | | 1215 | | // Build declaration fragments and sub-heading for the struct field. | 1216 | 4 | DeclarationFragments Declaration = | 1217 | 4 | DeclarationFragmentsBuilder::getFragmentsForField(Decl); | 1218 | 4 | DeclarationFragments SubHeading = | 1219 | 4 | DeclarationFragmentsBuilder::getSubHeading(Decl); | 1220 | 4 | AccessControl Access = DeclarationFragmentsBuilder::getAccessControl(Decl); | 1221 | | | 1222 | 4 | SmallString<128> ParentUSR; | 1223 | 4 | index::generateUSRForDecl(dyn_cast<CXXRecordDecl>(Decl->getDeclContext()), | 1224 | 4 | ParentUSR); | 1225 | 4 | API.addCXXField(API.findRecordForUSR(ParentUSR), Name, USR, Loc, | 1226 | 4 | AvailabilitySet(Decl), Comment, Declaration, SubHeading, | 1227 | 4 | Access, isInSystemHeader(Decl)); | 1228 | 4 | return true; | 1229 | 5 | } |
Unexecuted instantiation: clang::extractapi::impl::ExtractAPIVisitorBase<clang::extractapi::ExtractAPIVisitor<void> >::VisitFieldDecl(clang::FieldDecl const*) CXExtractAPI.cpp:clang::extractapi::impl::ExtractAPIVisitorBase<(anonymous namespace)::LibClangExtractAPIVisitor>::VisitFieldDecl(clang::FieldDecl const*) Line | Count | Source | 1199 | 10 | bool ExtractAPIVisitorBase<Derived>::VisitFieldDecl(const FieldDecl *Decl) { | 1200 | 10 | if (Decl->getDeclContext()->getDeclKind() == Decl::Record) | 1201 | 10 | return true; | 1202 | 0 | if (isa<ObjCIvarDecl>(Decl)) | 1203 | 0 | return true; | 1204 | | // Collect symbol information. | 1205 | 0 | StringRef Name = Decl->getName(); | 1206 | 0 | StringRef USR = API.recordUSR(Decl); | 1207 | 0 | PresumedLoc Loc = | 1208 | 0 | Context.getSourceManager().getPresumedLoc(Decl->getLocation()); | 1209 | 0 | DocComment Comment; | 1210 | 0 | if (auto *RawComment = | 1211 | 0 | getDerivedExtractAPIVisitor().fetchRawCommentForDecl(Decl)) | 1212 | 0 | Comment = RawComment->getFormattedLines(Context.getSourceManager(), | 1213 | 0 | Context.getDiagnostics()); | 1214 | | | 1215 | | // Build declaration fragments and sub-heading for the struct field. | 1216 | 0 | DeclarationFragments Declaration = | 1217 | 0 | DeclarationFragmentsBuilder::getFragmentsForField(Decl); | 1218 | 0 | DeclarationFragments SubHeading = | 1219 | 0 | DeclarationFragmentsBuilder::getSubHeading(Decl); | 1220 | 0 | AccessControl Access = DeclarationFragmentsBuilder::getAccessControl(Decl); | 1221 | |
| 1222 | 0 | SmallString<128> ParentUSR; | 1223 | 0 | index::generateUSRForDecl(dyn_cast<CXXRecordDecl>(Decl->getDeclContext()), | 1224 | 0 | ParentUSR); | 1225 | 0 | API.addCXXField(API.findRecordForUSR(ParentUSR), Name, USR, Loc, | 1226 | 0 | AvailabilitySet(Decl), Comment, Declaration, SubHeading, | 1227 | 0 | Access, isInSystemHeader(Decl)); | 1228 | 0 | return true; | 1229 | 0 | } |
|
1230 | | |
1231 | | template <typename Derived> |
1232 | | bool ExtractAPIVisitorBase<Derived>::VisitCXXConversionDecl( |
1233 | 2 | const CXXConversionDecl *Decl) { |
1234 | 2 | StringRef Name = API.copyString(Decl->getNameAsString()); |
1235 | 2 | StringRef USR = API.recordUSR(Decl); |
1236 | 2 | PresumedLoc Loc = |
1237 | 2 | Context.getSourceManager().getPresumedLoc(Decl->getLocation()); |
1238 | 2 | DocComment Comment; |
1239 | 2 | if (auto *RawComment = |
1240 | 2 | getDerivedExtractAPIVisitor().fetchRawCommentForDecl(Decl)) |
1241 | 0 | Comment = RawComment->getFormattedLines(Context.getSourceManager(), |
1242 | 0 | Context.getDiagnostics()); |
1243 | | |
1244 | | // Build declaration fragments, sub-heading, and signature for the method. |
1245 | 2 | DeclarationFragments Declaration = |
1246 | 2 | DeclarationFragmentsBuilder::getFragmentsForConversionFunction(Decl); |
1247 | 2 | DeclarationFragments SubHeading = |
1248 | 2 | DeclarationFragmentsBuilder::getSubHeading(Decl); |
1249 | 2 | FunctionSignature Signature = |
1250 | 2 | DeclarationFragmentsBuilder::getFunctionSignature(Decl); |
1251 | 2 | AccessControl Access = DeclarationFragmentsBuilder::getAccessControl(Decl); |
1252 | | |
1253 | 2 | SmallString<128> ParentUSR; |
1254 | 2 | index::generateUSRForDecl(dyn_cast<CXXRecordDecl>(Decl->getDeclContext()), |
1255 | 2 | ParentUSR); |
1256 | 2 | if (Decl->isStatic()) |
1257 | 0 | API.addCXXStaticMethod(API.findRecordForUSR(ParentUSR), Name, USR, Loc, |
1258 | 0 | AvailabilitySet(Decl), Comment, Declaration, |
1259 | 0 | SubHeading, Signature, Access, |
1260 | 0 | isInSystemHeader(Decl)); |
1261 | 2 | else |
1262 | 2 | API.addCXXInstanceMethod(API.findRecordForUSR(ParentUSR), Name, USR, Loc, |
1263 | 2 | AvailabilitySet(Decl), Comment, Declaration, |
1264 | 2 | SubHeading, Signature, Access, |
1265 | 2 | isInSystemHeader(Decl)); |
1266 | 2 | return true; |
1267 | 2 | } ExtractAPIConsumer.cpp:clang::extractapi::impl::ExtractAPIVisitorBase<(anonymous namespace)::BatchExtractAPIVisitor>::VisitCXXConversionDecl(clang::CXXConversionDecl const*) Line | Count | Source | 1233 | 2 | const CXXConversionDecl *Decl) { | 1234 | 2 | StringRef Name = API.copyString(Decl->getNameAsString()); | 1235 | 2 | StringRef USR = API.recordUSR(Decl); | 1236 | 2 | PresumedLoc Loc = | 1237 | 2 | Context.getSourceManager().getPresumedLoc(Decl->getLocation()); | 1238 | 2 | DocComment Comment; | 1239 | 2 | if (auto *RawComment = | 1240 | 2 | getDerivedExtractAPIVisitor().fetchRawCommentForDecl(Decl)) | 1241 | 0 | Comment = RawComment->getFormattedLines(Context.getSourceManager(), | 1242 | 0 | Context.getDiagnostics()); | 1243 | | | 1244 | | // Build declaration fragments, sub-heading, and signature for the method. | 1245 | 2 | DeclarationFragments Declaration = | 1246 | 2 | DeclarationFragmentsBuilder::getFragmentsForConversionFunction(Decl); | 1247 | 2 | DeclarationFragments SubHeading = | 1248 | 2 | DeclarationFragmentsBuilder::getSubHeading(Decl); | 1249 | 2 | FunctionSignature Signature = | 1250 | 2 | DeclarationFragmentsBuilder::getFunctionSignature(Decl); | 1251 | 2 | AccessControl Access = DeclarationFragmentsBuilder::getAccessControl(Decl); | 1252 | | | 1253 | 2 | SmallString<128> ParentUSR; | 1254 | 2 | index::generateUSRForDecl(dyn_cast<CXXRecordDecl>(Decl->getDeclContext()), | 1255 | 2 | ParentUSR); | 1256 | 2 | if (Decl->isStatic()) | 1257 | 0 | API.addCXXStaticMethod(API.findRecordForUSR(ParentUSR), Name, USR, Loc, | 1258 | 0 | AvailabilitySet(Decl), Comment, Declaration, | 1259 | 0 | SubHeading, Signature, Access, | 1260 | 0 | isInSystemHeader(Decl)); | 1261 | 2 | else | 1262 | 2 | API.addCXXInstanceMethod(API.findRecordForUSR(ParentUSR), Name, USR, Loc, | 1263 | 2 | AvailabilitySet(Decl), Comment, Declaration, | 1264 | 2 | SubHeading, Signature, Access, | 1265 | 2 | isInSystemHeader(Decl)); | 1266 | 2 | return true; | 1267 | 2 | } |
Unexecuted instantiation: clang::extractapi::impl::ExtractAPIVisitorBase<clang::extractapi::ExtractAPIVisitor<void> >::VisitCXXConversionDecl(clang::CXXConversionDecl const*) Unexecuted instantiation: CXExtractAPI.cpp:clang::extractapi::impl::ExtractAPIVisitorBase<(anonymous namespace)::LibClangExtractAPIVisitor>::VisitCXXConversionDecl(clang::CXXConversionDecl const*) |
1268 | | |
1269 | | /// Collect API information for the Objective-C methods and associate with the |
1270 | | /// parent container. |
1271 | | template <typename Derived> |
1272 | | void ExtractAPIVisitorBase<Derived>::recordObjCMethods( |
1273 | | ObjCContainerRecord *Container, |
1274 | 54 | const ObjCContainerDecl::method_range Methods) { |
1275 | 104 | for (const auto *Method : Methods) { |
1276 | | // Don't record selectors for properties. |
1277 | 104 | if (Method->isPropertyAccessor()) |
1278 | 67 | continue; |
1279 | | |
1280 | 37 | StringRef Name = API.copyString(Method->getSelector().getAsString()); |
1281 | 37 | StringRef USR = API.recordUSR(Method); |
1282 | 37 | PresumedLoc Loc = |
1283 | 37 | Context.getSourceManager().getPresumedLoc(Method->getLocation()); |
1284 | 37 | DocComment Comment; |
1285 | 37 | if (auto *RawComment = |
1286 | 37 | getDerivedExtractAPIVisitor().fetchRawCommentForDecl(Method)) |
1287 | 25 | Comment = RawComment->getFormattedLines(Context.getSourceManager(), |
1288 | 25 | Context.getDiagnostics()); |
1289 | | |
1290 | | // Build declaration fragments, sub-heading, and signature for the method. |
1291 | 37 | DeclarationFragments Declaration = |
1292 | 37 | DeclarationFragmentsBuilder::getFragmentsForObjCMethod(Method); |
1293 | 37 | DeclarationFragments SubHeading = |
1294 | 37 | DeclarationFragmentsBuilder::getSubHeading(Method); |
1295 | 37 | FunctionSignature Signature = |
1296 | 37 | DeclarationFragmentsBuilder::getFunctionSignature(Method); |
1297 | | |
1298 | 37 | API.addObjCMethod(Container, Name, USR, Loc, AvailabilitySet(Method), |
1299 | 37 | Comment, Declaration, SubHeading, Signature, |
1300 | 37 | Method->isInstanceMethod(), isInSystemHeader(Method)); |
1301 | 37 | } |
1302 | 54 | } ExtractAPIConsumer.cpp:clang::extractapi::impl::ExtractAPIVisitorBase<(anonymous namespace)::BatchExtractAPIVisitor>::recordObjCMethods(clang::extractapi::ObjCContainerRecord*, llvm::iterator_range<clang::DeclContext::specific_decl_iterator<clang::ObjCMethodDecl> >) Line | Count | Source | 1274 | 18 | const ObjCContainerDecl::method_range Methods) { | 1275 | 31 | for (const auto *Method : Methods) { | 1276 | | // Don't record selectors for properties. | 1277 | 31 | if (Method->isPropertyAccessor()) | 1278 | 19 | continue; | 1279 | | | 1280 | 12 | StringRef Name = API.copyString(Method->getSelector().getAsString()); | 1281 | 12 | StringRef USR = API.recordUSR(Method); | 1282 | 12 | PresumedLoc Loc = | 1283 | 12 | Context.getSourceManager().getPresumedLoc(Method->getLocation()); | 1284 | 12 | DocComment Comment; | 1285 | 12 | if (auto *RawComment = | 1286 | 12 | getDerivedExtractAPIVisitor().fetchRawCommentForDecl(Method)) | 1287 | 0 | Comment = RawComment->getFormattedLines(Context.getSourceManager(), | 1288 | 0 | Context.getDiagnostics()); | 1289 | | | 1290 | | // Build declaration fragments, sub-heading, and signature for the method. | 1291 | 12 | DeclarationFragments Declaration = | 1292 | 12 | DeclarationFragmentsBuilder::getFragmentsForObjCMethod(Method); | 1293 | 12 | DeclarationFragments SubHeading = | 1294 | 12 | DeclarationFragmentsBuilder::getSubHeading(Method); | 1295 | 12 | FunctionSignature Signature = | 1296 | 12 | DeclarationFragmentsBuilder::getFunctionSignature(Method); | 1297 | | | 1298 | 12 | API.addObjCMethod(Container, Name, USR, Loc, AvailabilitySet(Method), | 1299 | 12 | Comment, Declaration, SubHeading, Signature, | 1300 | 12 | Method->isInstanceMethod(), isInSystemHeader(Method)); | 1301 | 12 | } | 1302 | 18 | } |
Unexecuted instantiation: clang::extractapi::impl::ExtractAPIVisitorBase<clang::extractapi::ExtractAPIVisitor<void> >::recordObjCMethods(clang::extractapi::ObjCContainerRecord*, llvm::iterator_range<clang::DeclContext::specific_decl_iterator<clang::ObjCMethodDecl> >) CXExtractAPI.cpp:clang::extractapi::impl::ExtractAPIVisitorBase<(anonymous namespace)::LibClangExtractAPIVisitor>::recordObjCMethods(clang::extractapi::ObjCContainerRecord*, llvm::iterator_range<clang::DeclContext::specific_decl_iterator<clang::ObjCMethodDecl> >) Line | Count | Source | 1274 | 36 | const ObjCContainerDecl::method_range Methods) { | 1275 | 73 | for (const auto *Method : Methods) { | 1276 | | // Don't record selectors for properties. | 1277 | 73 | if (Method->isPropertyAccessor()) | 1278 | 48 | continue; | 1279 | | | 1280 | 25 | StringRef Name = API.copyString(Method->getSelector().getAsString()); | 1281 | 25 | StringRef USR = API.recordUSR(Method); | 1282 | 25 | PresumedLoc Loc = | 1283 | 25 | Context.getSourceManager().getPresumedLoc(Method->getLocation()); | 1284 | 25 | DocComment Comment; | 1285 | 25 | if (auto *RawComment = | 1286 | 25 | getDerivedExtractAPIVisitor().fetchRawCommentForDecl(Method)) | 1287 | 25 | Comment = RawComment->getFormattedLines(Context.getSourceManager(), | 1288 | 25 | Context.getDiagnostics()); | 1289 | | | 1290 | | // Build declaration fragments, sub-heading, and signature for the method. | 1291 | 25 | DeclarationFragments Declaration = | 1292 | 25 | DeclarationFragmentsBuilder::getFragmentsForObjCMethod(Method); | 1293 | 25 | DeclarationFragments SubHeading = | 1294 | 25 | DeclarationFragmentsBuilder::getSubHeading(Method); | 1295 | 25 | FunctionSignature Signature = | 1296 | 25 | DeclarationFragmentsBuilder::getFunctionSignature(Method); | 1297 | | | 1298 | 25 | API.addObjCMethod(Container, Name, USR, Loc, AvailabilitySet(Method), | 1299 | 25 | Comment, Declaration, SubHeading, Signature, | 1300 | 25 | Method->isInstanceMethod(), isInSystemHeader(Method)); | 1301 | 25 | } | 1302 | 36 | } |
|
1303 | | |
1304 | | template <typename Derived> |
1305 | | void ExtractAPIVisitorBase<Derived>::recordObjCProperties( |
1306 | | ObjCContainerRecord *Container, |
1307 | 54 | const ObjCContainerDecl::prop_range Properties) { |
1308 | 54 | for (const auto *Property : Properties) { |
1309 | 34 | StringRef Name = Property->getName(); |
1310 | 34 | StringRef USR = API.recordUSR(Property); |
1311 | 34 | PresumedLoc Loc = |
1312 | 34 | Context.getSourceManager().getPresumedLoc(Property->getLocation()); |
1313 | 34 | DocComment Comment; |
1314 | 34 | if (auto *RawComment = |
1315 | 34 | getDerivedExtractAPIVisitor().fetchRawCommentForDecl(Property)) |
1316 | 24 | Comment = RawComment->getFormattedLines(Context.getSourceManager(), |
1317 | 24 | Context.getDiagnostics()); |
1318 | | |
1319 | | // Build declaration fragments and sub-heading for the property. |
1320 | 34 | DeclarationFragments Declaration = |
1321 | 34 | DeclarationFragmentsBuilder::getFragmentsForObjCProperty(Property); |
1322 | 34 | DeclarationFragments SubHeading = |
1323 | 34 | DeclarationFragmentsBuilder::getSubHeading(Property); |
1324 | | |
1325 | 34 | StringRef GetterName = |
1326 | 34 | API.copyString(Property->getGetterName().getAsString()); |
1327 | 34 | StringRef SetterName = |
1328 | 34 | API.copyString(Property->getSetterName().getAsString()); |
1329 | | |
1330 | | // Get the attributes for property. |
1331 | 34 | unsigned Attributes = ObjCPropertyRecord::NoAttr; |
1332 | 34 | if (Property->getPropertyAttributes() & |
1333 | 34 | ObjCPropertyAttribute::kind_readonly) |
1334 | 1 | Attributes |= ObjCPropertyRecord::ReadOnly; |
1335 | | |
1336 | 34 | API.addObjCProperty( |
1337 | 34 | Container, Name, USR, Loc, AvailabilitySet(Property), Comment, |
1338 | 34 | Declaration, SubHeading, |
1339 | 34 | static_cast<ObjCPropertyRecord::AttributeKind>(Attributes), GetterName, |
1340 | 34 | SetterName, Property->isOptional(), |
1341 | 34 | !(Property->getPropertyAttributes() & |
1342 | 34 | ObjCPropertyAttribute::kind_class), |
1343 | 34 | isInSystemHeader(Property)); |
1344 | 34 | } |
1345 | 54 | } ExtractAPIConsumer.cpp:clang::extractapi::impl::ExtractAPIVisitorBase<(anonymous namespace)::BatchExtractAPIVisitor>::recordObjCProperties(clang::extractapi::ObjCContainerRecord*, llvm::iterator_range<clang::DeclContext::specific_decl_iterator<clang::ObjCPropertyDecl> >) Line | Count | Source | 1307 | 18 | const ObjCContainerDecl::prop_range Properties) { | 1308 | 18 | for (const auto *Property : Properties) { | 1309 | 10 | StringRef Name = Property->getName(); | 1310 | 10 | StringRef USR = API.recordUSR(Property); | 1311 | 10 | PresumedLoc Loc = | 1312 | 10 | Context.getSourceManager().getPresumedLoc(Property->getLocation()); | 1313 | 10 | DocComment Comment; | 1314 | 10 | if (auto *RawComment = | 1315 | 10 | getDerivedExtractAPIVisitor().fetchRawCommentForDecl(Property)) | 1316 | 0 | Comment = RawComment->getFormattedLines(Context.getSourceManager(), | 1317 | 0 | Context.getDiagnostics()); | 1318 | | | 1319 | | // Build declaration fragments and sub-heading for the property. | 1320 | 10 | DeclarationFragments Declaration = | 1321 | 10 | DeclarationFragmentsBuilder::getFragmentsForObjCProperty(Property); | 1322 | 10 | DeclarationFragments SubHeading = | 1323 | 10 | DeclarationFragmentsBuilder::getSubHeading(Property); | 1324 | | | 1325 | 10 | StringRef GetterName = | 1326 | 10 | API.copyString(Property->getGetterName().getAsString()); | 1327 | 10 | StringRef SetterName = | 1328 | 10 | API.copyString(Property->getSetterName().getAsString()); | 1329 | | | 1330 | | // Get the attributes for property. | 1331 | 10 | unsigned Attributes = ObjCPropertyRecord::NoAttr; | 1332 | 10 | if (Property->getPropertyAttributes() & | 1333 | 10 | ObjCPropertyAttribute::kind_readonly) | 1334 | 1 | Attributes |= ObjCPropertyRecord::ReadOnly; | 1335 | | | 1336 | 10 | API.addObjCProperty( | 1337 | 10 | Container, Name, USR, Loc, AvailabilitySet(Property), Comment, | 1338 | 10 | Declaration, SubHeading, | 1339 | 10 | static_cast<ObjCPropertyRecord::AttributeKind>(Attributes), GetterName, | 1340 | 10 | SetterName, Property->isOptional(), | 1341 | 10 | !(Property->getPropertyAttributes() & | 1342 | 10 | ObjCPropertyAttribute::kind_class), | 1343 | 10 | isInSystemHeader(Property)); | 1344 | 10 | } | 1345 | 18 | } |
Unexecuted instantiation: clang::extractapi::impl::ExtractAPIVisitorBase<clang::extractapi::ExtractAPIVisitor<void> >::recordObjCProperties(clang::extractapi::ObjCContainerRecord*, llvm::iterator_range<clang::DeclContext::specific_decl_iterator<clang::ObjCPropertyDecl> >) CXExtractAPI.cpp:clang::extractapi::impl::ExtractAPIVisitorBase<(anonymous namespace)::LibClangExtractAPIVisitor>::recordObjCProperties(clang::extractapi::ObjCContainerRecord*, llvm::iterator_range<clang::DeclContext::specific_decl_iterator<clang::ObjCPropertyDecl> >) Line | Count | Source | 1307 | 36 | const ObjCContainerDecl::prop_range Properties) { | 1308 | 36 | for (const auto *Property : Properties) { | 1309 | 24 | StringRef Name = Property->getName(); | 1310 | 24 | StringRef USR = API.recordUSR(Property); | 1311 | 24 | PresumedLoc Loc = | 1312 | 24 | Context.getSourceManager().getPresumedLoc(Property->getLocation()); | 1313 | 24 | DocComment Comment; | 1314 | 24 | if (auto *RawComment = | 1315 | 24 | getDerivedExtractAPIVisitor().fetchRawCommentForDecl(Property)) | 1316 | 24 | Comment = RawComment->getFormattedLines(Context.getSourceManager(), | 1317 | 24 | Context.getDiagnostics()); | 1318 | | | 1319 | | // Build declaration fragments and sub-heading for the property. | 1320 | 24 | DeclarationFragments Declaration = | 1321 | 24 | DeclarationFragmentsBuilder::getFragmentsForObjCProperty(Property); | 1322 | 24 | DeclarationFragments SubHeading = | 1323 | 24 | DeclarationFragmentsBuilder::getSubHeading(Property); | 1324 | | | 1325 | 24 | StringRef GetterName = | 1326 | 24 | API.copyString(Property->getGetterName().getAsString()); | 1327 | 24 | StringRef SetterName = | 1328 | 24 | API.copyString(Property->getSetterName().getAsString()); | 1329 | | | 1330 | | // Get the attributes for property. | 1331 | 24 | unsigned Attributes = ObjCPropertyRecord::NoAttr; | 1332 | 24 | if (Property->getPropertyAttributes() & | 1333 | 24 | ObjCPropertyAttribute::kind_readonly) | 1334 | 0 | Attributes |= ObjCPropertyRecord::ReadOnly; | 1335 | | | 1336 | 24 | API.addObjCProperty( | 1337 | 24 | Container, Name, USR, Loc, AvailabilitySet(Property), Comment, | 1338 | 24 | Declaration, SubHeading, | 1339 | 24 | static_cast<ObjCPropertyRecord::AttributeKind>(Attributes), GetterName, | 1340 | 24 | SetterName, Property->isOptional(), | 1341 | 24 | !(Property->getPropertyAttributes() & | 1342 | 24 | ObjCPropertyAttribute::kind_class), | 1343 | 24 | isInSystemHeader(Property)); | 1344 | 24 | } | 1345 | 36 | } |
|
1346 | | |
1347 | | template <typename Derived> |
1348 | | void ExtractAPIVisitorBase<Derived>::recordObjCInstanceVariables( |
1349 | | ObjCContainerRecord *Container, |
1350 | | const llvm::iterator_range< |
1351 | | DeclContext::specific_decl_iterator<ObjCIvarDecl>> |
1352 | 39 | Ivars) { |
1353 | 39 | for (const auto *Ivar : Ivars) { |
1354 | 1 | StringRef Name = Ivar->getName(); |
1355 | 1 | StringRef USR = API.recordUSR(Ivar); |
1356 | 1 | PresumedLoc Loc = |
1357 | 1 | Context.getSourceManager().getPresumedLoc(Ivar->getLocation()); |
1358 | 1 | DocComment Comment; |
1359 | 1 | if (auto *RawComment = |
1360 | 1 | getDerivedExtractAPIVisitor().fetchRawCommentForDecl(Ivar)) |
1361 | 0 | Comment = RawComment->getFormattedLines(Context.getSourceManager(), |
1362 | 0 | Context.getDiagnostics()); |
1363 | | |
1364 | | // Build declaration fragments and sub-heading for the instance variable. |
1365 | 1 | DeclarationFragments Declaration = |
1366 | 1 | DeclarationFragmentsBuilder::getFragmentsForField(Ivar); |
1367 | 1 | DeclarationFragments SubHeading = |
1368 | 1 | DeclarationFragmentsBuilder::getSubHeading(Ivar); |
1369 | | |
1370 | 1 | ObjCInstanceVariableRecord::AccessControl Access = |
1371 | 1 | Ivar->getCanonicalAccessControl(); |
1372 | | |
1373 | 1 | API.addObjCInstanceVariable(Container, Name, USR, Loc, |
1374 | 1 | AvailabilitySet(Ivar), Comment, Declaration, |
1375 | 1 | SubHeading, Access, isInSystemHeader(Ivar)); |
1376 | 1 | } |
1377 | 39 | } ExtractAPIConsumer.cpp:clang::extractapi::impl::ExtractAPIVisitorBase<(anonymous namespace)::BatchExtractAPIVisitor>::recordObjCInstanceVariables(clang::extractapi::ObjCContainerRecord*, llvm::iterator_range<clang::DeclContext::specific_decl_iterator<clang::ObjCIvarDecl> >) Line | Count | Source | 1352 | 14 | Ivars) { | 1353 | 14 | for (const auto *Ivar : Ivars) { | 1354 | 1 | StringRef Name = Ivar->getName(); | 1355 | 1 | StringRef USR = API.recordUSR(Ivar); | 1356 | 1 | PresumedLoc Loc = | 1357 | 1 | Context.getSourceManager().getPresumedLoc(Ivar->getLocation()); | 1358 | 1 | DocComment Comment; | 1359 | 1 | if (auto *RawComment = | 1360 | 1 | getDerivedExtractAPIVisitor().fetchRawCommentForDecl(Ivar)) | 1361 | 0 | Comment = RawComment->getFormattedLines(Context.getSourceManager(), | 1362 | 0 | Context.getDiagnostics()); | 1363 | | | 1364 | | // Build declaration fragments and sub-heading for the instance variable. | 1365 | 1 | DeclarationFragments Declaration = | 1366 | 1 | DeclarationFragmentsBuilder::getFragmentsForField(Ivar); | 1367 | 1 | DeclarationFragments SubHeading = | 1368 | 1 | DeclarationFragmentsBuilder::getSubHeading(Ivar); | 1369 | | | 1370 | 1 | ObjCInstanceVariableRecord::AccessControl Access = | 1371 | 1 | Ivar->getCanonicalAccessControl(); | 1372 | | | 1373 | 1 | API.addObjCInstanceVariable(Container, Name, USR, Loc, | 1374 | 1 | AvailabilitySet(Ivar), Comment, Declaration, | 1375 | 1 | SubHeading, Access, isInSystemHeader(Ivar)); | 1376 | 1 | } | 1377 | 14 | } |
Unexecuted instantiation: clang::extractapi::impl::ExtractAPIVisitorBase<clang::extractapi::ExtractAPIVisitor<void> >::recordObjCInstanceVariables(clang::extractapi::ObjCContainerRecord*, llvm::iterator_range<clang::DeclContext::specific_decl_iterator<clang::ObjCIvarDecl> >) CXExtractAPI.cpp:clang::extractapi::impl::ExtractAPIVisitorBase<(anonymous namespace)::LibClangExtractAPIVisitor>::recordObjCInstanceVariables(clang::extractapi::ObjCContainerRecord*, llvm::iterator_range<clang::DeclContext::specific_decl_iterator<clang::ObjCIvarDecl> >) Line | Count | Source | 1352 | 25 | Ivars) { | 1353 | 25 | for (const auto *Ivar : Ivars) { | 1354 | 0 | StringRef Name = Ivar->getName(); | 1355 | 0 | StringRef USR = API.recordUSR(Ivar); | 1356 | 0 | PresumedLoc Loc = | 1357 | 0 | Context.getSourceManager().getPresumedLoc(Ivar->getLocation()); | 1358 | 0 | DocComment Comment; | 1359 | 0 | if (auto *RawComment = | 1360 | 0 | getDerivedExtractAPIVisitor().fetchRawCommentForDecl(Ivar)) | 1361 | 0 | Comment = RawComment->getFormattedLines(Context.getSourceManager(), | 1362 | 0 | Context.getDiagnostics()); | 1363 | | | 1364 | | // Build declaration fragments and sub-heading for the instance variable. | 1365 | 0 | DeclarationFragments Declaration = | 1366 | 0 | DeclarationFragmentsBuilder::getFragmentsForField(Ivar); | 1367 | 0 | DeclarationFragments SubHeading = | 1368 | 0 | DeclarationFragmentsBuilder::getSubHeading(Ivar); | 1369 | |
| 1370 | 0 | ObjCInstanceVariableRecord::AccessControl Access = | 1371 | 0 | Ivar->getCanonicalAccessControl(); | 1372 | |
| 1373 | 0 | API.addObjCInstanceVariable(Container, Name, USR, Loc, | 1374 | 0 | AvailabilitySet(Ivar), Comment, Declaration, | 1375 | 0 | SubHeading, Access, isInSystemHeader(Ivar)); | 1376 | 0 | } | 1377 | 25 | } |
|
1378 | | |
1379 | | template <typename Derived> |
1380 | | void ExtractAPIVisitorBase<Derived>::recordObjCProtocols( |
1381 | | ObjCContainerRecord *Container, |
1382 | 54 | ObjCInterfaceDecl::protocol_range Protocols) { |
1383 | 54 | for (const auto *Protocol : Protocols) |
1384 | 4 | Container->Protocols.emplace_back(Protocol->getName(), |
1385 | 4 | API.recordUSR(Protocol)); |
1386 | 54 | } ExtractAPIConsumer.cpp:clang::extractapi::impl::ExtractAPIVisitorBase<(anonymous namespace)::BatchExtractAPIVisitor>::recordObjCProtocols(clang::extractapi::ObjCContainerRecord*, llvm::iterator_range<clang::ObjCProtocolDecl* const*>) Line | Count | Source | 1382 | 18 | ObjCInterfaceDecl::protocol_range Protocols) { | 1383 | 18 | for (const auto *Protocol : Protocols) | 1384 | 4 | Container->Protocols.emplace_back(Protocol->getName(), | 1385 | 4 | API.recordUSR(Protocol)); | 1386 | 18 | } |
Unexecuted instantiation: clang::extractapi::impl::ExtractAPIVisitorBase<clang::extractapi::ExtractAPIVisitor<void> >::recordObjCProtocols(clang::extractapi::ObjCContainerRecord*, llvm::iterator_range<clang::ObjCProtocolDecl* const*>) CXExtractAPI.cpp:clang::extractapi::impl::ExtractAPIVisitorBase<(anonymous namespace)::LibClangExtractAPIVisitor>::recordObjCProtocols(clang::extractapi::ObjCContainerRecord*, llvm::iterator_range<clang::ObjCProtocolDecl* const*>) Line | Count | Source | 1382 | 36 | ObjCInterfaceDecl::protocol_range Protocols) { | 1383 | 36 | for (const auto *Protocol : Protocols) | 1384 | 0 | Container->Protocols.emplace_back(Protocol->getName(), | 1385 | 0 | API.recordUSR(Protocol)); | 1386 | 36 | } |
|
1387 | | |
1388 | | } // namespace impl |
1389 | | |
1390 | | /// The RecursiveASTVisitor to traverse symbol declarations and collect API |
1391 | | /// information. |
1392 | | template <typename Derived = void> |
1393 | | class ExtractAPIVisitor |
1394 | | : public impl::ExtractAPIVisitorBase<std::conditional_t< |
1395 | | std::is_same_v<Derived, void>, ExtractAPIVisitor<>, Derived>> { |
1396 | | using Base = impl::ExtractAPIVisitorBase<std::conditional_t< |
1397 | | std::is_same_v<Derived, void>, ExtractAPIVisitor<>, Derived>>; |
1398 | | |
1399 | | public: |
1400 | 75 | ExtractAPIVisitor(ASTContext &Context, APISet &API) : Base(Context, API) {} ExtractAPIConsumer.cpp:clang::extractapi::ExtractAPIVisitor<(anonymous namespace)::BatchExtractAPIVisitor>::ExtractAPIVisitor(clang::ASTContext&, clang::extractapi::APISet&) Line | Count | Source | 1400 | 53 | ExtractAPIVisitor(ASTContext &Context, APISet &API) : Base(Context, API) {} |
clang::extractapi::ExtractAPIVisitor<void>::ExtractAPIVisitor(clang::ASTContext&, clang::extractapi::APISet&) Line | Count | Source | 1400 | 3 | ExtractAPIVisitor(ASTContext &Context, APISet &API) : Base(Context, API) {} |
CXExtractAPI.cpp:clang::extractapi::ExtractAPIVisitor<(anonymous namespace)::LibClangExtractAPIVisitor>::ExtractAPIVisitor(clang::ASTContext&, clang::extractapi::APISet&) Line | Count | Source | 1400 | 19 | ExtractAPIVisitor(ASTContext &Context, APISet &API) : Base(Context, API) {} |
|
1401 | | |
1402 | 57 | bool shouldDeclBeIncluded(const Decl *D) const { return true; } clang::extractapi::ExtractAPIVisitor<void>::shouldDeclBeIncluded(clang::Decl const*) const Line | Count | Source | 1402 | 8 | bool shouldDeclBeIncluded(const Decl *D) const { return true; } |
CXExtractAPI.cpp:clang::extractapi::ExtractAPIVisitor<(anonymous namespace)::LibClangExtractAPIVisitor>::shouldDeclBeIncluded(clang::Decl const*) const Line | Count | Source | 1402 | 49 | bool shouldDeclBeIncluded(const Decl *D) const { return true; } |
|
1403 | 191 | const RawComment *fetchRawCommentForDecl(const Decl *D) const { |
1404 | 191 | return this->Context.getRawCommentForDeclNoCache(D); |
1405 | 191 | } ExtractAPIConsumer.cpp:clang::extractapi::ExtractAPIVisitor<(anonymous namespace)::BatchExtractAPIVisitor>::fetchRawCommentForDecl(clang::Decl const*) const Line | Count | Source | 1403 | 183 | const RawComment *fetchRawCommentForDecl(const Decl *D) const { | 1404 | 183 | return this->Context.getRawCommentForDeclNoCache(D); | 1405 | 183 | } |
clang::extractapi::ExtractAPIVisitor<void>::fetchRawCommentForDecl(clang::Decl const*) const Line | Count | Source | 1403 | 8 | const RawComment *fetchRawCommentForDecl(const Decl *D) const { | 1404 | 8 | return this->Context.getRawCommentForDeclNoCache(D); | 1405 | 8 | } |
|
1406 | | }; |
1407 | | |
1408 | | } // namespace extractapi |
1409 | | } // namespace clang |
1410 | | |
1411 | | #endif // LLVM_CLANG_EXTRACTAPI_EXTRACT_API_VISITOR_H |