Skip to content

Commit

Permalink
[libc][NFC] Rename cpp::function to cpp::Function.
Browse files Browse the repository at this point in the history
Summary: Just to be consistent with other names in cpp.

Reviewers: abrachet

Subscribers: tschuett, libc-commits

Tags: #libc-project

Differential Revision: https://reviews.llvm.org/D79189
  • Loading branch information
Siva Chandra Reddy committed Apr 30, 2020
1 parent d93ae65 commit 675eea4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
18 changes: 9 additions & 9 deletions libc/test/config/linux/x86_64/syscall_test.cpp
Expand Up @@ -15,30 +15,30 @@ TEST(X86_64_SyscallTest, APITest) {
// We only do a signature test here. Actual functionality tests are
// done by the unit tests of the syscall wrappers like mmap.

using __llvm_libc::cpp::function;
using __llvm_libc::cpp::Function;

function<long(long)> f([](long n) { return __llvm_libc::syscall(n); });
function<long(long, long)> f1(
Function<long(long)> f([](long n) { return __llvm_libc::syscall(n); });
Function<long(long, long)> f1(
[](long n, long a1) { return __llvm_libc::syscall(n, a1); });
function<long(long, long, long)> f2(
Function<long(long, long, long)> f2(
[](long n, long a1, long a2) { return __llvm_libc::syscall(n, a1, a2); });
function<long(long, long, long, long)> f3(
Function<long(long, long, long, long)> f3(
[](long n, long a1, long a2, long a3) {
return __llvm_libc::syscall(n, a1, a2, a3);
});
function<long(long, long, long, long, long)> f4(
Function<long(long, long, long, long, long)> f4(
[](long n, long a1, long a2, long a3, long a4) {
return __llvm_libc::syscall(n, a1, a2, a3, a4);
});
function<long(long, long, long, long, long, long)> f5(
Function<long(long, long, long, long, long, long)> f5(
[](long n, long a1, long a2, long a3, long a4, long a5) {
return __llvm_libc::syscall(n, a1, a2, a3, a4, a5);
});
function<long(long, long, long, long, long, long, long)> f6(
Function<long(long, long, long, long, long, long, long)> f6(
[](long n, long a1, long a2, long a3, long a4, long a5, long a6) {
return __llvm_libc::syscall(n, a1, a2, a3, a4, a5, a6);
});

function<long(long, void *)> notLongType(
Function<long(long, void *)> notLongType(
[](long n, void *a1) { return __llvm_libc::syscall(n, a1); });
}
8 changes: 4 additions & 4 deletions libc/utils/CPP/Functional.h
Expand Up @@ -12,14 +12,14 @@
namespace __llvm_libc {
namespace cpp {

template <typename Func> class function;
template <typename Func> class Function;

template <typename Ret, typename... Params> class function<Ret(Params...)> {
template <typename Ret, typename... Params> class Function<Ret(Params...)> {
Ret (*func)(Params...) = nullptr;

public:
constexpr function() = default;
template <typename Func> constexpr function(Func &&f) : func(f) {}
constexpr Function() = default;
template <typename Func> constexpr Function(Func &&f) : func(f) {}

constexpr Ret operator()(Params... params) { return func(params...); }
};
Expand Down

0 comments on commit 675eea4

Please sign in to comment.