This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Annotate functions used only in debug mode with LLVM_ATTRIBUTE_UNUSED
ClosedPublic

Authored by ezhulenev on Mar 11 2021, 8:35 PM.

Details

Summary

Functions used only in assert cause warnings in release mode

Diff Detail

Event Timeline

ezhulenev created this revision.Mar 11 2021, 8:35 PM
ezhulenev requested review of this revision.Mar 11 2021, 8:35 PM
ezhulenev edited the summary of this revision. (Show Details)Mar 11 2021, 8:37 PM
ezhulenev added a reviewer: mehdi_amini.
ezhulenev added a reviewer: dcaballe.
ftynse accepted this revision.Mar 12 2021, 12:12 AM
This revision is now accepted and ready to land.Mar 12 2021, 12:12 AM

Thanks for addressing this issue! Would this work if we compiled in release mode and with asserts enabled?

mehdi_amini accepted this revision.Mar 12 2021, 9:07 AM

Would this work if we compiled in release mode and with asserts enabled?

Yes: the way asserts are enabled is by defining -DNDEBUG.

Use LLVM_ATTRIBUTE_UNUSED

ezhulenev retitled this revision from [mlir] Put functions used only in debug mode under NDEBUG to [mlir] Annotate functions used only in debug mode with LLVM_ATTRIBUTE_UNUSED.Mar 12 2021, 10:40 AM
dcaballe accepted this revision.Mar 12 2021, 11:24 AM

Thanks!

This revision was landed with ongoing or failed builds.Mar 12 2021, 11:26 AM
This revision was automatically updated to reflect the committed changes.