MCPcopy Index your code
hub / github.com/tinygo-org/tinygo / readStackPointer

Method readStackPointer

compiler/llvm.go:442–453  ·  view source on GitHub ↗

readStackPointer emits a LLVM intrinsic call that returns the current stack pointer as an *i8.

()

Source from the content-addressed store, hash-verified

440// readStackPointer emits a LLVM intrinsic call that returns the current stack
441// pointer as an *i8.
442func (b *builder) readStackPointer() llvm.Value {
443 name := "llvm.stacksave.p0"
444 if llvmutil.Version() < 18 {
445 name = "llvm.stacksave" // backwards compatibility with LLVM 17 and below
446 }
447 stacksave := b.mod.NamedFunction(name)
448 if stacksave.IsNil() {
449 fnType := llvm.FunctionType(b.dataPtrType, nil, false)
450 stacksave = llvm.AddFunction(b.mod, name, fnType)
451 }
452 return b.CreateCall(stacksave.GlobalValueType(), stacksave, nil, "")
453}
454
455// writeStackPointer emits a LLVM intrinsic call that updates the current stack
456// pointer.

Callers 5

deferInitFuncMethod · 0.95
createStackSaveImplMethod · 0.95
createSyscallMethod · 0.95
createSyscallnMethod · 0.95

Calls 2

VersionFunction · 0.92
IsNilMethod · 0.80

Tested by

no test coverage detected