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

Function findEmbeddedTypeAlias

plugins/clang/duchain/builder.cpp:68–80  ·  view source on GitHub ↗

BEGIN helpers HACK: current alias type template machinery is badly broken wrt spelling location, work around this by adjusting all references to point to child type alias node with proper location TODO: investigate upstream implementation of CXCursor_TypeAliasTemplateDecl

Source from the content-addressed store, hash-verified

66// type alias node with proper location
67// TODO: investigate upstream implementation of CXCursor_TypeAliasTemplateDecl
68CXCursor findEmbeddedTypeAlias(CXCursor aliasTemplate)
69{
70 auto result = clang_getNullCursor();
71 clang_visitChildren(aliasTemplate, [] (CXCursor cursor, CXCursor, CXClientData data) {
72 if (clang_getCursorKind(cursor) == CXCursor_TypeAliasDecl) {
73 auto res = reinterpret_cast<CXCursor*>(data);
74 *res = cursor;
75 return CXChildVisit_Break;
76 }
77 return CXChildVisit_Continue;
78 }, &result);
79 return result;
80}
81
82/**
83 * Find the cursor that cursor @p cursor references

Callers 2

referencedCursorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected