[PATCH] D38073: [XRay][compiler-rt] Use pthread for initializing thread-local data
    Martin Pelikán via Phabricator via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Mon Oct  2 22:11:09 PDT 2017
    
    
  
pelikan accepted this revision.
pelikan added inline comments.
This revision is now accepted and ready to land.
================
Comment at: lib/xray/xray_fdr_logging_impl.h:180
+  // Ensure that we only actually ever do the pthread initialization once.
+  thread_local bool unused = [] {
+    new (&TLSBuffer) ThreadLocalData();
----------------
I reckon this should get the UNUSED sanitizer_common macro, which expands to `__attribute__((unused))` to stop the compiler whinging about it.
Plus, CodingStandards.rst wants it to be called "Unused" (same above - Key).
================
Comment at: lib/xray/xray_fdr_logging_impl.h:209
+  }();
+  (void)unused;
+
----------------
This line can go away with the UNUSED macro up there.
https://reviews.llvm.org/D38073
    
    
More information about the llvm-commits
mailing list