llvm-6502/bindings/go/llvm/linker.go
Rafael Espindola d27b926340 Finish removing DestroySource.
Fixes pr21901.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224782 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-23 19:16:45 +00:00

33 lines
810 B
Go

//===- linker.go - Bindings for linker ------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file defines bindings for the linker component.
//
//===----------------------------------------------------------------------===//
package llvm
/*
#include "llvm-c/Linker.h"
#include <stdlib.h>
*/
import "C"
import "errors"
func LinkModules(Dest, Src Module) error {
var cmsg *C.char
failed := C.LLVMLinkModules(Dest.C, Src.C, 0, &cmsg)
if failed != 0 {
err := errors.New(C.GoString(cmsg))
C.LLVMDisposeMessage(cmsg)
return err
}
return nil
}