This is an archive of the discontinued LLVM Phabricator instance.

LLVM C API. Deprecated functions
AbandonedPublic

Authored by AlexDenisov on Apr 11 2016, 7:26 AM.

Details

Summary

Currently C API contains several deprecated functions,
however the deprecation mentioned only inside a comment around a function.

The patch replaces comment within attribute((deprecated("Use <alternative>"))).

Diff Detail

Repository
rL LLVM

Event Timeline

AlexDenisov retitled this revision from to LLVM C API. Deprecated functions.
AlexDenisov updated this object.
AlexDenisov changed the visibility from "Public (No Login Required)" to "All Users".
AlexDenisov set the repository for this revision to rL LLVM.

Forgot to mention initially: the macro LLVM_ATTRIBUTE_DEPRECATED was copied from llvm/Support/Compiler.h

echristo accepted this revision.Apr 11 2016, 10:03 AM
echristo added a reviewer: echristo.
echristo added a subscriber: echristo.

Works for me. Give it a few days in case people want to comment or bikeshed on naming (the file name is a bit weird, but I don't have anything better).

Thanks!

-eric

This revision is now accepted and ready to land.Apr 11 2016, 10:03 AM

(In particular adding Mehdi here)

mehdi_amini accepted this revision.Apr 11 2016, 10:35 AM
mehdi_amini added a reviewer: mehdi_amini.

I like it :)

I didn't find good name for a new file either :)
So, I will give it a few days and then commit if there are no objections.

mehdi_amini added inline comments.Apr 11 2016, 11:09 AM
include/llvm-c/Definitions.h
27

Do we have to leave this in include/llvm-c? Could it be somewhere in include/llvm? We may already have a place for such macros.
Also sometimes we keep alive some C++ APIs just for the purpose of supporting a C API, I think we should mark these as deprecated as well so we know we can remove them.

We do already have a place, but I wasn't sure whether or not we wanted a
separate implementation.

We do already have a place, but I wasn't sure whether or not we wanted a
separate implementation.

This is exactly my intention. I copied the definition from llvm/Support/Compiler.h, but besides that it contains a lot of other stuff, that might not be suitable for C API (e.g. sanitizers).
Another possible solution is to introduce another header and include it into both llvm/Support/Compiler.h and C API interface.

Also sometimes we keep alive some C++ APIs just for the purpose of supporting a C API, I think we should mark these as deprecated as well so we know we can remove them.

This is a very good idea, I will skim through the implementations and check whether we can deprecate something there.

I actually think it can just be included. It doesn't include any other
files and seems to be C only.

-eric

I actually think it can just be included. It doesn't include any other
files and seems to be C only.

-eric

Seems it has C++ comments, as well as Definitions.h I introduced.
Should Compiler.h be updated to C-style as well?

AlexDenisov edited edge metadata.Apr 15 2016, 11:19 AM
AlexDenisov changed the visibility from "All Users" to "Public (No Login Required)".
AlexDenisov abandoned this revision.May 4 2019, 10:50 AM
Herald added a project: Restricted Project. · View Herald Transcript