| 845 | //----------------------------------------------------------------------------- |
| 846 | |
| 847 | static std::string GetFirstPolymorphicBaseName(const RecordDecl* decl, const RecordDecl* to) |
| 848 | { |
| 849 | std::string ret{GetName(*decl)}; |
| 850 | |
| 851 | if(const auto* rdecl = dyn_cast_or_null<CXXRecordDecl>(decl); rdecl->getNumBases() > 1) { |
| 852 | for(const auto& base : rdecl->bases()) { |
| 853 | if(const auto* rd = base.getType()->getAsRecordDecl(); rd == to) { |
| 854 | ret += GetFirstPolymorphicBaseName(rd, to); |
| 855 | break; |
| 856 | } |
| 857 | } |
| 858 | } |
| 859 | |
| 860 | return ret; |
| 861 | } |
| 862 | //----------------------------------------------------------------------------- |
| 863 | |
| 864 | ///! Find the first polymorphic base class. |