Skip to content

Commit

Permalink
[libc] Move b* string functions to strings.h
Browse files Browse the repository at this point in the history
Traditionally these functions are exposed in string*s*.h not string.h

Differential Revision: https://reviews.llvm.org/D141237
  • Loading branch information
abrachet committed Jan 9, 2023
1 parent c6dcbed commit dc1b614
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 3 deletions.
9 changes: 9 additions & 0 deletions libc/include/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,15 @@ add_gen_header(
.llvm-libc-types.size_t
)

add_gen_header(
strings
DEF_FILE strings.h.def
GEN_HDR strings.h
DEPENDS
.llvm_libc_common_h
.llvm-libc-types.size_t
)

add_gen_header(
time
DEF_FILE time.h.def
Expand Down
16 changes: 16 additions & 0 deletions libc/include/strings.h.def
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//===-- C standard library header strings.h -------------------------------===//
//
// 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_STRINGS_H
#define LLVM_LIBC_STRINGS_H

#include <__llvm-libc-common.h>

%%public_api()

#endif // LLVM_LIBC_STRINGS_H
6 changes: 3 additions & 3 deletions libc/spec/llvm_libc_ext.td
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
def LLVMLibcExt : StandardSpec<"llvm_libc_ext"> {
HeaderSpec String = HeaderSpec<
"string.h",
HeaderSpec Strings = HeaderSpec<
"strings.h",
[], // Macros
[], // Types
[], // Enumerations
Expand Down Expand Up @@ -52,7 +52,7 @@ def LLVMLibcExt : StandardSpec<"llvm_libc_ext"> {
>;

let Headers = [
String,
Strings,
Sched,
Assert,
];
Expand Down

0 comments on commit dc1b614

Please sign in to comment.