File tree 1 file changed +14
-0
lines changed 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -1480,6 +1480,20 @@ public class IRBuilder {
1480
1480
return Global ( llvm: llvm)
1481
1481
}
1482
1482
1483
+ /// Build a named global of the given type.
1484
+ ///
1485
+ /// - parameter name: The name of the newly inserted global value.
1486
+ /// - parameter initializer: The initial value for the global variable.
1487
+ /// - parameter addressSpace: The optional address space where the global
1488
+ /// variable resides.
1489
+ ///
1490
+ /// - returns: A value representing the newly inserted global variable.
1491
+ public func addGlobal( _ name: String , initializer: IRValue , addressSpace: Int ? = nil ) -> Global {
1492
+ var global = addGlobal ( name, type: initializer. type)
1493
+ global. initializer = initializer
1494
+ return global
1495
+ }
1496
+
1483
1497
/// Build a named global string consisting of an array of `i8` type filled in
1484
1498
/// with the nul terminated string value.
1485
1499
///
You can’t perform that action at this time.
0 commit comments