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

Method setDeclData

plugins/clang/duchain/builder.cpp:1014–1033  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1012//BEGIN setDeclData
1013template<CXCursorKind CK>
1014void Visitor::setDeclData(CXCursor cursor, Declaration *decl, bool setComment) const
1015{
1016 if (setComment)
1017#if CINDEX_VERSION_MINOR < 100 // FIXME https://bugs.llvm.org/show_bug.cgi?id=35333
1018 decl->setComment(KDevelop::formatComment(ClangString(clang_Cursor_getRawCommentText(cursor)).toByteArray()));
1019#else
1020 decl->setComment(makeComment(clang_Cursor_getParsedComment(cursor)));
1021#endif
1022 if (CursorKindTraits::isAliasType(CK)) {
1023 decl->setIsTypeAlias(true);
1024 }
1025 if (CK == CXCursor_Namespace)
1026 decl->setKind(Declaration::Namespace);
1027 if (CK == CXCursor_EnumDecl || CK == CXCursor_EnumConstantDecl || CursorKindTraits::isClass(CK) || CursorKindTraits::isAliasType(CK))
1028 decl->setKind(Declaration::Type);
1029
1030 int isAlwaysDeprecated;
1031 clang_getCursorPlatformAvailability(cursor, &isAlwaysDeprecated, nullptr, nullptr, nullptr, nullptr, 0);
1032 decl->setDeprecated(isAlwaysDeprecated);
1033}
1034
1035/// @return the position in @p contents where the macro identifier ends.
1036static int skipMacroIdentifier(QStringView contents)

Callers

nothing calls this directly

Calls 15

formatCommentFunction · 0.85
ClangStringClass · 0.85
makeCommentFunction · 0.85
isAliasTypeFunction · 0.85
isClassFunction · 0.85
skipMacroIdentifierFunction · 0.85
kdevAccessPolicyFunction · 0.85
toByteArrayMethod · 0.80
setIsTypeAliasMethod · 0.80
setDeprecatedMethod · 0.80
setDefinitionMethod · 0.80
setFunctionLikeMethod · 0.80

Tested by

no test coverage detected