Local returns a pointer to a new local variable with the specified name and type.
(name string, ty Type)
| 147 | // Local returns a pointer to a new local variable with the specified name and |
| 148 | // type. |
| 149 | func (b *Builder) Local(name string, ty Type) *Value { |
| 150 | block := b.llvm.GetInsertBlock() |
| 151 | b.llvm.SetInsertPoint(b.entry, b.entry.FirstInstruction()) |
| 152 | local := b.llvm.CreateAlloca(ty.llvmTy(), "") |
| 153 | b.setInsertPointAtEnd(block) |
| 154 | return b.val(b.m.Types.Pointer(ty), local).SetName(name) |
| 155 | } |
| 156 | |
| 157 | // LocalInit returns a new local variable with the specified name and initial value. |
| 158 | func (b *Builder) LocalInit(name string, val *Value) *Value { |
no test coverage detected