[llvm-branch-commits] [compiler-rt] 2e5aaf6 - [compiler-rt] [emutls] Handle unused parameters in a compiler agnostic way
Martin Storsjö via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Tue Dec 1 00:12:07 PST 2020
Author: Martin Storsjö
Date: 2020-12-01T10:07:53+02:00
New Revision: 2e5aaf65a344ae804343bfed6326ef33f61586b0
URL: https://github.com/llvm/llvm-project/commit/2e5aaf65a344ae804343bfed6326ef33f61586b0
DIFF: https://github.com/llvm/llvm-project/commit/2e5aaf65a344ae804343bfed6326ef33f61586b0.diff
LOG: [compiler-rt] [emutls] Handle unused parameters in a compiler agnostic way
The MSVC specific pragmas disable this warning, but the pragmas themselves
(when not guarded by any _MSC_VER ifdef) cause warnings for other targets,
e.g. when targeting mingw.
Instead silence the MSVC warnings about unused parameters by casting
the parameters to void.
Differential Revision: https://reviews.llvm.org/D91851
Added:
Modified:
compiler-rt/lib/builtins/emutls.c
Removed:
################################################################################
diff --git a/compiler-rt/lib/builtins/emutls.c b/compiler-rt/lib/builtins/emutls.c
index e0aa19155f7d..98cabd917d6c 100644
--- a/compiler-rt/lib/builtins/emutls.c
+++ b/compiler-rt/lib/builtins/emutls.c
@@ -182,9 +182,10 @@ static void emutls_exit(void) {
}
}
-#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 @@ static __inline void __atomic_store_n(void *ptr, uintptr_t val, unsigned type) {
#endif // __ATOMIC_RELEASE
-#pragma warning(pop)
-
#endif // _WIN32
static size_t emutls_num_object = 0; // number of allocated TLS objects
More information about the llvm-branch-commits
mailing list