This is an archive of the discontinued LLVM Phabricator instance.

[XRay] [compiler-rt] [NFC] Annotate unused variables for the compiler.
ClosedPublic

Authored by pelikan on Feb 10 2017, 7:19 PM.

Details

Summary

Use a common definition of a "this variable is unused" annotation for useless
variables only present for their lambda global initializers, to silence gcc's
warning.

Event Timeline

pelikan created this revision.Feb 10 2017, 7:19 PM
dberris added inline comments.Feb 13 2017, 9:56 AM
lib/xray/xray_fdr_logging.cc
526

Where does UNUSED come from?

pelikan marked an inline comment as done.Feb 17 2017, 10:08 PM
pelikan added inline comments.
lib/xray/xray_fdr_logging.cc
526

$ git grep UNUSED | grep \#define
lib/builtins/int_lib.h:#define UNUSED
lib/builtins/int_lib.h:#define UNUSED attribute((unused))

This comes from the sanitizer_common header set.

dberris accepted this revision.Feb 19 2017, 7:51 PM
dberris added inline comments.
lib/xray/xray_fdr_logging.cc
526

Don't you need to include a header to get that definition?

This revision is now accepted and ready to land.Feb 19 2017, 7:51 PM
This revision was automatically updated to reflect the committed changes.
dberris added inline comments.Feb 28 2017, 1:01 AM
lib/xray/xray_fdr_logging.cc
526

Apparently not. Landed without further changes after local testing.