[PATCH] D29860: [XRay] [compiler-rt] [NFC] Annotate unused variables for the compiler.

Martin Pelikán via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 10 19:19:47 PST 2017


pelikan created this revision.

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.


https://reviews.llvm.org/D29860

Files:
  lib/xray/xray_fdr_logging.cc
  lib/xray/xray_inmemory_log.cc


Index: lib/xray/xray_inmemory_log.cc
===================================================================
--- lib/xray/xray_inmemory_log.cc
+++ lib/xray/xray_inmemory_log.cc
@@ -130,7 +130,7 @@
   }
 }
 
-static auto Unused = [] {
+static auto UNUSED Unused = [] {
   if (!probeRequiredCPUFeatures()) {
     Report("Required CPU features missing for XRay instrumentation, not "
            "installing instrumentation hooks.\n");
Index: lib/xray/xray_fdr_logging.cc
===================================================================
--- lib/xray/xray_fdr_logging.cc
+++ lib/xray/xray_fdr_logging.cc
@@ -523,7 +523,7 @@
 
 } // namespace __xray
 
-static auto Unused = [] {
+static auto UNUSED Unused = [] {
   using namespace __xray;
   if (flags()->xray_fdr_log) {
     XRayLogImpl Impl{


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D29860.88079.patch
Type: text/x-patch
Size: 789 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170211/5003d1ce/attachment.bin>


More information about the llvm-commits mailing list