[WebAssembly] Address review comments from r346248 [NFC]
authorDerek Schuff <dschuff@google.com>
Tue, 6 Nov 2018 18:02:39 +0000 (18:02 +0000)
committerDerek Schuff <dschuff@google.com>
Tue, 6 Nov 2018 18:02:39 +0000 (18:02 +0000)
llvm-svn: 346249

lld/wasm/Writer.cpp

index 53b9ff5b4ba4f2185c8dc79c321c8f164e6de0b2..c26ae53311b5d5a93ca855a0d89c34a0eb44ecf5 100644 (file)
@@ -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");