MCPcopy Create free account
hub / github.com/andreasfertig/cppinsights / GetFirstPolymorphicBaseName

Function GetFirstPolymorphicBaseName

CfrontCodeGenerator.cpp:847–861  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

845//-----------------------------------------------------------------------------
846
847static 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.

Callers 1

InsertArgMethod · 0.85

Calls 1

GetNameFunction · 0.85

Tested by

no test coverage detected