MCPcopy Create free account
hub / github.com/KDE/kdevelop / buildTypeAliasTemplateDecl

Method buildTypeAliasTemplateDecl

plugins/clang/duchain/builder.cpp:1363–1380  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1361
1362template<bool IsInClass>
1363CXChildVisitResult Visitor::buildTypeAliasTemplateDecl(CXCursor cursor)
1364{
1365 auto aliasDecl = findEmbeddedTypeAlias(cursor);
1366 // NOTE: using aliasDecl here averts having to add a workaround to makeId()
1367 auto id = makeId(aliasDecl);
1368 // create template context to prevent leaking child template params
1369 auto context = createContext<CXCursor_TypeAliasTemplateDecl, DUContext::Template>(cursor, QualifiedIdentifier(id));
1370 using DeclType = typename DeclType<CXCursor_TypeAliasDecl, false, IsInClass>::Type;
1371 createDeclaration<CXCursor_TypeAliasDecl, DeclType>(aliasDecl, id, context);
1372 CurrentContext newParent(context, m_parentContext->keepAliveContexts);
1373 PushValue<CurrentContext*> pushCurrent(m_parentContext, &newParent);
1374 clang_visitChildren(cursor, [] (CXCursor cursor, CXCursor parent, CXClientData data) {
1375 // NOTE: immediately recurse into embedded alias decl
1376 return clang_getCursorKind(cursor) == CXCursor_TypeAliasDecl ?
1377 CXChildVisit_Recurse : visitCursor(cursor, parent, data);
1378 }, this);
1379 return CXChildVisit_Continue;
1380}
1381//END build*
1382
1383DeclarationPointer Visitor::findDeclaration(CXCursor cursor) const

Callers

nothing calls this directly

Calls 4

findEmbeddedTypeAliasFunction · 0.85
makeIdFunction · 0.85
visitCursorFunction · 0.70
QualifiedIdentifierClass · 0.50

Tested by

no test coverage detected