================
@@ -0,0 +1,26 @@
+//===-- Static header for libc_constraint_handler ---------------*- C++ 
-*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM 
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_LIBC_SRC___SUPPORT_ANNEX_K_LIBC_CONSTRAINT_HANDLER_H
+#define LLVM_LIBC_SRC___SUPPORT_ANNEX_K_LIBC_CONSTRAINT_HANDLER_H
+
+#include "abort_handler_s.h"
+#include "hdr/types/constraint_handler_t.h"
+
+namespace LIBC_NAMESPACE_DECL {
+
+namespace annex_k {
+
+LIBC_INLINE static constraint_handler_t libc_constraint_handler =
----------------
vhscampos wrote:

If I understand this correctly, every translation unit that includes this 
header will have a separate definition of `libc_constraint_handler`. That is, 
we will have multiple local (static) definitions instead of a global shared 
one. If my understanding is correct, this is wrong, as the definition will not 
be shared.

IIUC the correct way is to have just the declaration here in the header, and 
create a new source file `libc_constraint_handler.cpp` somewhere that has the 
actual definition.

https://github.com/llvm/llvm-project/pull/164091
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to