@todo remove constant and topContext
| 38 | |
| 39 | ///@todo remove constant and topContext |
| 40 | AbstractType::Ptr targetType(const AbstractType::Ptr& _base, const TopDUContext* /*topContext*/, bool* /*constant*/) |
| 41 | { |
| 42 | auto base = _base; |
| 43 | |
| 44 | auto ref = base.dynamicCast<ReferenceType>(); |
| 45 | auto pnt = base.dynamicCast<PointerType>(); |
| 46 | auto alias = base.dynamicCast<TypeAliasType>(); |
| 47 | |
| 48 | while (ref || pnt || alias) { |
| 49 | uint hadModifiers = base->modifiers(); |
| 50 | |
| 51 | if (ref) { |
| 52 | base = ref->baseType(); |
| 53 | } else if (pnt) { |
| 54 | base = pnt->baseType(); |
| 55 | } else { |
| 56 | base = alias->type(); |
| 57 | } |
| 58 | if ((alias || ref) && hadModifiers && base) |
| 59 | base->setModifiers(base->modifiers() | hadModifiers); |
| 60 | |
| 61 | ref = base.dynamicCast<ReferenceType>(); |
| 62 | pnt = base.dynamicCast<PointerType>(); |
| 63 | alias = base.dynamicCast<TypeAliasType>(); |
| 64 | } |
| 65 | |
| 66 | return base; |
| 67 | } |
| 68 | |
| 69 | AbstractType::Ptr targetTypeKeepAliases(const AbstractType::Ptr& _base, const TopDUContext* /*topContext*/, |
| 70 | bool* /*constant*/) |