[llvm] r230988 - Restore LLVMLinkModules C API until it is properly deprecated.
Juergen Ributzka
juergen at apple.com
Mon Mar 2 10:59:38 PST 2015
Author: ributzka
Date: Mon Mar 2 12:59:38 2015
New Revision: 230988
URL: http://llvm.org/viewvc/llvm-project?rev=230988&view=rev
Log:
Restore LLVMLinkModules C API until it is properly deprecated.
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
Modified:
llvm/trunk/bindings/go/llvm/linker.go
llvm/trunk/include/llvm-c/Linker.h
llvm/trunk/lib/Linker/LinkModules.cpp
Modified: llvm/trunk/bindings/go/llvm/linker.go
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/bindings/go/llvm/linker.go?rev=230988&r1=230987&r2=230988&view=diff
==============================================================================
--- llvm/trunk/bindings/go/llvm/linker.go (original)
+++ llvm/trunk/bindings/go/llvm/linker.go Mon Mar 2 12:59:38 2015
@@ -22,7 +22,7 @@ import "errors"
func LinkModules(Dest, Src Module) error {
var cmsg *C.char
- failed := C.LLVMLinkModules(Dest.C, Src.C, 0, &cmsg)
+ failed := C.LLVMLinkModules(Dest.C, Src.C, C.LLVMLinkerDestroySource, &cmsg)
if failed != 0 {
err := errors.New(C.GoString(cmsg))
C.LLVMDisposeMessage(cmsg)
Modified: llvm/trunk/include/llvm-c/Linker.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm-c/Linker.h?rev=230988&r1=230987&r2=230988&view=diff
==============================================================================
--- llvm/trunk/include/llvm-c/Linker.h (original)
+++ llvm/trunk/include/llvm-c/Linker.h Mon Mar 2 12:59:38 2015
@@ -20,13 +20,23 @@
extern "C" {
#endif
+/* This enum is provided for backwards-compatibility only. It has no effect. */
+typedef enum {
+ LLVMLinkerDestroySource = 0, /* This is the default behavior. */
+ LLVMLinkerPreserveSource_Removed = 1 /* This option has been deprecated and
+ should not be used. */
+} LLVMLinkerMode;
+
/* Links the source module into the destination module, taking ownership
* of the source module away from the caller. Optionally returns a
* human-readable description of any errors that occurred in linking.
* OutMessage must be disposed with LLVMDisposeMessage. The return value
- * is true if an error occurred, false otherwise. */
+ * is true if an error occurred, false otherwise.
+ *
+ * Note that the linker mode parameter \p Unused is no longer used, and has
+ * no effect. */
LLVMBool LLVMLinkModules(LLVMModuleRef Dest, LLVMModuleRef Src,
- unsigned Unused, char **OutMessage);
+ LLVMLinkerMode Unused, char **OutMessage);
#ifdef __cplusplus
}
Modified: llvm/trunk/lib/Linker/LinkModules.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Linker/LinkModules.cpp?rev=230988&r1=230987&r2=230988&view=diff
==============================================================================
--- llvm/trunk/lib/Linker/LinkModules.cpp (original)
+++ llvm/trunk/lib/Linker/LinkModules.cpp Mon Mar 2 12:59:38 2015
@@ -1777,7 +1777,7 @@ bool Linker::LinkModules(Module *Dest, M
//===----------------------------------------------------------------------===//
LLVMBool LLVMLinkModules(LLVMModuleRef Dest, LLVMModuleRef Src,
- unsigned Unused, char **OutMessages) {
+ LLVMLinkerMode Unused, char **OutMessages) {
Module *D = unwrap(Dest);
std::string Message;
raw_string_ostream Stream(Message);
More information about the llvm-commits
mailing list