[PATCH] D43720: [WebAssembly] Do not use default argument.

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 23 21:15:19 PST 2018


ruiu created this revision.
ruiu added a reviewer: sbc100.
Herald added subscribers: sunfish, aheejin, jgravelle-google, dschuff, jfb.

I don't think blank name is an appropriate default, but is this code
correct in the first place? Don't Code and data segments have name
in WebAssembly?


https://reviews.llvm.org/D43720

Files:
  lld/wasm/OutputSections.cpp
  lld/wasm/OutputSections.h


Index: lld/wasm/OutputSections.h
===================================================================
--- lld/wasm/OutputSections.h
+++ lld/wasm/OutputSections.h
@@ -31,8 +31,7 @@
 
 class OutputSection {
 public:
-  OutputSection(uint32_t Type, std::string Name = "")
-      : Type(Type), Name(Name) {}
+  OutputSection(uint32_t Type, std::string Name) : Type(Type), Name(Name) {}
   virtual ~OutputSection() = default;
 
   std::string getSectionName() const;
Index: lld/wasm/OutputSections.cpp
===================================================================
--- lld/wasm/OutputSections.cpp
+++ lld/wasm/OutputSections.cpp
@@ -77,7 +77,7 @@
 }
 
 CodeSection::CodeSection(ArrayRef<InputFunction *> Functions)
-    : OutputSection(WASM_SEC_CODE), Functions(Functions) {
+    : OutputSection(WASM_SEC_CODE, ""), Functions(Functions) {
   assert(Functions.size() > 0);
 
   raw_string_ostream OS(CodeSectionHeader);
@@ -129,7 +129,7 @@
 }
 
 DataSection::DataSection(ArrayRef<OutputSegment *> Segments)
-    : OutputSection(WASM_SEC_DATA), Segments(Segments) {
+    : OutputSection(WASM_SEC_DATA, ""), Segments(Segments) {
   raw_string_ostream OS(DataSectionHeader);
 
   writeUleb128(OS, Segments.size(), "data segment count");


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D43720.135777.patch
Type: text/x-patch
Size: 1232 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180224/2259d2c9/attachment.bin>


More information about the llvm-commits mailing list