Skip to content

Commit c1effb1

Browse files
jbergstroemMylesBorins
authored andcommitted
deps: fix build with libc++ 3.8.0
Make sure the map allocators are of the same type. This fixes building Node.js 4.x on libc++ 3.8.0 (for instance FreeBSD 11). Upstream bug/patch: https://bugs.freebsd.org/208467 PR-URL: #9763 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Myles Borins <[email protected]> Reviewed-By: Ali Ijaz Sheikh <[email protected]>
1 parent 9144d37 commit c1effb1

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

deps/v8/src/compiler/instruction.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1012,7 +1012,7 @@ class InstructionBlock final : public ZoneObject {
10121012

10131013
typedef ZoneDeque<Constant> ConstantDeque;
10141014
typedef std::map<int, Constant, std::less<int>,
1015-
zone_allocator<std::pair<int, Constant> > > ConstantMap;
1015+
zone_allocator<std::pair<const int, Constant> > > ConstantMap;
10161016

10171017
typedef ZoneDeque<Instruction*> InstructionDeque;
10181018
typedef ZoneDeque<ReferenceMap*> ReferenceMapDeque;

deps/v8/src/compiler/js-type-feedback.h

+3-2
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,10 @@ class JSTypeFeedbackTable : public ZoneObject {
3333
private:
3434
friend class JSTypeFeedbackSpecializer;
3535
typedef std::map<NodeId, TypeFeedbackId, std::less<NodeId>,
36-
zone_allocator<TypeFeedbackId> > TypeFeedbackIdMap;
36+
zone_allocator<std::pair<const NodeId, TypeFeedbackId> > >
37+
TypeFeedbackIdMap;
3738
typedef std::map<NodeId, FeedbackVectorICSlot, std::less<NodeId>,
38-
zone_allocator<FeedbackVectorICSlot> >
39+
zone_allocator<std::pair<const NodeId, FeedbackVectorICSlot> > >
3940
FeedbackVectorICSlotMap;
4041

4142
TypeFeedbackIdMap type_feedback_id_map_;

deps/v8/src/zone-containers.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,12 @@ class ZoneSet : public std::set<K, Compare, zone_allocator<K>> {
114114
// a zone allocator.
115115
template <typename K, typename V, typename Compare = std::less<K>>
116116
class ZoneMap
117-
: public std::map<K, V, Compare, zone_allocator<std::pair<K, V>>> {
117+
: public std::map<K, V, Compare, zone_allocator<std::pair<const K, V>>> {
118118
public:
119119
// Constructs an empty map.
120120
explicit ZoneMap(Zone* zone)
121-
: std::map<K, V, Compare, zone_allocator<std::pair<K, V>>>(
122-
Compare(), zone_allocator<std::pair<K, V>>(zone)) {}
121+
: std::map<K, V, Compare, zone_allocator<std::pair<const K, V>>>(
122+
Compare(), zone_allocator<std::pair<const K, V>>(zone)) {}
123123
};
124124

125125

0 commit comments

Comments
 (0)