1//===- linker.go - Bindings for linker ------------------------------------===// 2// 3// The LLVM Compiler Infrastructure 4// 5// This file is distributed under the University of Illinois Open Source 6// License. See LICENSE.TXT for details. 7// 8//===----------------------------------------------------------------------===// 9// 10// This file defines bindings for the linker component. 11// 12//===----------------------------------------------------------------------===// 13 14package llvm 15 16/* 17#include "llvm-c/Core.h" 18#include "llvm-c/Linker.h" 19#include <stdlib.h> 20*/ 21import "C" 22import "errors" 23 24func LinkModules(Dest, Src Module) error { 25 failed := C.LLVMLinkModules2(Dest.C, Src.C) 26 if failed != 0 { 27 err := errors.New("Linking failed") 28 return err 29 } 30 return nil 31} 32