[PATCH] irgen: don't emit debug metadata for locals
Andrew Wilkins
axwalk at gmail.com
Tue Jan 27 23:43:47 PST 2015
Hi pcc,
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.)
http://reviews.llvm.org/D7222
Files:
CMakeLists.txt
irgen/ssa.go
Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -30,6 +30,7 @@
irgen/slice.go
irgen/ssa.go
irgen/strings.go
+ irgen/switches.go
irgen/targets.go
irgen/typemap.go
irgen/types.go
Index: irgen/ssa.go
===================================================================
--- irgen/ssa.go
+++ irgen/ssa.go
@@ -357,12 +357,7 @@
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 @@
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
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D7222.18878.patch
Type: text/x-patch
Size: 1385 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150128/30d93c0c/attachment.bin>
More information about the llvm-commits
mailing list