[PATCH] D55347: [WebAssembly] Make variable names consistent in TargetStreamer (NFC)

Heejin Ahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 5 16:53:02 PST 2018


aheejin created this revision.
aheejin added a reviewer: aardappel.
Herald added subscribers: llvm-commits, sunfish, jgravelle-google, sbc100, dschuff.

Currently for arguments of `MCWasmSymbol*` type, both names `Sym` and
`Symbol` are being used in the same file. Unified them with `Sym`.


Repository:
  rL LLVM

https://reviews.llvm.org/D55347

Files:
  lib/Target/WebAssembly/MCTargetDesc/WebAssemblyTargetStreamer.cpp
  lib/Target/WebAssembly/MCTargetDesc/WebAssemblyTargetStreamer.h


Index: lib/Target/WebAssembly/MCTargetDesc/WebAssemblyTargetStreamer.h
===================================================================
--- lib/Target/WebAssembly/MCTargetDesc/WebAssemblyTargetStreamer.h
+++ lib/Target/WebAssembly/MCTargetDesc/WebAssemblyTargetStreamer.h
@@ -36,7 +36,7 @@
   /// .endfunc
   virtual void emitEndFunc() = 0;
   /// .functype
-  virtual void emitFunctionType(MCSymbolWasm *Symbol) = 0;
+  virtual void emitFunctionType(MCSymbolWasm *Sym) = 0;
   /// .indidx
   virtual void emitIndIdx(const MCExpr *Value) = 0;
   /// .globaltype
@@ -59,7 +59,7 @@
 
   void emitLocal(ArrayRef<wasm::ValType> Types) override;
   void emitEndFunc() override;
-  void emitFunctionType(MCSymbolWasm *Symbol) override;
+  void emitFunctionType(MCSymbolWasm *Sym) override;
   void emitIndIdx(const MCExpr *Value) override;
   void emitGlobalType(MCSymbolWasm *Sym) override;
   void emitEventType(MCSymbolWasm *Sym) override;
@@ -73,7 +73,7 @@
 
   void emitLocal(ArrayRef<wasm::ValType> Types) override;
   void emitEndFunc() override;
-  void emitFunctionType(MCSymbolWasm *Symbol) override;
+  void emitFunctionType(MCSymbolWasm *Sym) override;
   void emitIndIdx(const MCExpr *Value) override;
   void emitGlobalType(MCSymbolWasm *Sym) override;
   void emitEventType(MCSymbolWasm *Sym) override;
Index: lib/Target/WebAssembly/MCTargetDesc/WebAssemblyTargetStreamer.cpp
===================================================================
--- lib/Target/WebAssembly/MCTargetDesc/WebAssemblyTargetStreamer.cpp
+++ lib/Target/WebAssembly/MCTargetDesc/WebAssemblyTargetStreamer.cpp
@@ -60,15 +60,15 @@
 
 void WebAssemblyTargetAsmStreamer::emitEndFunc() { OS << "\t.endfunc\n"; }
 
-void WebAssemblyTargetAsmStreamer::emitFunctionType(MCSymbolWasm *Symbol) {
-  OS << "\t.functype\t" << Symbol->getName() << " (";
-  auto &Params = Symbol->getSignature()->Params;
+void WebAssemblyTargetAsmStreamer::emitFunctionType(MCSymbolWasm *Sym) {
+  OS << "\t.functype\t" << Sym->getName() << " (";
+  auto &Params = Sym->getSignature()->Params;
   for (auto &Ty : Params) {
     if (&Ty != &Params[0]) OS << ", ";
     OS << WebAssembly::TypeToString(Ty);
   }
   OS << ") -> (";
-  auto &Returns = Symbol->getSignature()->Returns;
+  auto &Returns = Sym->getSignature()->Returns;
   for (auto &Ty : Returns) {
     if (&Ty != &Returns[0]) OS << ", ";
     OS << WebAssembly::TypeToString(Ty);
@@ -132,9 +132,9 @@
   llvm_unreachable(".indidx encoding not yet implemented");
 }
 
-void WebAssemblyTargetWasmStreamer::emitFunctionType(MCSymbolWasm *Symbol) {
+void WebAssemblyTargetWasmStreamer::emitFunctionType(MCSymbolWasm *Sym) {
   // Symbol already has its arguments and result set.
-  Symbol->setType(wasm::WASM_SYMBOL_TYPE_FUNCTION);
+  Sym->setType(wasm::WASM_SYMBOL_TYPE_FUNCTION);
 }
 
 void WebAssemblyTargetWasmStreamer::emitGlobalType(MCSymbolWasm *Sym) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D55347.176905.patch
Type: text/x-patch
Size: 2875 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181206/ce9c28ae/attachment.bin>


More information about the llvm-commits mailing list