From c06b2925232b92fd379a3e8d513ab361b8434a15 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Mon, 11 Oct 2021 17:37:34 -0700 Subject: Add runOnModuleCode helper. NFC (#4234) This method is in parallel to runOnFunction above it. It sets the runner and then does the walk, like that method. Also set runner to nullptr by default. I noticed ubsan was warning on things here, which this should avoid, but otherwise I'm not aware of an actual bug, so this should be NFC. But it does provide a safer API that should avoid future bugs. --- src/passes/ConstantFieldPropagation.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/passes/ConstantFieldPropagation.cpp') diff --git a/src/passes/ConstantFieldPropagation.cpp b/src/passes/ConstantFieldPropagation.cpp index 0894a822a..2fdd8333c 100644 --- a/src/passes/ConstantFieldPropagation.cpp +++ b/src/passes/ConstantFieldPropagation.cpp @@ -274,7 +274,7 @@ struct ConstantFieldPropagation : public Pass { functionSetInfos(*module); PCVScanner scanner(functionNewInfos, functionSetInfos); scanner.run(runner, module); - scanner.walkModuleCode(module); + scanner.runOnModuleCode(runner, module); // Combine the data from the functions. PCVStructValuesMap combinedNewInfos, combinedSetInfos; -- cgit v1.2.3