Skip to content

Commit 3097cce

Browse files
committed
clang importer: import __attribute__((swift_attr("sensitive"))) on C structs as @sensitive attributes
1 parent a980452 commit 3097cce

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/ClangImporter/ImportDecl.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8075,6 +8075,14 @@ ClangImporter::Implementation::importSwiftAttrAttributes(Decl *MappedDecl) {
80758075
continue;
80768076
}
80778077

8078+
if (swiftAttr->getAttribute() == "sensitive") {
8079+
if (!SwiftContext.LangOpts.hasFeature(Feature::Sensitive))
8080+
continue;
8081+
auto attr = new (SwiftContext) SensitiveAttr(/*implicit=*/true);
8082+
MappedDecl->getAttrs().add(attr);
8083+
continue;
8084+
}
8085+
80788086
// Dig out a buffer with the attribute text.
80798087
unsigned bufferID = getClangSwiftAttrSourceBuffer(
80808088
swiftAttr->getAttribute());

0 commit comments

Comments
 (0)