summaryrefslogtreecommitdiff
path: root/src/ir/module-utils.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/ir/module-utils.h')
-rw-r--r--src/ir/module-utils.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/ir/module-utils.h b/src/ir/module-utils.h
index 62a9dd921..a2d256073 100644
--- a/src/ir/module-utils.h
+++ b/src/ir/module-utils.h
@@ -308,7 +308,9 @@ template<typename T> struct CallGraphPropertyAnalysis {
struct FunctionInfo {
std::set<Function*> callsTo;
std::set<Function*> calledBy;
- bool hasIndirectCall = false;
+ // A non-direct call is any call that is not direct. That includes
+ // CallIndirect and CallRef.
+ bool hasNonDirectCall = false;
};
typedef std::map<Function*, T> Map;
@@ -331,7 +333,7 @@ template<typename T> struct CallGraphPropertyAnalysis {
}
void visitCallIndirect(CallIndirect* curr) {
- info.hasIndirectCall = true;
+ info.hasNonDirectCall = true;
}
private:
@@ -354,7 +356,7 @@ template<typename T> struct CallGraphPropertyAnalysis {
}
}
- enum IndirectCalls { IgnoreIndirectCalls, IndirectCallsHaveProperty };
+ enum NonDirectCalls { IgnoreNonDirectCalls, NonDirectCallsHaveProperty };
// Propagate a property from a function to those that call it.
//
@@ -365,13 +367,13 @@ template<typename T> struct CallGraphPropertyAnalysis {
void propagateBack(std::function<bool(const T&)> hasProperty,
std::function<bool(const T&)> canHaveProperty,
std::function<void(T&, Function*)> addProperty,
- IndirectCalls indirectCalls) {
+ NonDirectCalls nonDirectCalls) {
// The work queue contains items we just learned can change the state.
UniqueDeferredQueue<Function*> work;
for (auto& func : wasm.functions) {
if (hasProperty(map[func.get()]) ||
- (indirectCalls == IndirectCallsHaveProperty &&
- map[func.get()].hasIndirectCall)) {
+ (nonDirectCalls == NonDirectCallsHaveProperty &&
+ map[func.get()].hasNonDirectCall)) {
addProperty(map[func.get()], func.get());
work.push(func.get());
}