Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
fzakaria committed Jul 8, 2023
1 parent 640d1ae commit 6bc0459
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 15 deletions.
14 changes: 0 additions & 14 deletions third_party/libcxx/span
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -133,17 +130,10 @@ template<class Container>
*/

#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
Expand Down Expand Up @@ -598,8 +588,4 @@ template<class _Container>

_LIBCPP_END_NAMESPACE_STD

<<<<<<< HEAD
#endif // _LIBCPP_SPAN
=======
#endif // _LIBCPP_SPAN
>>>>>>> 80151924e (wip)
3 changes: 3 additions & 0 deletions third_party/mold/fake_tbb.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

namespace tbb {

template <typename T>
using concurrent_vector = std::vector<T>;

template<typename InputIterator, typename Function>
void parallel_for_each(InputIterator first, InputIterator last, const Function& f) {
}
Expand Down
4 changes: 4 additions & 0 deletions third_party/mold/mold.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
6 changes: 5 additions & 1 deletion third_party/mold/perf.cc
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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<Counter*, i64>& b) {
return a + b.second;
});
}

void Counter::print() {
Expand Down

0 comments on commit 6bc0459

Please sign in to comment.