This is an archive of the discontinued LLVM Phabricator instance.

[llvm-c] Remove C API functions that are incompatible with opaque pointers
ClosedPublic

Authored by nikic on Oct 5 2022, 8:21 AM.

Details

Summary

These deprecated functions are incompatible with opaque pointers, and have replacements that accept an explicit type. Drop them now as a final warning to consumers of the C API to migrate their code (while LLVMGetElementType still exists as a temporary workaround).

Diff Detail

Event Timeline

nikic created this revision.Oct 5 2022, 8:21 AM
Herald added a project: Restricted Project. · View Herald Transcript
Herald added a subscriber: hiraditya. · View Herald Transcript
nikic requested review of this revision.Oct 5 2022, 8:21 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 5 2022, 8:21 AM
arsenm added a subscriber: arsenm.Oct 5 2022, 8:34 AM

Are there not any C API tests?

nikic added a comment.Oct 5 2022, 8:36 AM

Are there not any C API tests?

There are, but the tests have already been migrated to use opaque pointers.

As a side note, I've created https://discourse.llvm.org/t/rfc-remove-the-go-bindings/65725 to drop the Go bindings, which are clearly unmaintained (still no support for opaque pointers).

apologies, but can we delay this? I've migrated Google internally to use opaque pointers with clang (after fixing various miscompiles), but we still have non-clang LLVM API users that are using these. I'm in the process of migrating them off legacy APIs (or dropping them altogether) but it'll take some time

nikic planned changes to this revision.Oct 5 2022, 12:26 PM

apologies, but can we delay this? I've migrated Google internally to use opaque pointers with clang (after fixing various miscompiles), but we still have non-clang LLVM API users that are using these. I'm in the process of migrating them off legacy APIs (or dropping them altogether) but it'll take some time

Sure, no particular hurry here. Let me know when you're ready.

nikic added a subscriber: alan.Oct 27 2022, 1:57 AM
nikic added inline comments.
llvm/bindings/ocaml/llvm/llvm.ml
666

Looks like we missed this one in D135524, because it didn't have a 2 variant yet. Guess we should add the type argument here rather than drop it.

cc @alan

nikic updated this revision to Diff 471937.Oct 31 2022, 2:28 AM

Rebase. This is now down to the C API removals only, and no longer requires changes to other bindings.

aeubanks accepted this revision.Nov 23 2022, 3:29 PM

I've cleaned up our internal uses, thanks for waiting

This revision is now accepted and ready to land.Nov 23 2022, 3:29 PM