summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ir/possible-constant.h6
-rw-r--r--src/ir/subtypes.h5
2 files changed, 8 insertions, 3 deletions
diff --git a/src/ir/possible-constant.h b/src/ir/possible-constant.h
index 21f1cfa65..79a9973b5 100644
--- a/src/ir/possible-constant.h
+++ b/src/ir/possible-constant.h
@@ -48,6 +48,10 @@ private:
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) {
@@ -155,7 +159,7 @@ public:
}
// 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());
diff --git a/src/ir/subtypes.h b/src/ir/subtypes.h
index 488bb8310..8645afb98 100644
--- a/src/ir/subtypes.h
+++ b/src/ir/subtypes.h
@@ -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);
@@ -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);
}