[lld] [lld][WebAssembly] Add `--max-memory-growth` (PR #82890)

via llvm-commits llvm-commits at lists.llvm.org
Sat Feb 24 09:11:29 PST 2024


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff 07fd5ca3a8bd270b26b21ea28501f5edcb519709 3b115d2d04336f7b5da5d825a3c9d042f2a21f45 -- lld/wasm/Config.h lld/wasm/Driver.cpp lld/wasm/Writer.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/lld/wasm/Writer.cpp b/lld/wasm/Writer.cpp
index 0aded3c5bb..261d633f11 100644
--- a/lld/wasm/Writer.cpp
+++ b/lld/wasm/Writer.cpp
@@ -480,8 +480,10 @@ void Writer::layoutMemory() {
 
   uint64_t maxMemory = 0;
   if (config->maxMemoryGrowth != -1) {
-    if (config->maxMemoryGrowth != alignTo(config->maxMemoryGrowth, WasmPageSize))
-      error("maximum memory growth must be " + Twine(WasmPageSize) + "-byte aligned");
+    if (config->maxMemoryGrowth !=
+        alignTo(config->maxMemoryGrowth, WasmPageSize))
+      error("maximum memory growth must be " + Twine(WasmPageSize) +
+            "-byte aligned");
     uint64_t maxMaxMemoryGrowth = maxMemorySetting - memoryPtr;
     if (config->maxMemoryGrowth > maxMaxMemoryGrowth)
       error("maximum memory growth too large, cannot be greater than " +

``````````

</details>


https://github.com/llvm/llvm-project/pull/82890


More information about the llvm-commits mailing list