File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -910,6 +910,20 @@ public class IRBuilder {
910
910
return LLVMBuildUnreachable ( llvm)
911
911
}
912
912
913
+ /// Build a return from the current function back to the calling function with
914
+ /// the given array of values in aggregate.
915
+ ///
916
+ /// - parameter values: The values to insert as members of the returned aggregate.
917
+ ///
918
+ /// - returns: A value representing `void`.
919
+ @discardableResult
920
+ public func buildRetAggregate( of values: [ IRValue ] ) -> IRValue {
921
+ var values = values. map { $0. asLLVM ( ) as Optional }
922
+ return values. withUnsafeMutableBufferPointer { buf in
923
+ return LLVMBuildAggregateRet ( llvm, buf. baseAddress!, UInt32 ( buf. count) )
924
+ }
925
+ }
926
+
913
927
/// Build a call to the given function with the given arguments to transfer
914
928
/// control to that function.
915
929
///
You can’t perform that action at this time.
0 commit comments