Skip to content

Commit d8e55c8

Browse files
[libc] Expose the Sign type for shared use (#150083)
This patch exposes the internal `Sign` type for shared use by other LLVM subprojects, following the pattern established by `FPBits`. The `FPBits` utility is exposed via `libc/shared/fp_bits.h`. However, its public interface relies on the `Sign` type for, e.g., creating signed infinities and returning the sign of a value. Currently, users of the shared `FPBits` have no way to access the `Sign` type. Following the existing pattern for sharing `libc` utilities, this patch adds a new public header `libc/shared/sign.h`. This header simply includes the internal `src/__support/sign.h` and brings the `Sign` type into the `shared` namespace.
1 parent a0aebb1 commit d8e55c8

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

libc/shared/sign.h

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
//===-- Shared sign type ----------------------------------------*- C++ -*-===//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
9+
#ifndef LLVM_LIBC_SHARED_SIGN_H
10+
#define LLVM_LIBC_SHARED_SIGN_H
11+
12+
#include "libc_common.h"
13+
#include "src/__support/sign.h"
14+
15+
namespace LIBC_NAMESPACE_DECL {
16+
namespace shared {
17+
18+
using LIBC_NAMESPACE_DECL::Sign;
19+
20+
} // namespace shared
21+
} // namespace LIBC_NAMESPACE_DECL
22+
23+
#endif // LLVM_LIBC_SHARED_SIGN_H

0 commit comments

Comments
 (0)