diff options
author | Andrew Wilkins <axwalk@gmail.com> | 2016-03-23 23:09:00 +0000 |
---|---|---|
committer | Andrew Wilkins <axwalk@gmail.com> | 2016-03-23 23:09:00 +0000 |
commit | 2f56871c3f37548c0b0c1ee35e2e626a5f06e04f (patch) | |
tree | bb2a42a88d8d5b9f5098b4b28421980cf673a656 /llgo | |
parent | 406bdb65eafc66c7e9863132934da1cd0865dc59 (diff) |
[llgo] Increment "Debug Info Version"
Patch by Michal Cierniak!
This patch increments the "Debug Info Version" from 2 to 3.
This is a nop if you just want to generate binaries. I verified
that with and without this patch, when I run llgo -g on a Go
source file, I get exactly the same binary. The purpose of the
patch is to make it possible to run the llvm-dis tool. Without
the patch, it is impossible to disassemble files generated with
llgo:
$ llgo -c -g -emit-llvm src/hello.go
$ llvm-dis hello.o
llvm-dis: warning: ignoring debug info with an invalid version (2) in hello.o
Differential Revision: http://reviews.llvm.org/D18355
Diffstat (limited to 'llgo')
-rw-r--r-- | llgo/debug/debug.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llgo/debug/debug.go b/llgo/debug/debug.go index 2e641692ad0..cf5f40be7f0 100644 --- a/llgo/debug/debug.go +++ b/llgo/debug/debug.go @@ -183,7 +183,7 @@ func (d *DIBuilder) Finalize() { llvm.GlobalContext().MDNode([]llvm.Metadata{ llvm.ConstInt(llvm.Int32Type(), 1, false).ConstantAsMetadata(), // Error on mismatch llvm.GlobalContext().MDString("Debug Info Version"), - llvm.ConstInt(llvm.Int32Type(), 2, false).ConstantAsMetadata(), + llvm.ConstInt(llvm.Int32Type(), 3, false).ConstantAsMetadata(), }), ) d.builder.Finalize() |