| 281 | } |
| 282 | |
| 283 | DeclarationPointer ClangHelpers::findForwardDeclaration(CXType type, DUContext* context, CXCursor cursor) |
| 284 | { |
| 285 | if(type.kind != CXType_Record && type.kind != CXType_ObjCInterface && type.kind != CXType_ObjCClass){ |
| 286 | return {}; |
| 287 | } |
| 288 | |
| 289 | auto qualifiedIdentifier = QualifiedIdentifier(ClangString(clang_getTypeSpelling(type)).toString()); |
| 290 | |
| 291 | DUChainReadLocker lock; |
| 292 | const auto decls = context->findDeclarations(qualifiedIdentifier, |
| 293 | CursorInRevision(ClangLocation(clang_getCursorLocation(cursor))) |
| 294 | ); |
| 295 | |
| 296 | for (auto decl : decls) { |
| 297 | if (decl->isForwardDeclaration()) { |
| 298 | return DeclarationPointer(decl); |
| 299 | } |
| 300 | } |
| 301 | return {}; |
| 302 | } |
| 303 | |
| 304 | RangeInRevision ClangHelpers::cursorSpellingNameRange(CXCursor cursor, const Identifier& id) |
| 305 | { |
nothing calls this directly
no test coverage detected