[LLVMbugs] [Bug 12530] New: llvm-link dropping debug-information for local variables.

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Apr 12 01:04:55 PDT 2012


http://llvm.org/bugs/show_bug.cgi?id=12530

             Bug #: 12530
           Summary: llvm-link dropping debug-information for local
                    variables.
           Product: tools
           Version: 3.0
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: llvm-link
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: ludw1g.m3i3r at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


When using llvm-link to merge bitcode-files, the debug-information for
local-variables is lost.
Probably because calls to @llvm.dbg.declare do no longer refer to the
alloca-calls, after linking. Instead they point to a newly created, empty,
metadata-node.

In the following testcase, the call to:
@llvm.dbg.declare(metadata !{i32* %b}, metadata !12)

turns into:
@llvm.dbg.declare(metadata !21, metadata !22)
!21 = metadata !{null}


--- test.c ---
int test() {
    int a;
    return a;
}

--- test1.c ---
int test1() {
    int b;
    return b;
}

--- Makefile ---
llvm_dir=../llvm
bin_dir=../llvm_build/bin

CC=${bin_dir}/clang
CFLAGS=-O0 -nostdinc -ccc-host-triple arm-unknown-unknown -S -g -emit-llvm
-msoft-float
LLVM_LINK=${bin_dir}/llvm-link

all: test.c test1.c
    ${CC} ${CFLAGS} -o test.ll test.c
    ${CC} ${CFLAGS} -o test1.ll test1.c
    ${LLVM_LINK} -o test.link1.bc test.ll test1.ll
    ${bin_dir}/opt -S test.link1.bc

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list