[PATCH] D12623: [llgo] clear data layout before adding module to JIT

Andrew Wilkins via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 3 18:39:24 PDT 2015


axw created this revision.
axw added a reviewer: pcc.
axw added a subscriber: llvm-commits.
Herald added a subscriber: axw.

r242414 made the ExecutionEngine the owner of the data
layout, which broke llgoi (runtime assertion in
MCJIT::generateCodeForModule due to data layout mismatch).
Before adding modules to the engine, clear the data layout
so it will be set by the engine.

http://reviews.llvm.org/D12623

Files:
  cmd/llgoi/llgoi.go

Index: cmd/llgoi/llgoi.go
===================================================================
--- cmd/llgoi/llgoi.go
+++ cmd/llgoi/llgoi.go
@@ -151,6 +151,9 @@
 	}
 	pkg = module.Package
 
+	// Clear the data layout; the JIT wants to set it.
+	module.Module.SetDataLayout("")
+
 	if in.engine.C != nil {
 		in.engine.AddModule(module.Module)
 	} else {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D12623.34008.patch
Type: text/x-patch
Size: 353 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150904/0b31d0c9/attachment.bin>


More information about the llvm-commits mailing list