summaryrefslogtreecommitdiff
path: root/libc/spec
diff options
context:
space:
mode:
authorMichael Jones <michaelrj@google.com>2023-04-14 15:36:39 -0700
committerMichael Jones <michaelrj@google.com>2023-04-14 15:40:05 -0700
commit1c261e360f558a914b9eafb22423f893f5dc54de (patch)
tree93e6b7ffbb207a78c2c46b0eb591a96f9d659dc5 /libc/spec
parent5e53e1bbc34fe563b740364d7329ca0bd123f9ff (diff)
downloadllvm-1c261e360f558a914b9eafb22423f893f5dc54de.tar.gz
[libc] Add implementation of getchar
added getchar and getchar_unlocked which are just wrappers getc and getc_unlocked respectively. Reviewed By: sivachandra, lntue, michaelrj Differential Revision: https://reviews.llvm.org/D147919
Diffstat (limited to 'libc/spec')
-rw-r--r--libc/spec/posix.td5
-rw-r--r--libc/spec/stdc.td5
2 files changed, 10 insertions, 0 deletions
diff --git a/libc/spec/posix.td b/libc/spec/posix.td
index de160960ab6a..f59891c00c3a 100644
--- a/libc/spec/posix.td
+++ b/libc/spec/posix.td
@@ -1077,6 +1077,11 @@ def POSIX : StandardSpec<"POSIX"> {
RetValSpec<IntType>,
[ArgSpec<FILEPtr>]
>,
+ FunctionSpec<
+ "getchar_unlocked",
+ RetValSpec<IntType>,
+ [ArgSpec<VoidType>]
+ >,
]
>;
diff --git a/libc/spec/stdc.td b/libc/spec/stdc.td
index 56ee9a60d10a..ad29bb8b4be1 100644
--- a/libc/spec/stdc.td
+++ b/libc/spec/stdc.td
@@ -581,6 +581,11 @@ def StdC : StandardSpec<"stdc"> {
[ArgSpec<FILEPtr>]
>,
FunctionSpec<
+ "getchar",
+ RetValSpec<IntType>,
+ [ArgSpec<VoidType>]
+ >,
+ FunctionSpec<
"putc",
RetValSpec<IntType>,
[ArgSpec<IntType>,