This is an archive of the discontinued LLVM Phabricator instance.

Change linkInModule to take a std::unique_ptr
ClosedPublic

Authored by rafael on Dec 15 2015, 7:57 AM.

Details

Summary

Eric, please check that we are doing the right thing with regards to the C API.

Diff Detail

Event Timeline

rafael updated this revision to Diff 42859.Dec 15 2015, 7:57 AM
rafael retitled this revision from to Change linkInModule to take a std::unique_ptr.
rafael updated this object.
rafael added a subscriber: llvm-commits.
whitequark added inline comments.Dec 15 2015, 8:07 AM
test/Bindings/OCaml/linker.ml
58

This is really terrible; this is a silent change that alters correctness of existing OCaml code, leading to double free, which will not be detected if you don't run a Debug build of LLVM (and even then I'm not sure).

Could you please rename link_modules function to link_modules' (note the apostrophe) and add a bit to documentation in the mli like you did in the C API? It is probably not necessary to keep the old one for compatibility.

This should be a straightforward search-and-replace job, but ping me if it causes issues.

rafael updated this revision to Diff 42909.Dec 15 2015, 2:09 PM
rafael edited edge metadata.

Rename the ocaml function

echristo edited edge metadata.Dec 15 2015, 5:04 PM

Couple of inline comments.

include/llvm-c/Linker.h
39

Typo.

44

For now please document the changes between the two functions. It would probably be best if you do so in the release notes as well.

whitequark edited edge metadata.Dec 15 2015, 8:15 PM

LGTM after changes described above.

bindings/ocaml/linker/llvm_linker.mli
17–19

There's no mode argument anymore--the signature should read [link_modules' dst src].

docs/ReleaseNotes.rst
92

Can you please add a notice similar to the one about the C API above about the link_modules' function?

rafael updated this revision to Diff 43009.Dec 16 2015, 7:48 AM
rafael edited edge metadata.

Couple more inline comments, but the C API stuff as far as policy is ok now.

Thanks!

-eric

include/llvm-c/Linker.h
44

Typo.

Best to just describe the function completely with a note of what it also doesn't do so that the end of deprecation removal is easier for LLVMLinkModules?

include/llvm/Linker/Linker.h
51

"deprecated" and go ahead and specify which one so that a grep will find this.

r255842. Thanks!

mehdi_amini accepted this revision.Jan 4 2016, 4:45 PM
mehdi_amini added a reviewer: mehdi_amini.

seems like it was committed, accept and close.

This revision is now accepted and ready to land.Jan 4 2016, 4:45 PM
mehdi_amini closed this revision.Jan 4 2016, 4:45 PM