@@ -461,12 +461,12 @@ func getParameterIndexForDeclRef(
461
461
/// Intended to map to C attributes like __counted_by, __ended_by and __no_escape,
462
462
/// for automatic application by ClangImporter when the C declaration is annotated
463
463
/// appropriately.
464
- public struct PointerBoundsMacro : PeerMacro {
464
+ public struct SwiftifyImportMacro : PeerMacro {
465
465
static func parseEnumName( _ enumConstructorExpr: FunctionCallExprSyntax ) throws -> String {
466
466
guard let calledExpr = enumConstructorExpr. calledExpression. as ( MemberAccessExprSyntax . self)
467
467
else {
468
468
throw DiagnosticError (
469
- " expected PointerParam enum literal as argument, got ' \( enumConstructorExpr) ' " ,
469
+ " expected _SwiftifyInfo enum literal as argument, got ' \( enumConstructorExpr) ' " ,
470
470
node: enumConstructorExpr)
471
471
}
472
472
return calledExpr. declName. baseName. text
@@ -564,7 +564,7 @@ public struct PointerBoundsMacro: PeerMacro {
564
564
let paramExpr = paramAST. expression
565
565
guard let enumConstructorExpr = paramExpr. as ( FunctionCallExprSyntax . self) else {
566
566
throw DiagnosticError (
567
- " expected PointerParam enum literal as argument, got ' \( paramExpr) ' " , node: paramExpr)
567
+ " expected _SwiftifyInfo enum literal as argument, got ' \( paramExpr) ' " , node: paramExpr)
568
568
}
569
569
let enumName = try parseEnumName ( enumConstructorExpr)
570
570
switch enumName {
@@ -627,7 +627,7 @@ public struct PointerBoundsMacro: PeerMacro {
627
627
}
628
628
if argByIndex [ i] != nil {
629
629
throw DiagnosticError (
630
- " multiple PointerParams referring to parameter with index "
630
+ " multiple _SwiftifyInfos referring to parameter with index "
631
631
+ " \( i) : \( pointerArg) and \( argByIndex [ i] !) " , node: pointerArg. original)
632
632
}
633
633
argByIndex [ i] = pointerArg
@@ -647,7 +647,7 @@ public struct PointerBoundsMacro: PeerMacro {
647
647
) throws -> [ DeclSyntax ] {
648
648
do {
649
649
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)
651
651
}
652
652
653
653
let argumentList = node. arguments!. as ( LabeledExprListSyntax . self) !
@@ -692,7 +692,7 @@ public struct PointerBoundsMacro: PeerMacro {
692
692
case . attribute( let attr) :
693
693
// don't apply this macro recursively, and avoid dupe _alwaysEmitIntoClient
694
694
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 " )
696
696
default : return true
697
697
}
698
698
} + [
0 commit comments