Skip to content

Metadata gets corrupted after linking .bc files #11259

@llvmbot

Description

@llvmbot
Bugzilla Link 10887
Resolution FIXED
Resolved on Mar 18, 2013 23:32
Version trunk
OS Windows XP
Attachments Files to reproduce
Reporter LLVM Bugzilla Contributor
CC @echristo,@efriedma-quic,@sunfishcode

Extended Description

Windows XP, MSVC 2008
LLVM SVN revision: 138553
clang SVN revision: 138538

I have as input 2 .ll files (It doesn't matter if they're generated by clang or my own frontend) After linking them together (either with llvm-link or llvm::Linker::LinkInFiles), only the first file retains correct llvm.dbg.declare/metadata. The second file just references null metadata.

Correct:
call void @​llvm.dbg.declare(metadata !{i8** %arg0.addr}, metadata !​19), !dbg !​22

Incorrect:
call void @​llvm.dbg.declare(metadata !​18, metadata !​29), !dbg !​30
!​18 = metadata !{null}

Attached are 2 repro-cases:
"1.cmd" contains the steps necessary to reproduce behavior with sample files from my own front-end. Final output file: output1.ll
"2.cmd" contains sample files for clang. Final output file: output2.ll

E.g. in output2.ll you can see correct debug info in lines 10 and 11, and corrupt in lines 23 and 24.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzilla

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions