mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-11-02 07:11:49 +00:00
d27b926340
Fixes pr21901. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224782 91177308-0d34-0410-b5e6-96231b3b80d8
33 lines
810 B
Go
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
|
|
}
|