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 @@ -1480,6 +1480,20 @@ public class IRBuilder {
14801480 return Global ( llvm: llvm)
14811481 }
14821482
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+
14831497 /// Build a named global string consisting of an array of `i8` type filled in
14841498 /// with the nul terminated string value.
14851499 ///
You can’t perform that action at this time.
0 commit comments