aboutsummaryrefslogtreecommitdiffhomepage
path: root/interp/interp.go
diff options
context:
space:
mode:
authorAyke van Laethem <[email protected]>2019-05-13 20:39:12 +0200
committerRon Evans <[email protected]>2019-05-14 11:18:38 +0200
commit371c468e8efcc6c415c4e955e69fc6072698f578 (patch)
tree3604981f91ec4949c45114cf6f9157f1aa40de6d /interp/interp.go
parent0a4021968022fb6e55e06b01665df590760356e1 (diff)
downloadtinygo-371c468e8efcc6c415c4e955e69fc6072698f578.tar.gz
tinygo-371c468e8efcc6c415c4e955e69fc6072698f578.zip
compiler: add debug info for function arguments
This commit adds debug info to function arguments, so that in many cases you can see them when compiling with less optimizations enabled. Unfortunately, due to the way Go SSA works, it is hard to preserve them in many cases. Local variables are not yet saved. Also, change the language type to C, to make sure lldb shows function arguments. The previous language was Modula 3, apparently due to a off-by-one error somewhere.
Diffstat (limited to 'interp/interp.go')
-rw-r--r--interp/interp.go3
1 files changed, 0 insertions, 3 deletions
diff --git a/interp/interp.go b/interp/interp.go
index ea59334ea..14cd6e782 100644
--- a/interp/interp.go
+++ b/interp/interp.go
@@ -18,7 +18,6 @@ type Eval struct {
TargetData llvm.TargetData
Debug bool
builder llvm.Builder
- dibuilder *llvm.DIBuilder
dirtyGlobals map[llvm.Value]struct{}
sideEffectFuncs map[llvm.Value]*sideEffectResult // cache of side effect scan results
}
@@ -38,7 +37,6 @@ func Run(mod llvm.Module, targetData llvm.TargetData, debug bool) error {
dirtyGlobals: map[llvm.Value]struct{}{},
}
e.builder = mod.Context().NewBuilder()
- e.dibuilder = llvm.NewDIBuilder(mod)
initAll := mod.NamedFunction(name)
bb := initAll.EntryBasicBlock()
@@ -49,7 +47,6 @@ func Run(mod llvm.Module, targetData llvm.TargetData, debug bool) error {
e.builder.SetInsertPointBefore(bb.FirstInstruction())
dummy := e.builder.CreateAlloca(e.Mod.Context().Int8Type(), "dummy")
e.builder.SetInsertPointBefore(dummy)
- e.builder.SetInstDebugLocation(bb.FirstInstruction())
var initCalls []llvm.Value
for inst := bb.FirstInstruction(); !inst.IsNil(); inst = llvm.NextInstruction(inst) {
if inst == dummy {