mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 20:32:21 +00:00
0a5c3015f8
Add the enum "LLVMLinkerMode" back for backwards-compatibility and add the linker mode parameter back to the "LLVMLinkModules" function. The paramter is ignored and has no effect. Patch provided by: Filip Pizlo Reviewed by: Rafael and Sean git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230988 91177308-0d34-0410-b5e6-96231b3b80d8
33 lines
834 B
Go
33 lines
834 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, C.LLVMLinkerDestroySource, &cmsg)
|
|
if failed != 0 {
|
|
err := errors.New(C.GoString(cmsg))
|
|
C.LLVMDisposeMessage(cmsg)
|
|
return err
|
|
}
|
|
return nil
|
|
}
|