@@ -461,12 +461,12 @@ func getParameterIndexForDeclRef(
461461/// Intended to map to C attributes like __counted_by, __ended_by and __no_escape,
462462/// for automatic application by ClangImporter when the C declaration is annotated
463463/// appropriately.
464- public struct PointerBoundsMacro : PeerMacro {
464+ public struct SwiftifyImportMacro : PeerMacro {
465465 static func parseEnumName( _ enumConstructorExpr: FunctionCallExprSyntax ) throws -> String {
466466 guard let calledExpr = enumConstructorExpr. calledExpression. as ( MemberAccessExprSyntax . self)
467467 else {
468468 throw DiagnosticError (
469- " expected PointerParam enum literal as argument, got ' \( enumConstructorExpr) ' " ,
469+ " expected _SwiftifyInfo enum literal as argument, got ' \( enumConstructorExpr) ' " ,
470470 node: enumConstructorExpr)
471471 }
472472 return calledExpr. declName. baseName. text
@@ -564,7 +564,7 @@ public struct PointerBoundsMacro: PeerMacro {
564564 let paramExpr = paramAST. expression
565565 guard let enumConstructorExpr = paramExpr. as ( FunctionCallExprSyntax . self) else {
566566 throw DiagnosticError (
567- " expected PointerParam enum literal as argument, got ' \( paramExpr) ' " , node: paramExpr)
567+ " expected _SwiftifyInfo enum literal as argument, got ' \( paramExpr) ' " , node: paramExpr)
568568 }
569569 let enumName = try parseEnumName ( enumConstructorExpr)
570570 switch enumName {
@@ -627,7 +627,7 @@ public struct PointerBoundsMacro: PeerMacro {
627627 }
628628 if argByIndex [ i] != nil {
629629 throw DiagnosticError (
630- " multiple PointerParams referring to parameter with index "
630+ " multiple _SwiftifyInfos referring to parameter with index "
631631 + " \( i) : \( pointerArg) and \( argByIndex [ i] !) " , node: pointerArg. original)
632632 }
633633 argByIndex [ i] = pointerArg
@@ -647,7 +647,7 @@ public struct PointerBoundsMacro: PeerMacro {
647647 ) throws -> [ DeclSyntax ] {
648648 do {
649649 guard let funcDecl = declaration. as ( FunctionDeclSyntax . self) else {
650- throw DiagnosticError ( " @PointerBounds only works on functions " , node: declaration)
650+ throw DiagnosticError ( " @_SwiftifyImport only works on functions " , node: declaration)
651651 }
652652
653653 let argumentList = node. arguments!. as ( LabeledExprListSyntax . self) !
@@ -692,7 +692,7 @@ public struct PointerBoundsMacro: PeerMacro {
692692 case . attribute( let attr) :
693693 // don't apply this macro recursively, and avoid dupe _alwaysEmitIntoClient
694694 let name = attr. attributeName. as ( IdentifierTypeSyntax . self) ? . name. text
695- return name == nil || ( name != " PointerBounds " && name != " _alwaysEmitIntoClient " )
695+ return name == nil || ( name != " _SwiftifyImport " && name != " _alwaysEmitIntoClient " )
696696 default : return true
697697 }
698698 } + [
0 commit comments