[PATCH] D18355: [llgo] Increment "Debug Info Version"

Michal Cierniak via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 22 09:40:35 PDT 2016

cierniak created this revision.
cierniak added reviewers: pcc, axw.
cierniak added a subscriber: llvm-commits.

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



Index: debug/debug.go
--- debug/debug.go
+++ debug/debug.go
@@ -183,7 +183,7 @@
 			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(),

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D18355.51293.patch
Type: text/x-patch
Size: 512 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160322/484a013e/attachment.bin>

More information about the llvm-commits mailing list