MCPcopy Create free account
hub / github.com/google/gapid / Local

Method Local

core/codegen/builder.go:149–155  ·  view source on GitHub ↗

Local returns a pointer to a new local variable with the specified name and type.

(name string, ty Type)

Source from the content-addressed store, hash-verified

147// Local returns a pointer to a new local variable with the specified name and
148// type.
149func (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.
158func (b *Builder) LocalInit(name string, val *Value) *Value {

Callers 12

LocalInitMethod · 0.95
doCastMethod · 0.80
castTargetToCaptureMethod · 0.80
castCaptureToTargetMethod · 0.80
hashVariableValueMethod · 0.80
buildMapMethod · 0.80
mapIndexMethod · 0.80
select_Method · 0.80
MakeSliceMethod · 0.80
buildWriteFuncsMethod · 0.80
newBufMethod · 0.80
implementClonesMethod · 0.80

Calls 5

setInsertPointAtEndMethod · 0.95
valMethod · 0.95
SetNameMethod · 0.80
llvmTyMethod · 0.65
PointerMethod · 0.45

Tested by

no test coverage detected