Skip to content

Commit d4ff775

Browse files
committed
Replaced include/swift/Basic/Algorithm.h with calls to standard algorithms
LLVM now requires C++14, and the header says the algorithms are backported from C++14.
1 parent d81161a commit d4ff775

File tree

3 files changed

+4
-41
lines changed

3 files changed

+4
-41
lines changed

include/swift/Basic/Algorithm.h

Lines changed: 0 additions & 35 deletions
This file was deleted.

include/swift/Basic/FlaggedPointer.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,12 @@
1717
#ifndef SWIFT_BASIC_FLAGGEDPOINTER_H
1818
#define SWIFT_BASIC_FLAGGEDPOINTER_H
1919

20+
#include <algorithm>
2021
#include <cassert>
2122

2223
#include "llvm/Support/Compiler.h"
2324
#include "llvm/Support/PointerLikeTypeTraits.h"
2425

25-
#include "Algorithm.h"
26-
2726
namespace swift {
2827

2928
/// This class implements a pair of a pointer and boolean flag.
@@ -170,7 +169,7 @@ struct llvm::PointerLikeTypeTraits<
170169
enum {
171170
NumLowBitsAvailable = (BitPosition >= PtrTraits::NumLowBitsAvailable)
172171
? PtrTraits::NumLowBitsAvailable
173-
: (swift::min(int(BitPosition + 1),
172+
: (std::min(int(BitPosition + 1),
174173
int(PtrTraits::NumLowBitsAvailable)) - 1)
175174
};
176175
};

include/swift/Basic/PrefixMap.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
#ifndef SWIFT_BASIC_PREFIXMAP_H
3535
#define SWIFT_BASIC_PREFIXMAP_H
3636

37-
#include "swift/Basic/Algorithm.h"
3837
#include "swift/Basic/Debug.h"
3938
#include "swift/Basic/LLVM.h"
4039
#include "swift/Basic/type_traits.h"
@@ -53,8 +52,8 @@ template <class KeyElementType> class PrefixMapKeyPrinter;
5352
/// A map whose keys are sequences of comparable values, optimized for
5453
/// finding a mapped value for the longest matching initial subsequence.
5554
template <class KeyElementType, class ValueType,
56-
size_t InlineKeyCapacity
57-
= max<size_t>((sizeof(void*) - 1) / sizeof(KeyElementType), 1)>
55+
size_t InlineKeyCapacity = std::max(
56+
(sizeof(void *) - 1) / sizeof(KeyElementType), size_t(1))>
5857
class PrefixMap {
5958
public:
6059
using KeyType = ArrayRef<KeyElementType>;

0 commit comments

Comments
 (0)