[PATCH] D43853: [WebAssembly] Fix variable name and refactor. NFC.

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 27 19:10:41 PST 2018


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

[WebAssembly] Fix variable name and refactor. NFC.


https://reviews.llvm.org/D43853

Files:
  lld/wasm/OutputSections.cpp


Index: lld/wasm/OutputSections.cpp
===================================================================
--- lld/wasm/OutputSections.cpp
+++ lld/wasm/OutputSections.cpp
@@ -55,11 +55,11 @@
   }
 }
 
-std::string lld::toString(const OutputSection &Section) {
-  std::string rtn = Section.getSectionName();
-  if (!Section.Name.empty())
-    rtn += "(" + Section.Name + ")";
-  return rtn;
+// Returns a string, e.g. "FUNCTION(.text)".
+std::string lld::toString(const OutputSection &Sec) {
+  if (!Sec.Name.empty())
+    return Sec.getSectionName() + "(" + Sec.Name + ")";
+  return Sec.getSectionName();
 }
 
 std::string OutputSection::getSectionName() const {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D43853.136217.patch
Type: text/x-patch
Size: 660 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180228/25e3d59e/attachment.bin>


More information about the llvm-commits mailing list