Skip to content

Commit e840409

Browse files
committed
[ASTGen] Remove unnecessary parameters from the expansion funcs
1 parent 0e31393 commit e840409

File tree

1 file changed

+8
-24
lines changed

1 file changed

+8
-24
lines changed

lib/ASTGen/Sources/ASTGen/Macros.swift

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -205,18 +205,14 @@ func expandFreestandingMacro(
205205
diagEnginePtr: diagEnginePtr,
206206
macroSyntax: macroSyntax,
207207
sourceFilePtr: sourceFilePtr,
208-
discriminator: discriminator,
209-
expandedSourcePointer: expandedSourcePointer,
210-
expandedSourceLength: expandedSourceLength)
208+
discriminator: discriminator)
211209
case .Executable:
212210
expandedSource = expandFreestandingMacroIPC(
213211
macroPtr: macroPtr,
214212
diagEnginePtr: diagEnginePtr,
215213
macroSyntax: macroSyntax,
216214
sourceFilePtr: sourceFilePtr,
217-
discriminator: discriminator,
218-
expandedSourcePointer: expandedSourcePointer,
219-
expandedSourceLength: expandedSourceLength)
215+
discriminator: discriminator)
220216
}
221217

222218
guard var expandedSource = expandedSource else {
@@ -243,9 +239,7 @@ func expandFreestandingMacroIPC(
243239
diagEnginePtr: UnsafeMutablePointer<UInt8>,
244240
macroSyntax: Syntax,
245241
sourceFilePtr: UnsafePointer<ExportedSourceFile>,
246-
discriminator: String,
247-
expandedSourcePointer: UnsafeMutablePointer<UnsafePointer<UInt8>?>,
248-
expandedSourceLength: UnsafeMutablePointer<Int>
242+
discriminator: String
249243
) -> String? {
250244

251245
let macroName: String
@@ -291,9 +285,7 @@ func expandFreestandingMacroInProcess(
291285
diagEnginePtr: UnsafeMutablePointer<UInt8>,
292286
macroSyntax: Syntax,
293287
sourceFilePtr: UnsafePointer<ExportedSourceFile>,
294-
discriminator: String,
295-
expandedSourcePointer: UnsafeMutablePointer<UnsafePointer<UInt8>?>,
296-
expandedSourceLength: UnsafeMutablePointer<Int>
288+
discriminator: String
297289
) -> String? {
298290

299291
// Create a source manager. This should probably persist and be given to us.
@@ -492,9 +484,7 @@ func expandAttachedMacro(
492484
declarationSourceFilePtr: declarationSourceFilePtr,
493485
attachedTo: declarationNode,
494486
parentDeclSourceFilePtr: parentDeclSourceFilePtr,
495-
parentDeclNode: parentDeclNode,
496-
expandedSourcePointer: expandedSourcePointer,
497-
expandedSourceLength: expandedSourceLength)
487+
parentDeclNode: parentDeclNode)
498488
case .InProcess:
499489
expandedSources = expandAttachedMacroInProcess(
500490
diagEnginePtr: diagEnginePtr,
@@ -506,9 +496,7 @@ func expandAttachedMacro(
506496
declarationSourceFilePtr: declarationSourceFilePtr,
507497
attachedTo: declarationNode,
508498
parentDeclSourceFilePtr: parentDeclSourceFilePtr,
509-
parentDeclNode: parentDeclNode,
510-
expandedSourcePointer: expandedSourcePointer,
511-
expandedSourceLength: expandedSourceLength)
499+
parentDeclNode: parentDeclNode)
512500
}
513501

514502
guard let expandedSources = expandedSources else {
@@ -556,9 +544,7 @@ func expandAttachedMacroIPC(
556544
declarationSourceFilePtr: UnsafePointer<ExportedSourceFile>,
557545
attachedTo declarationNode: DeclSyntax,
558546
parentDeclSourceFilePtr: UnsafePointer<ExportedSourceFile>?,
559-
parentDeclNode: DeclSyntax?,
560-
expandedSourcePointer: UnsafeMutablePointer<UnsafePointer<UInt8>?>,
561-
expandedSourceLength: UnsafeMutablePointer<Int>
547+
parentDeclNode: DeclSyntax?
562548
) -> [String]? {
563549
let macroName: String = customAttrNode.attributeName.description
564550
let macro = macroPtr.assumingMemoryBound(to: ExportedExecutableMacro.self).pointee
@@ -634,9 +620,7 @@ func expandAttachedMacroInProcess(
634620
declarationSourceFilePtr: UnsafePointer<ExportedSourceFile>,
635621
attachedTo declarationNode: DeclSyntax,
636622
parentDeclSourceFilePtr: UnsafePointer<ExportedSourceFile>?,
637-
parentDeclNode: DeclSyntax?,
638-
expandedSourcePointer: UnsafeMutablePointer<UnsafePointer<UInt8>?>,
639-
expandedSourceLength: UnsafeMutablePointer<Int>
623+
parentDeclNode: DeclSyntax?
640624
) -> [String]? {
641625
// Get the macro.
642626
let macroPtr = macroPtr.bindMemory(to: ExportedMacro.self, capacity: 1)

0 commit comments

Comments
 (0)