[PATCH] D146841: [WebAssembly] Use ArrayRef/SmallVectorImpl in parameters (NFC)

Heejin Ahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 29 12:48:40 PDT 2023


This revision was automatically updated to reflect the committed changes.
Closed by commit rGcfd36aa5b773: [WebAssembly] Use ArrayRef/SmallVectorImpl in parameters (NFC) (authored by aheejin).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D146841/new/

https://reviews.llvm.org/D146841

Files:
  llvm/lib/Target/WebAssembly/AsmParser/WebAssemblyAsmTypeCheck.cpp
  llvm/lib/Target/WebAssembly/AsmParser/WebAssemblyAsmTypeCheck.h
  llvm/lib/Target/WebAssembly/Utils/WebAssemblyTypeUtilities.cpp
  llvm/lib/Target/WebAssembly/Utils/WebAssemblyTypeUtilities.h
  llvm/lib/Target/WebAssembly/WebAssemblyMCInstLower.cpp
  llvm/lib/Target/WebAssembly/WebAssemblyMCInstLower.h


Index: llvm/lib/Target/WebAssembly/WebAssemblyMCInstLower.h
===================================================================
--- llvm/lib/Target/WebAssembly/WebAssemblyMCInstLower.h
+++ llvm/lib/Target/WebAssembly/WebAssemblyMCInstLower.h
@@ -34,8 +34,8 @@
   MCSymbol *GetGlobalAddressSymbol(const MachineOperand &MO) const;
   MCSymbol *GetExternalSymbolSymbol(const MachineOperand &MO) const;
   MCOperand lowerSymbolOperand(const MachineOperand &MO, MCSymbol *Sym) const;
-  MCOperand lowerTypeIndexOperand(SmallVector<wasm::ValType, 1> &&,
-                                  SmallVector<wasm::ValType, 4> &&) const;
+  MCOperand lowerTypeIndexOperand(SmallVectorImpl<wasm::ValType> &&,
+                                  SmallVectorImpl<wasm::ValType> &&) const;
 
 public:
   WebAssemblyMCInstLower(MCContext &ctx, WebAssemblyAsmPrinter &printer)
Index: llvm/lib/Target/WebAssembly/WebAssemblyMCInstLower.cpp
===================================================================
--- llvm/lib/Target/WebAssembly/WebAssemblyMCInstLower.cpp
+++ llvm/lib/Target/WebAssembly/WebAssemblyMCInstLower.cpp
@@ -140,8 +140,8 @@
 }
 
 MCOperand WebAssemblyMCInstLower::lowerTypeIndexOperand(
-    SmallVector<wasm::ValType, 1> &&Returns,
-    SmallVector<wasm::ValType, 4> &&Params) const {
+    SmallVectorImpl<wasm::ValType> &&Returns,
+    SmallVectorImpl<wasm::ValType> &&Params) const {
   auto Signature = std::make_unique<wasm::WasmSignature>(std::move(Returns),
                                                          std::move(Params));
   MCSymbol *Sym = Printer.createTempSymbol("typeindex");
Index: llvm/lib/Target/WebAssembly/Utils/WebAssemblyTypeUtilities.h
===================================================================
--- llvm/lib/Target/WebAssembly/Utils/WebAssemblyTypeUtilities.h
+++ llvm/lib/Target/WebAssembly/Utils/WebAssemblyTypeUtilities.h
@@ -76,7 +76,7 @@
 
 /// Sets a Wasm Symbol Type.
 void wasmSymbolSetType(MCSymbolWasm *Sym, const Type *GlobalVT,
-                       const SmallVector<MVT, 1> &VTs);
+                       const ArrayRef<MVT> &VTs);
 
 } // end namespace WebAssembly
 } // end namespace llvm
Index: llvm/lib/Target/WebAssembly/Utils/WebAssemblyTypeUtilities.cpp
===================================================================
--- llvm/lib/Target/WebAssembly/Utils/WebAssemblyTypeUtilities.cpp
+++ llvm/lib/Target/WebAssembly/Utils/WebAssemblyTypeUtilities.cpp
@@ -69,7 +69,7 @@
 }
 
 void WebAssembly::wasmSymbolSetType(MCSymbolWasm *Sym, const Type *GlobalVT,
-                                    const SmallVector<MVT, 1> &VTs) {
+                                    const ArrayRef<MVT> &VTs) {
   assert(!Sym->getType());
 
   // Tables are represented as Arrays in LLVM IR therefore
Index: llvm/lib/Target/WebAssembly/AsmParser/WebAssemblyAsmTypeCheck.h
===================================================================
--- llvm/lib/Target/WebAssembly/AsmParser/WebAssemblyAsmTypeCheck.h
+++ llvm/lib/Target/WebAssembly/AsmParser/WebAssemblyAsmTypeCheck.h
@@ -52,7 +52,7 @@
   WebAssemblyAsmTypeCheck(MCAsmParser &Parser, const MCInstrInfo &MII, bool is64);
 
   void funcDecl(const wasm::WasmSignature &Sig);
-  void localDecl(const SmallVector<wasm::ValType, 4> &Locals);
+  void localDecl(const SmallVectorImpl<wasm::ValType> &Locals);
   void setLastSig(const wasm::WasmSignature &Sig) { LastSig = Sig; }
   bool endOfFunction(SMLoc ErrorLoc);
   bool typeCheck(SMLoc ErrorLoc, const MCInst &Inst, OperandVector &Operands);
Index: llvm/lib/Target/WebAssembly/AsmParser/WebAssemblyAsmTypeCheck.cpp
===================================================================
--- llvm/lib/Target/WebAssembly/AsmParser/WebAssemblyAsmTypeCheck.cpp
+++ llvm/lib/Target/WebAssembly/AsmParser/WebAssemblyAsmTypeCheck.cpp
@@ -53,7 +53,8 @@
   ReturnTypes.assign(Sig.Returns.begin(), Sig.Returns.end());
 }
 
-void WebAssemblyAsmTypeCheck::localDecl(const SmallVector<wasm::ValType, 4> &Locals) {
+void WebAssemblyAsmTypeCheck::localDecl(
+    const SmallVectorImpl<wasm::ValType> &Locals) {
   LocalTypes.insert(LocalTypes.end(), Locals.begin(), Locals.end());
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D146841.509446.patch
Type: text/x-patch
Size: 4120 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230329/5ced54b7/attachment.bin>


More information about the llvm-commits mailing list