From 6bc04598bf55e020a21ac820a291edca1f55c4b7 Mon Sep 17 00:00:00 2001 From: Farid Zakaria Date: Sat, 8 Jul 2023 20:02:40 +0000 Subject: [PATCH] minor fixes --- third_party/libcxx/span | 14 -------------- third_party/mold/fake_tbb.h | 3 +++ third_party/mold/mold.mk | 4 ++++ third_party/mold/perf.cc | 6 +++++- 4 files changed, 12 insertions(+), 15 deletions(-) diff --git a/third_party/libcxx/span b/third_party/libcxx/span index 66cef1de3..c56bed57e 100644 --- a/third_party/libcxx/span +++ b/third_party/libcxx/span @@ -1,8 +1,5 @@ // -*- C++ -*- -<<<<<<< HEAD // clang-format off -======= ->>>>>>> 80151924e (wip) //===------------------------------ span ---------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. @@ -133,17 +130,10 @@ template */ #include "third_party/libcxx/__config" -<<<<<<< HEAD #include "third_party/libcxx/iterator" // for iterators #include "third_party/libcxx/array" // for array #include "third_party/libcxx/type_traits" // for remove_cv, etc #include "third_party/libcxx/cstddef" // for byte -======= -#include "third_party/libcxx/cstddef" // for ptrdiff_t -#include "third_party/libcxx/iterator" // for iterators -#include "third_party/libcxx/array" // for array -#include "third_party/libcxx/type_traits" // for remove_cv, etc ->>>>>>> 80151924e (wip) #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header @@ -598,8 +588,4 @@ template _LIBCPP_END_NAMESPACE_STD -<<<<<<< HEAD #endif // _LIBCPP_SPAN -======= -#endif // _LIBCPP_SPAN ->>>>>>> 80151924e (wip) diff --git a/third_party/mold/fake_tbb.h b/third_party/mold/fake_tbb.h index 008966707..072fa42e5 100644 --- a/third_party/mold/fake_tbb.h +++ b/third_party/mold/fake_tbb.h @@ -3,6 +3,9 @@ namespace tbb { + template + using concurrent_vector = std::vector; + template void parallel_for_each(InputIterator first, InputIterator last, const Function& f) { } diff --git a/third_party/mold/mold.mk b/third_party/mold/mold.mk index a29cadb58..f0e76c194 100644 --- a/third_party/mold/mold.mk +++ b/third_party/mold/mold.mk @@ -13,6 +13,10 @@ THIRD_PARTY_MOLD_OBJS = $(THIRD_PARTY_MOLD_SRCS:%.cc=o/$(MODE)/%.o) THIRD_PARTY_MOLD_A_DIRECTDEPS = \ THIRD_PARTY_LIBCXX \ + LIBC_STR \ + LIBC_INTRIN \ + LIBC_STDIO \ + LIBC_RUNTIME \ THIRD_PARTY_ZSTD \ THIRD_PARTY_XXHASH \ THIRD_PARTY_GETOPT \ diff --git a/third_party/mold/perf.cc b/third_party/mold/perf.cc index 7da0df840..90ab1bcff 100644 --- a/third_party/mold/perf.cc +++ b/third_party/mold/perf.cc @@ -1,9 +1,11 @@ // clang-format off #include "third_party/mold/common.h" +#include "third_party/mold/fake_tbb.h" #include "third_party/libcxx/functional" #include "third_party/libcxx/iomanip" #include "third_party/libcxx/ios" +#include "third_party/libcxx/numeric" #ifndef _WIN32 #include "libc/calls/calls.h" @@ -27,7 +29,9 @@ namespace mold { i64 Counter::get_value() { - return values.combine(std::plus()); + return std::accumulate(values.begin(), values.end(), 0, [](i64 a, const std::pair& b) { + return a + b.second; + }); } void Counter::print() {