[libc-commits] [libc] 675eea4 - [libc][NFC] Rename cpp::function to cpp::Function.

Siva Chandra Reddy via libc-commits libc-commits at lists.llvm.org
Thu Apr 30 11:58:53 PDT 2020


Author: Siva Chandra Reddy
Date: 2020-04-30T11:58:26-07:00
New Revision: 675eea46f0452933170bb94307867dca8d9c80b9

URL: https://github.com/llvm/llvm-project/commit/675eea46f0452933170bb94307867dca8d9c80b9
DIFF: https://github.com/llvm/llvm-project/commit/675eea46f0452933170bb94307867dca8d9c80b9.diff

LOG: [libc][NFC] Rename cpp::function to cpp::Function.

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

Added: 
    

Modified: 
    libc/test/config/linux/x86_64/syscall_test.cpp
    libc/utils/CPP/Functional.h

Removed: 
    


################################################################################
diff  --git a/libc/test/config/linux/x86_64/syscall_test.cpp b/libc/test/config/linux/x86_64/syscall_test.cpp
index b2487332947e..160255c511f0 100644
--- a/libc/test/config/linux/x86_64/syscall_test.cpp
+++ b/libc/test/config/linux/x86_64/syscall_test.cpp
@@ -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); });
 }

diff  --git a/libc/utils/CPP/Functional.h b/libc/utils/CPP/Functional.h
index 70d3fe9867a8..da73e4cb1980 100644
--- a/libc/utils/CPP/Functional.h
+++ b/libc/utils/CPP/Functional.h
@@ -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...); }
 };


        


More information about the libc-commits mailing list