Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/ir/possible-constant.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ struct PossibleConstantValues {
public:
PossibleConstantValues() : value(None()) {}

bool operator==(const PossibleConstantValues& other) const {
return value == other.value;
}

// Notes the contents of an expression and update our internal knowledge based
// on it and all previous values noted.
void note(Expression* expr, Module& wasm) {
Expand Down Expand Up @@ -155,7 +159,7 @@ struct PossibleConstantValues {
}

// Assuming we have a single value, make an expression containing that value.
Expression* makeExpression(Module& wasm) {
Expression* makeExpression(Module& wasm) const {
Builder builder(wasm);
if (isConstantLiteral()) {
return builder.makeConstantExpression(getConstantLiteral());
Expand Down
5 changes: 3 additions & 2 deletions src/ir/subtypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@ struct SubTypes {
// Efficiently iterate on subtypes of a type, up to a particular depth (depth
// 0 means not to traverse subtypes, etc.). The callback function receives
// (type, depth).
template<typename F> void iterSubTypes(HeapType type, Index depth, F func) {
template<typename F>
void iterSubTypes(HeapType type, Index depth, F func) const {
// Start by traversing the type itself.
func(type, 0);

Expand Down Expand Up @@ -186,7 +187,7 @@ struct SubTypes {
}

// As above, but iterate to the maximum depth.
template<typename F> void iterSubTypes(HeapType type, F func) {
template<typename F> void iterSubTypes(HeapType type, F func) const {
return iterSubTypes(type, std::numeric_limits<Index>::max(), func);
}

Expand Down