summaryrefslogtreecommitdiff
path: root/src/passes/passes.h
diff options
context:
space:
mode:
authorThomas Lively <tlively@google.com>2024-08-21 15:05:22 -0700
committerGitHub <noreply@github.com>2024-08-21 15:05:22 -0700
commit692e55c14bd3055b1aae49681bb8e62c757c678d (patch)
tree1b25a10166b1cd2dea159f3f59e02dde361a7636 /src/passes/passes.h
parent99db0d9c7c33bcea7b7730bb5684f41176146f83 (diff)
downloadbinaryen-692e55c14bd3055b1aae49681bb8e62c757c678d.tar.gz
binaryen-692e55c14bd3055b1aae49681bb8e62c757c678d.tar.bz2
binaryen-692e55c14bd3055b1aae49681bb8e62c757c678d.zip
Add a string lowering mode disallowing non-UTF-8 strings (#6861)
The best way to lower strings is via the "magic imports" API that uses the names of imported string globals as their values. This approach only works for valid UTF-8 strings, though. The existing string-lowering-magic-imports pass falls back to putting non-UTF-8 strings in a JSON custom section, but this requires the runtime to support that custom section for correctness. To help catch errors early when runtimes do not support the strings custom section, add a new pass that uses magic imports and raises an error if there are any invalid strings.
Diffstat (limited to 'src/passes/passes.h')
-rw-r--r--src/passes/passes.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/passes/passes.h b/src/passes/passes.h
index 9fcb5f95f..a95365676 100644
--- a/src/passes/passes.h
+++ b/src/passes/passes.h
@@ -158,6 +158,7 @@ Pass* createStackCheckPass();
Pass* createStringGatheringPass();
Pass* createStringLoweringPass();
Pass* createStringLoweringMagicImportPass();
+Pass* createStringLoweringMagicImportAssertPass();
Pass* createStripDebugPass();
Pass* createStripDWARFPass();
Pass* createStripProducersPass();