[PATCH] D53963: [WebAssembly] Remove duplicate function. NFC.

Sam Clegg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 31 17:52:05 PDT 2018


sbc100 created this revision.
Herald added subscribers: llvm-commits, dexonsmith, steven_wu, sunfish, aheejin, jgravelle-google, mehdi_amini, dschuff.

Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D53963

Files:
  test/wasm/lto/signature-mismatch.ll
  test/wasm/signature-mismatch-weak.ll
  test/wasm/signature-mismatch.ll
  wasm/WriterUtils.cpp


Index: wasm/WriterUtils.cpp
===================================================================
--- wasm/WriterUtils.cpp
+++ wasm/WriterUtils.cpp
@@ -19,21 +19,6 @@
 using namespace llvm::wasm;
 using namespace lld::wasm;
 
-static const char *valueTypeToString(ValType Type) {
-  switch (Type) {
-  case wasm::ValType::I32:
-    return "i32";
-  case wasm::ValType::I64:
-    return "i64";
-  case wasm::ValType::F32:
-    return "f32";
-  case wasm::ValType::F64:
-    return "f64";
-  default:
-    llvm_unreachable("invalid value type");
-  }
-}
-
 namespace lld {
 
 void wasm::debugWrite(uint64_t Offset, const Twine &Msg) {
@@ -75,7 +60,7 @@
 
 void wasm::writeValueType(raw_ostream &OS, ValType Type, const Twine &Msg) {
   writeU8(OS, static_cast<uint8_t>(Type),
-          Msg + "[type: " + valueTypeToString(Type) + "]");
+          Msg + "[type: " + toString(Type) + "]");
 }
 
 void wasm::writeSig(raw_ostream &OS, const WasmSignature &Sig) {
@@ -178,15 +163,15 @@
 std::string lld::toString(ValType Type) {
   switch (Type) {
   case ValType::I32:
-    return "I32";
+    return "i32";
   case ValType::I64:
-    return "I64";
+    return "i64";
   case ValType::F32:
-    return "F32";
+    return "f32";
   case ValType::F64:
-    return "F64";
+    return "f64";
   case ValType::V128:
-    return "V128";
+    return "v128";
   case ValType::EXCEPT_REF:
     return "except_ref";
   }
Index: test/wasm/signature-mismatch.ll
===================================================================
--- test/wasm/signature-mismatch.ll
+++ test/wasm/signature-mismatch.ll
@@ -18,9 +18,9 @@
 declare i32 @ret32(i32, i64, i32) local_unnamed_addr #1
 
 ; CHECK: error: function signature mismatch: ret32
-; CHECK-NEXT: >>> defined as (I32, I64, I32) -> I32 in {{.*}}.main.o
-; CHECK-NEXT: >>> defined as (F32) -> I32 in {{.*}}.ret32.o
+; CHECK-NEXT: >>> defined as (i32, i64, i32) -> i32 in {{.*}}.main.o
+; CHECK-NEXT: >>> defined as (f32) -> i32 in {{.*}}.ret32.o
 
 ; REVERSE: error: function signature mismatch: ret32
-; REVERSE-NEXT: >>> defined as (F32) -> I32 in {{.*}}.ret32.o
-; REVERSE-NEXT: >>> defined as (I32, I64, I32) -> I32 in {{.*}}.main.o
+; REVERSE-NEXT: >>> defined as (f32) -> i32 in {{.*}}.ret32.o
+; REVERSE-NEXT: >>> defined as (i32, i64, i32) -> i32 in {{.*}}.main.o
Index: test/wasm/signature-mismatch-weak.ll
===================================================================
--- test/wasm/signature-mismatch-weak.ll
+++ test/wasm/signature-mismatch-weak.ll
@@ -14,5 +14,5 @@
 }
 
 ; CHECK: warning: function signature mismatch: weakFn
-; CHECK-NEXT: >>> defined as () -> I32 in {{.*}}signature-mismatch-weak.ll.tmp.o
-; CHECK-NEXT: >>> defined as () -> I64 in {{.*}}signature-mismatch-weak.ll.tmp.strong.o
+; CHECK-NEXT: >>> defined as () -> i32 in {{.*}}signature-mismatch-weak.ll.tmp.o
+; CHECK-NEXT: >>> defined as () -> i64 in {{.*}}signature-mismatch-weak.ll.tmp.strong.o
Index: test/wasm/lto/signature-mismatch.ll
===================================================================
--- test/wasm/lto/signature-mismatch.ll
+++ test/wasm/lto/signature-mismatch.ll
@@ -15,5 +15,5 @@
   ret void
 }
 
-; CHECK: >>> defined as (I32) -> void in {{.*}}signature-mismatch.ll.tmp1.o
+; CHECK: >>> defined as (i32) -> void in {{.*}}signature-mismatch.ll.tmp1.o
 ; CHECK: >>> defined as () -> void in lto.tmp


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D53963.172071.patch
Type: text/x-patch
Size: 3340 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181101/4fdd159b/attachment.bin>


More information about the llvm-commits mailing list