[clang] [APINotes] Support annotating safety of APIs (PR #157506)
Gábor Horváth via cfe-commits
cfe-commits at lists.llvm.org
Fri Sep 12 08:37:48 PDT 2025
================
@@ -291,6 +292,13 @@ static void ProcessAPINotes(Sema &S, Decl *D,
});
}
+ // swift_safety
+ if (auto SafetyKind = Info.getSwiftSafety();
+ SafetyKind != api_notes::SwiftSafetyKind::None)
+ D->addAttr(SwiftAttrAttr::Create(
+ S.Context,
+ SafetyKind == api_notes::SwiftSafetyKind::Safe ? "safe" : "unsafe"));
----------------
Xazax-hun wrote:
Added the test. PTAL.
https://github.com/llvm/llvm-project/pull/157506
More information about the cfe-commits
mailing list