This is an archive of the discontinued LLVM Phabricator instance.

[mlir-c] Avoid compiler warning
ClosedPublic

Authored by jpienaar on Oct 25 2021, 8:15 PM.

Details

Summary

Setting visibility & static leads to warning about attribute being
ignored. Remove static as I believe this is desired to be exported.

Diff Detail

Event Timeline

jpienaar created this revision.Oct 25 2021, 8:15 PM
jpienaar requested review of this revision.Oct 25 2021, 8:15 PM

Shouldn't we remove the MLIR_CAPI_EXPORTED instead?

(Also, from what I read online: "In C, inline functions are treated by default as having static linkage")

I was expecting mlirTypeIDIsNull exported to be able to use it from generated library, but you are correct that inline has effect here similar to static wrt symbol exported, so inlining and not exporting SGTM

jpienaar updated this revision to Diff 382177.Oct 25 2021, 8:58 PM

Removing export instead.

jpienaar updated this revision to Diff 382179.Oct 25 2021, 8:58 PM

Fix incorrectly uploaded test case

mehdi_amini accepted this revision.Oct 25 2021, 9:00 PM

I was expecting mlirTypeIDIsNull exported to be able to use it from generated library

You can use it from anywhere, it will just be with the user and not really part of the library ABI.
(so it only limits your ability to dlopen/dlsym find it)

This revision is now accepted and ready to land.Oct 25 2021, 9:00 PM
This revision was automatically updated to reflect the committed changes.