[lld] r346249 - [WebAssembly] Address review comments from r346248 [NFC]

Derek Schuff via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 6 10:02:39 PST 2018


Author: dschuff
Date: Tue Nov  6 10:02:39 2018
New Revision: 346249

URL: http://llvm.org/viewvc/llvm-project?rev=346249&view=rev
Log:
[WebAssembly] Address review comments from r346248 [NFC]

Modified:
    lld/trunk/wasm/Writer.cpp

Modified: lld/trunk/wasm/Writer.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/wasm/Writer.cpp?rev=346249&r1=346248&r2=346249&view=diff
==============================================================================
--- lld/trunk/wasm/Writer.cpp (original)
+++ lld/trunk/wasm/Writer.cpp Tue Nov  6 10:02:39 2018
@@ -155,9 +155,8 @@ void Writer::createImportSection() {
       Import.Memory.Flags |= WASM_LIMITS_FLAG_HAS_MAX;
       Import.Memory.Maximum = MaxMemoryPages;
     }
-    if (Config->SharedMemory) {
+    if (Config->SharedMemory)
       Import.Memory.Flags |= WASM_LIMITS_FLAG_IS_SHARED;
-    }
     writeImport(OS, Import);
   }
 
@@ -217,7 +216,9 @@ void Writer::createMemorySection() {
 
   bool HasMax = MaxMemoryPages != 0;
   writeUleb128(OS, 1, "memory count");
-  unsigned Flags = HasMax ? static_cast<unsigned>(WASM_LIMITS_FLAG_HAS_MAX) : 0;
+  unsigned Flags = 0;
+  if (HasMax)
+    Flags |= WASM_LIMITS_FLAG_HAS_MAX;
   if (Config->SharedMemory)
     Flags |= WASM_LIMITS_FLAG_IS_SHARED;
   writeUleb128(OS, Flags, "memory limits flags");




More information about the llvm-commits mailing list