[libc][NFC] Add bzero to list of entrypoints.
authorSiva Chandra Reddy <sivachandra@google.com>
Tue, 9 Jun 2020 00:31:04 +0000 (17:31 -0700)
committerSiva Chandra Reddy <sivachandra@google.com>
Tue, 9 Jun 2020 04:44:39 +0000 (21:44 -0700)
A new LLVM libc specific extension standard spec has been added.

libc/config/linux/api.td
libc/config/linux/x86_64/entrypoints.txt
libc/spec/llvm_libc_ext.td [new file with mode: 0644]

index 4259fd7..5ac6b9d 100644 (file)
@@ -2,6 +2,7 @@ include "config/public_api.td"
 
 include "spec/gnu_ext.td"
 include "spec/linux.td"
+include "spec/llvm_libc_ext.td"
 include "spec/posix.td"
 include "spec/stdc.td"
 
@@ -168,6 +169,7 @@ def MathAPI : PublicAPI<"math.h"> {
 
 def StringAPI : PublicAPI<"string.h"> {
   let Functions = [
+    "bzero",
     "memcpy",
     "memmove",
     "memcmp",
index 54fe783..d5ed7a2 100644 (file)
@@ -20,6 +20,7 @@ set(LIBC_ENTRYPOINTS
     libc.src.stdlib.abort
 
     # string.h entrypoints
+    libc.src.string.bzero
     libc.src.string.memcpy
     libc.src.string.strcpy
     libc.src.string.strcat
diff --git a/libc/spec/llvm_libc_ext.td b/libc/spec/llvm_libc_ext.td
new file mode 100644 (file)
index 0000000..d8a2b8b
--- /dev/null
@@ -0,0 +1,20 @@
+def LLVMLibcExt : StandardSpec<"llvm_libc_ext"> {
+  HeaderSpec String = HeaderSpec<
+      "string.h",
+      [], // Macros
+      [], // Types
+      [], // Enumerations
+      [
+          FunctionSpec<
+              "bzero",
+              RetValSpec<VoidType>,
+              [ArgSpec<VoidPtr>,
+               ArgSpec<SizeTType>]
+          >,
+      ]
+  >;
+
+  let Headers = [
+    String,
+  ];
+}