Skip to content

Commit dac3ce0

Browse files
Merge branch 'main' into safeheap-fix
2 parents a509931 + 653c164 commit dac3ce0

File tree

8 files changed

+46
-33718
lines changed

8 files changed

+46
-33718
lines changed

src/passes/Print.cpp

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3894,10 +3894,6 @@ printStackIR(std::ostream& o, Module* module, const PassOptions& options) {
38943894
return o;
38953895
}
38963896

3897-
} // namespace wasm
3898-
3899-
namespace std {
3900-
39013897
std::ostream& operator<<(std::ostream& o, wasm::Module& module) {
39023898
wasm::PassRunner runner(&module);
39033899
wasm::Printer printer(&o);
@@ -3958,4 +3954,19 @@ std::ostream& operator<<(std::ostream& o,
39583954
return o << importNames.module << "." << importNames.name;
39593955
}
39603956

3961-
} // namespace std
3957+
std::ostream& operator<<(std::ostream& os, wasm::MemoryOrder mo) {
3958+
switch (mo) {
3959+
case wasm::MemoryOrder::Unordered:
3960+
os << "Unordered";
3961+
break;
3962+
case wasm::MemoryOrder::SeqCst:
3963+
os << "SeqCst";
3964+
break;
3965+
case wasm::MemoryOrder::AcqRel:
3966+
os << "AcqRel";
3967+
break;
3968+
}
3969+
return os;
3970+
}
3971+
3972+
} // namespace wasm

src/wasm.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2654,15 +2654,6 @@ struct ShallowExpression {
26542654
Module* module = nullptr;
26552655
};
26562656

2657-
} // namespace wasm
2658-
2659-
namespace std {
2660-
template<> struct hash<wasm::Address> {
2661-
size_t operator()(const wasm::Address a) const {
2662-
return std::hash<wasm::Address::address64_t>()(a.addr);
2663-
}
2664-
};
2665-
26662657
std::ostream& operator<<(std::ostream& o, wasm::Module& module);
26672658
std::ostream& operator<<(std::ostream& o, wasm::Function& func);
26682659
std::ostream& operator<<(std::ostream& o, wasm::Expression& expression);
@@ -2673,6 +2664,15 @@ std::ostream& operator<<(std::ostream& o, wasm::ModuleHeapType pair);
26732664
std::ostream& operator<<(std::ostream& os, wasm::MemoryOrder mo);
26742665
std::ostream& operator<<(std::ostream& o, const wasm::ImportNames& importNames);
26752666

2667+
} // namespace wasm
2668+
2669+
namespace std {
2670+
template<> struct hash<wasm::Address> {
2671+
size_t operator()(const wasm::Address a) const {
2672+
return std::hash<wasm::Address::address64_t>()(a.addr);
2673+
}
2674+
};
2675+
26762676
} // namespace std
26772677

26782678
#endif // wasm_wasm_h

src/wasm/wasm.cpp

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2016,22 +2016,3 @@ void Module::clearDebugInfo() {
20162016
}
20172017

20182018
} // namespace wasm
2019-
2020-
namespace std {
2021-
2022-
std::ostream& operator<<(std::ostream& os, wasm::MemoryOrder mo) {
2023-
switch (mo) {
2024-
case wasm::MemoryOrder::Unordered:
2025-
os << "Unordered";
2026-
break;
2027-
case wasm::MemoryOrder::SeqCst:
2028-
os << "SeqCst";
2029-
break;
2030-
case wasm::MemoryOrder::AcqRel:
2031-
os << "AcqRel";
2032-
break;
2033-
}
2034-
return os;
2035-
}
2036-
2037-
} // namespace std

0 commit comments

Comments
 (0)