| 577 | } |
| 578 | |
| 579 | CodeModelItem::Kind kindForDeclaration(Declaration* decl) |
| 580 | { |
| 581 | CodeModelItem::Kind kind = CodeModelItem::Unknown; |
| 582 | |
| 583 | if (decl->kind() == Declaration::Namespace) |
| 584 | return CodeModelItem::Namespace; |
| 585 | |
| 586 | if (decl->isFunctionDeclaration()) { |
| 587 | kind = CodeModelItem::Function; |
| 588 | } |
| 589 | |
| 590 | if (decl->kind() == Declaration::Type && (decl->type<StructureType>() || dynamic_cast<ClassDeclaration*>(decl))) |
| 591 | kind = CodeModelItem::Class; |
| 592 | |
| 593 | if (kind == CodeModelItem::Unknown && decl->kind() == Declaration::Instance) |
| 594 | kind = CodeModelItem::Variable; |
| 595 | |
| 596 | if (decl->isForwardDeclaration()) |
| 597 | kind = ( CodeModelItem::Kind )(kind | CodeModelItem::ForwardDeclaration); |
| 598 | |
| 599 | if (decl->context() && decl->context()->type() == DUContext::Class) |
| 600 | kind = ( CodeModelItem::Kind )(kind | CodeModelItem::ClassMember); |
| 601 | |
| 602 | return kind; |
| 603 | } |
| 604 | |
| 605 | void Declaration::updateCodeModel() |
| 606 | { |
no test coverage detected