[libc-commits] [PATCH] D79189: [libc][NFC] Rename cpp::function to cpp::Function.

Siva Chandra via Phabricator via libc-commits libc-commits at lists.llvm.org
Thu Apr 30 11:15:12 PDT 2020


sivachandra created this revision.
sivachandra added a reviewer: abrachet.
Herald added subscribers: libc-commits, tschuett.
Herald added a project: libc-project.

Just to be consistent with other names in cpp.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D79189

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


Index: libc/utils/CPP/Functional.h
===================================================================
--- libc/utils/CPP/Functional.h
+++ 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...); }
 };
Index: libc/test/config/linux/x86_64/syscall_test.cpp
===================================================================
--- libc/test/config/linux/x86_64/syscall_test.cpp
+++ libc/test/config/linux/x86_64/syscall_test.cpp
@@ -15,30 +15,30 @@
   // 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); });
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D79189.261294.patch
Type: text/x-patch
Size: 2844 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20200430/ac9ff1ae/attachment-0001.bin>


More information about the libc-commits mailing list