[PATCH] D91851: [compiler-rt] [emutls] Handle unused parameters in a compiler agnostic way

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 25 13:10:12 PST 2020


mstorsjo updated this revision to Diff 307700.
mstorsjo retitled this revision from "[compiler-rt] [emutls] Add ifdefs around msvc specific pragmas" to "[compiler-rt] [emutls] Handle unused parameters in a compiler agnostic way".
mstorsjo edited the summary of this revision.
mstorsjo added a comment.

Removed the pragmas altogether and replaced with casts to void.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D91851/new/

https://reviews.llvm.org/D91851

Files:
  compiler-rt/lib/builtins/emutls.c


Index: compiler-rt/lib/builtins/emutls.c
===================================================================
--- compiler-rt/lib/builtins/emutls.c
+++ compiler-rt/lib/builtins/emutls.c
@@ -182,9 +182,10 @@
   }
 }
 
-#pragma warning(push)
-#pragma warning(disable : 4100)
 static BOOL CALLBACK emutls_init(PINIT_ONCE p0, PVOID p1, PVOID *p2) {
+  (void)p0;
+  (void)p1;
+  (void)p2;
   emutls_mutex =
       (LPCRITICAL_SECTION)_aligned_malloc(sizeof(CRITICAL_SECTION), 16);
   if (!emutls_mutex) {
@@ -251,8 +252,6 @@
 
 #endif // __ATOMIC_RELEASE
 
-#pragma warning(pop)
-
 #endif // _WIN32
 
 static size_t emutls_num_object = 0; // number of allocated TLS objects


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D91851.307700.patch
Type: text/x-patch
Size: 668 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201125/6bfdf230/attachment.bin>


More information about the llvm-commits mailing list