From 72b5e5f5b47a44294e2acb93c78de766b63265c2 Mon Sep 17 00:00:00 2001 From: Andrew Wilkins Date: Thu, 29 Jan 2015 00:34:30 +0000 Subject: [PATCH] irgen: don't emit debug metadata for locals Summary: The debug metadata we generate is wrong, and is now causing build failures. This revision disables the only llvm.dbg.declare calls we make. (There is also a drive-by fix to CMakeLists.txt, adding in a missing .go dependency.) Fixes http://llvm.org/bugs/show_bug.cgi?id=22330 Reviewers: pcc Reviewed By: pcc Subscribers: dblaikie, llvm-commits Differential Revision: http://reviews.llvm.org/D7222 llvm-svn: 227403 --- llgo/CMakeLists.txt | 1 + llgo/irgen/ssa.go | 12 ------------ 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/llgo/CMakeLists.txt b/llgo/CMakeLists.txt index 9a93a4ba2efa..e9b6bc55c8cb 100644 --- a/llgo/CMakeLists.txt +++ b/llgo/CMakeLists.txt @@ -30,6 +30,7 @@ llvm_add_go_executable(llgo llvm.org/llgo/cmd/gllgo ALL DEPENDS irgen/slice.go irgen/ssa.go irgen/strings.go + irgen/switches.go irgen/targets.go irgen/typemap.go irgen/types.go diff --git a/llgo/irgen/ssa.go b/llgo/irgen/ssa.go index e2be8747da91..90e0a444ba63 100644 --- a/llgo/irgen/ssa.go +++ b/llgo/irgen/ssa.go @@ -357,12 +357,7 @@ func (u *unit) defineFunction(f *ssa.Function) { prologueBlock := llvm.InsertBasicBlock(fr.blocks[0], "prologue") fr.builder.SetInsertPointAtEnd(prologueBlock) - // Map parameter positions to indices. We use this - // when processing locals to map back to parameters - // when generating debug metadata. - paramPos := make(map[token.Pos]int) for i, param := range f.Params { - paramPos[param.Pos()] = i llparam := fti.argInfos[i].decode(llvm.GlobalContext(), fr.builder, fr.builder) if isMethod && i == 0 { if _, ok := param.Type().Underlying().(*types.Pointer); !ok { @@ -401,13 +396,6 @@ func (u *unit) defineFunction(f *ssa.Function) { bcalloca := fr.builder.CreateBitCast(alloca, llvm.PointerType(llvm.Int8Type(), 0), "") value := newValue(bcalloca, local.Type()) fr.env[local] = value - if fr.GenerateDebug { - paramIndex, ok := paramPos[local.Pos()] - if !ok { - paramIndex = -1 - } - fr.debug.Declare(fr.builder, local, alloca, paramIndex) - } } // If the function contains any defers, we must first create