Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mandatory "distinct" for DISubprogram and DICompileUnit #47

Open
langston-barrett opened this issue Dec 4, 2018 · 0 comments
Open

Mandatory "distinct" for DISubprogram and DICompileUnit #47

langston-barrett opened this issue Dec 4, 2018 · 0 comments

Comments

@langston-barrett
Copy link
Collaborator

When attempting to re-assemble this file with llvm-as from LLVM 6 after disassembling it with llvm-pretty/llvm-pretty-bc-parser, I get the following complaint:

$ nix-shell --pure -p llvm_6 --run "llvm-as /run/user/1000/cfi-eof-prologue.newllvm-disasm24413-2.ll"                                                        
llvm-as: /run/user/1000/cfi-eof-prologue.newllvm-disasm24413-2.ll:158:40: error: missing 'distinct', required for !DICompileUnit                             
                       templateParams: !DICompileUnit(language: 4, file: !3,
                                       ^

Unfortunately, my first attempt to fix this (putting "distinct" in the indicated location) failed:

$ nix-shell --pure -p llvm_6 --run "llvm-as /run/user/1000/cfi-eof-prologue.newllvm-disasm24413-2.ll"                                                        
llvm-as: /run/user/1000/cfi-eof-prologue.newllvm-disasm24413-2.ll:158:40: error: expected metadata operand                                                   
                       templateParams: distinct !DICompileUnit(language: 4, file: !3,  

Notice that in the relevant LLVM commit, they never have a DICompileUnit inline. My hypothesis is that this is a bug in their parser (they assume they never see DICompileUnit inline). However, we might just want to always output those on their own line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

No branches or pull requests

2 participants