<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div><div></div><div><br class=""></div><div>-Filip</div><div><br class=""></div><br class=""><blockquote type="cite" class=""><div class=""><div class="gmail_extra"><br class=""><div class="gmail_quote">On Tue, Feb 24, 2015 at 4:09 PM, Sean Silva <span dir="ltr" class=""><<a href="mailto:chisophugis@gmail.com" target="_blank" class="">chisophugis@gmail.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="">Bindings are supposed to be pretty stable too I think. I think your patch is fine for the C stuff. CC'ing llgo guys. I think the ocaml maintainer already chimed in to PR21901 so I assume he is ok with this.<div class=""><br class=""></div><div class="">-- Sean Silva</div></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Tue, Feb 24, 2015 at 3:46 PM, Filip Pizlo <span dir="ltr" class=""><<a href="mailto:fpizlo@apple.com" target="_blank" class="">fpizlo@apple.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Proposed fix:<br class="">
<br class="">
<br class=""><br class="">
<br class="">
OK to commit?<br class="">
<br class="">
-Filip<div class=""><div class="h5"><br class="">
<br class="">
<br class="">
> On Feb 24, 2015, at 3:39 PM, Filip Pizlo <<a href="mailto:fpizlo@apple.com" target="_blank" class="">fpizlo@apple.com</a>> wrote:<br class="">
><br class="">
> This change breaks the WebKit build.<br class="">
><br class="">
> The removal of the LLVMLinkerMode type from the C API violates the principle of C API stability. The latest release of LLVM has this type, which makes it subject to the usual API stability rules.<br class="">
><br class="">
> What do you recommend we do? Maybe just bringing back the enum is sufficient.<br class="">
><br class="">
> -Filip<br class="">
><br class="">
><br class="">
>> On Dec 23, 2014, at 11:16 AM, Rafael Espindola <<a href="mailto:rafael.espindola@gmail.com" target="_blank" class="">rafael.espindola@gmail.com</a>> wrote:<br class="">
>><br class="">
>> Author: rafael<br class="">
>> Date: Tue Dec 23 13:16:45 2014<br class="">
>> New Revision: 224782<br class="">
>><br class="">
>> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=224782&view=rev" target="_blank" class="">http://llvm.org/viewvc/llvm-project?rev=224782&view=rev</a><br class="">
>> Log:<br class="">
>> Finish removing DestroySource.<br class="">
>><br class="">
>> Fixes pr21901.<br class="">
>><br class="">
>> Modified:<br class="">
>> llvm/trunk/bindings/go/llvm/linker.go<br class="">
>> llvm/trunk/bindings/ocaml/linker/linker_ocaml.c<br class="">
>> llvm/trunk/bindings/ocaml/linker/<a href="http://llvm_linker.ml/" target="_blank" class="">llvm_linker.ml</a><br class="">
>> llvm/trunk/bindings/ocaml/linker/llvm_linker.mli<br class="">
>> llvm/trunk/include/llvm-c/Linker.h<br class="">
>> llvm/trunk/lib/Linker/LinkModules.cpp<br class="">
>> llvm/trunk/test/Bindings/OCaml/<a href="http://linker.ml/" target="_blank" class="">linker.ml</a><br class="">
>><br class="">
>> Modified: llvm/trunk/bindings/go/llvm/linker.go<br class="">
>> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/bindings/go/llvm/linker.go?rev=224782&r1=224781&r2=224782&view=diff" target="_blank" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/bindings/go/llvm/linker.go?rev=224782&r1=224781&r2=224782&view=diff</a><br class="">
>> ==============================================================================<br class="">
>> --- llvm/trunk/bindings/go/llvm/linker.go (original)<br class="">
>> +++ llvm/trunk/bindings/go/llvm/linker.go Tue Dec 23 13:16:45 2014<br class="">
>> @@ -20,16 +20,9 @@ package llvm<br class="">
>> import "C"<br class="">
>> import "errors"<br class="">
>><br class="">
>> -type LinkerMode C.LLVMLinkerMode<br class="">
>> -<br class="">
>> -const (<br class="">
>> - LinkerDestroySource = C.LLVMLinkerDestroySource<br class="">
>> - LinkerPreserveSource = C.LLVMLinkerPreserveSource<br class="">
>> -)<br class="">
>> -<br class="">
>> -func LinkModules(Dest, Src Module, Mode LinkerMode) error {<br class="">
>> +func LinkModules(Dest, Src Module) error {<br class="">
>> var cmsg *C.char<br class="">
>> - failed := C.LLVMLinkModules(Dest.C, Src.C, C.LLVMLinkerMode(Mode), &cmsg)<br class="">
>> + failed := C.LLVMLinkModules(Dest.C, Src.C, 0, &cmsg)<br class="">
>> if failed != 0 {<br class="">
>> err := errors.New(C.GoString(cmsg))<br class="">
>> C.LLVMDisposeMessage(cmsg)<br class="">
>><br class="">
>> Modified: llvm/trunk/bindings/ocaml/linker/linker_ocaml.c<br class="">
>> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/bindings/ocaml/linker/linker_ocaml.c?rev=224782&r1=224781&r2=224782&view=diff" target="_blank" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/bindings/ocaml/linker/linker_ocaml.c?rev=224782&r1=224781&r2=224782&view=diff</a><br class="">
>> ==============================================================================<br class="">
>> --- llvm/trunk/bindings/ocaml/linker/linker_ocaml.c (original)<br class="">
>> +++ llvm/trunk/bindings/ocaml/linker/linker_ocaml.c Tue Dec 23 13:16:45 2014<br class="">
>> @@ -23,11 +23,11 @@<br class="">
>><br class="">
>> void llvm_raise(value Prototype, char *Message);<br class="">
>><br class="">
>> -/* llmodule -> llmodule -> Mode.t -> unit */<br class="">
>> -CAMLprim value llvm_link_modules(LLVMModuleRef Dst, LLVMModuleRef Src, value Mode) {<br class="">
>> +/* llmodule -> llmodule -> unit */<br class="">
>> +CAMLprim value llvm_link_modules(LLVMModuleRef Dst, LLVMModuleRef Src) {<br class="">
>> char* Message;<br class="">
>><br class="">
>> - if (LLVMLinkModules(Dst, Src, Int_val(Mode), &Message))<br class="">
>> + if (LLVMLinkModules(Dst, Src, 0, &Message))<br class="">
>> llvm_raise(*caml_named_value("Llvm_linker.Error"), Message);<br class="">
>><br class="">
>> return Val_unit;<br class="">
>><br class="">
>> Modified: llvm/trunk/bindings/ocaml/linker/<a href="http://llvm_linker.ml/" target="_blank" class="">llvm_linker.ml</a><br class="">
>> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/bindings/ocaml/linker/llvm_linker.ml?rev=224782&r1=224781&r2=224782&view=diff" target="_blank" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/bindings/ocaml/linker/llvm_linker.ml?rev=224782&r1=224781&r2=224782&view=diff</a><br class="">
>> ==============================================================================<br class="">
>> --- llvm/trunk/bindings/ocaml/linker/<a href="http://llvm_linker.ml/" target="_blank" class="">llvm_linker.ml</a> (original)<br class="">
>> +++ llvm/trunk/bindings/ocaml/linker/<a href="http://llvm_linker.ml/" target="_blank" class="">llvm_linker.ml</a> Tue Dec 23 13:16:45 2014<br class="">
>> @@ -11,11 +11,5 @@ exception Error of string<br class="">
>><br class="">
>> let () = Callback.register_exception "Llvm_linker.Error" (Error "")<br class="">
>><br class="">
>> -module Mode = struct<br class="">
>> - type t =<br class="">
>> - | DestroySource<br class="">
>> - | PreserveSource<br class="">
>> -end<br class="">
>> -<br class="">
>> -external link_modules : Llvm.llmodule -> Llvm.llmodule -> Mode.t -> unit<br class="">
>> +external link_modules : Llvm.llmodule -> Llvm.llmodule -> unit<br class="">
>> = "llvm_link_modules"<br class="">
>><br class="">
>> Modified: llvm/trunk/bindings/ocaml/linker/llvm_linker.mli<br class="">
>> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/bindings/ocaml/linker/llvm_linker.mli?rev=224782&r1=224781&r2=224782&view=diff" target="_blank" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/bindings/ocaml/linker/llvm_linker.mli?rev=224782&r1=224781&r2=224782&view=diff</a><br class="">
>> ==============================================================================<br class="">
>> --- llvm/trunk/bindings/ocaml/linker/llvm_linker.mli (original)<br class="">
>> +++ llvm/trunk/bindings/ocaml/linker/llvm_linker.mli Tue Dec 23 13:16:45 2014<br class="">
>> @@ -14,13 +14,6 @@<br class="">
>><br class="">
>> exception Error of string<br class="">
>><br class="">
>> -(** Linking mode. *)<br class="">
>> -module Mode : sig<br class="">
>> - type t =<br class="">
>> - | DestroySource<br class="">
>> - | PreserveSource<br class="">
>> -end<br class="">
>> -<br class="">
>> (** [link_modules dst src mode] links [src] into [dst], raising [Error]<br class="">
>> if the linking fails. *)<br class="">
>> -val link_modules : Llvm.llmodule -> Llvm.llmodule -> Mode.t -> unit<br class="">
>> \ No newline at end of file<br class="">
>> +val link_modules : Llvm.llmodule -> Llvm.llmodule -> unit<br class="">
>> \ No newline at end of file<br class="">
>><br class="">
>> Modified: llvm/trunk/include/llvm-c/Linker.h<br class="">
>> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm-c/Linker.h?rev=224782&r1=224781&r2=224782&view=diff" target="_blank" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm-c/Linker.h?rev=224782&r1=224781&r2=224782&view=diff</a><br class="">
>> ==============================================================================<br class="">
>> --- llvm/trunk/include/llvm-c/Linker.h (original)<br class="">
>> +++ llvm/trunk/include/llvm-c/Linker.h Tue Dec 23 13:16:45 2014<br class="">
>> @@ -20,20 +20,13 @@<br class="">
>> extern "C" {<br class="">
>> #endif<br class="">
>><br class="">
>> -<br class="">
>> -typedef enum {<br class="">
>> - LLVMLinkerDestroySource = 0, /* Allow source module to be destroyed. */<br class="">
>> - LLVMLinkerPreserveSource = 1 /* Preserve the source module. */<br class="">
>> -} LLVMLinkerMode;<br class="">
>> -<br class="">
>> -<br class="">
>> /* Links the source module into the destination module, taking ownership<br class="">
>> * of the source module away from the caller. Optionally returns a<br class="">
>> * human-readable description of any errors that occurred in linking.<br class="">
>> * OutMessage must be disposed with LLVMDisposeMessage. The return value<br class="">
>> * is true if an error occurred, false otherwise. */<br class="">
>> LLVMBool LLVMLinkModules(LLVMModuleRef Dest, LLVMModuleRef Src,<br class="">
>> - LLVMLinkerMode Mode, char **OutMessage);<br class="">
>> + unsigned Unused, char **OutMessage);<br class="">
>><br class="">
>> #ifdef __cplusplus<br class="">
>> }<br class="">
>><br class="">
>> Modified: llvm/trunk/lib/Linker/LinkModules.cpp<br class="">
>> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Linker/LinkModules.cpp?rev=224782&r1=224781&r2=224782&view=diff" target="_blank" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Linker/LinkModules.cpp?rev=224782&r1=224781&r2=224782&view=diff</a><br class="">
>> ==============================================================================<br class="">
>> --- llvm/trunk/lib/Linker/LinkModules.cpp (original)<br class="">
>> +++ llvm/trunk/lib/Linker/LinkModules.cpp Tue Dec 23 13:16:45 2014<br class="">
>> @@ -1739,7 +1739,7 @@ bool Linker::LinkModules(Module *Dest, M<br class="">
>> //===----------------------------------------------------------------------===//<br class="">
>><br class="">
>> LLVMBool LLVMLinkModules(LLVMModuleRef Dest, LLVMModuleRef Src,<br class="">
>> - LLVMLinkerMode Mode, char **OutMessages) {<br class="">
>> + unsigned Unused, char **OutMessages) {<br class="">
>> Module *D = unwrap(Dest);<br class="">
>> std::string Message;<br class="">
>> raw_string_ostream Stream(Message);<br class="">
>><br class="">
>> Modified: llvm/trunk/test/Bindings/OCaml/<a href="http://linker.ml/" target="_blank" class="">linker.ml</a><br class="">
>> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Bindings/OCaml/linker.ml?rev=224782&r1=224781&r2=224782&view=diff" target="_blank" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Bindings/OCaml/linker.ml?rev=224782&r1=224781&r2=224782&view=diff</a><br class="">
>> ==============================================================================<br class="">
>> --- llvm/trunk/test/Bindings/OCaml/<a href="http://linker.ml/" target="_blank" class="">linker.ml</a> (original)<br class="">
>> +++ llvm/trunk/test/Bindings/OCaml/<a href="http://linker.ml/" target="_blank" class="">linker.ml</a> Tue Dec 23 13:16:45 2014<br class="">
>> @@ -45,7 +45,7 @@ let test_linker () =<br class="">
>><br class="">
>> let m1 = make_module "one"<br class="">
>> and m2 = make_module "two" in<br class="">
>> - link_modules m1 m2 Mode.DestroySource;<br class="">
>> + link_modules m1 m2;<br class="">
>> dispose_module m1;<br class="">
>><br class="">
>> let m1 = make_module "one"<br class="">
>><br class="">
>><br class="">
>> _______________________________________________<br class="">
>> llvm-commits mailing list<br class="">
>> <a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank" class="">llvm-commits@cs.uiuc.edu</a><br class="">
>> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank" class="">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br class="">
><br class="">
><br class="">
> _______________________________________________<br class="">
> llvm-commits mailing list<br class="">
> <a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank" class="">llvm-commits@cs.uiuc.edu</a><br class="">
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank" class="">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br class="">
<br class="">
<br class="">_______________________________________________<br class="">
llvm-commits mailing list<br class="">
<a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank" class="">llvm-commits@cs.uiuc.edu</a><br class="">
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank" class="">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br class="">
<br class=""></div></div></blockquote></div><br class=""></div>
<br class="">_______________________________________________<br class="">
llvm-commits mailing list<br class="">
<a href="mailto:llvm-commits@cs.uiuc.edu" class="">llvm-commits@cs.uiuc.edu</a><br class="">
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank" class="">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br class="">
<br class=""></blockquote></div><br class=""></div>
</div></blockquote></div><br class=""></body></html>