23 static constexpr std::array<Spelling, 3> S = {{
25 .Syntax = clang::ParsedAttr::AS_GNU,
26 .NormalizedFullName =
"mllif_export",
29 .Syntax = clang::ParsedAttr::AS_C23,
30 .NormalizedFullName =
"mllif::export",
33 .Syntax = clang::ParsedAttr::AS_CXX11,
34 .NormalizedFullName =
"mllif::export",
49 if (
const auto record = clang::dyn_cast<clang::CXXRecordDecl>(D)) {
50 for (
const auto method : record->methods()) {
51 if (method->getVisibility() != clang::Visibility::HiddenVisibility) {
55 }
else if (
const auto fn = clang::dyn_cast<clang::FunctionDecl>(D)) {
58 const auto id = S.Diags.getCustomDiagID(
59 clang::DiagnosticsEngine::Warning,
60 "%0 '%1' can not be exported; Only function can be exported. "
61 "If you want to export records such as class or struct, You can make a function that depends on these records");
64 if (
const auto named = clang::dyn_cast<clang::NamedDecl>(D)) {
65 name = named->getName();
67 name = std::to_string(D->getID());
70 S.Diag(D->getLocation(),
id) << D->getDeclKindName() << name;
72 return AttributeNotApplied;
75 return AttributeApplied;