OSDN Git Service

[NFC] WebAssembly build break #2
authorJF Bastien <jfb@google.com>
Wed, 16 May 2018 22:31:42 +0000 (22:31 +0000)
committerJF Bastien <jfb@google.com>
Wed, 16 May 2018 22:31:42 +0000 (22:31 +0000)
Summary:
Same as r332530, move WasmSymbol::dump to an implementation file to avoid linker
issues when the dump function is seen in the header, doesn't get eliminated, and
then linking fails because of the missing dependency.

<rdar://problem/40258137>

Reviewers: sbc100, ncw, paquette, vsk, dschuff

Subscribers: jgravelle-google, aheejin, sunfish, llvm-commits

Differential Revision: https://reviews.llvm.org/D46985

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332542 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Object/Wasm.h
lib/Object/WasmObjectFile.cpp

index c9e630b..566a254 100644 (file)
@@ -91,7 +91,7 @@ public:
   void print(raw_ostream &Out) const;
 
 #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
-  LLVM_DUMP_METHOD void dump() const { print(dbgs()); }
+  LLVM_DUMP_METHOD void dump() const;
 #endif
 };
 
index 388e049..f6e2d92 100644 (file)
@@ -48,6 +48,10 @@ void WasmSymbol::print(raw_ostream &Out) const {
   }
 }
 
+#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
+LLVM_DUMP_METHOD void WasmSymbol::dump() const { print(dbgs()); }
+#endif
+
 Expected<std::unique_ptr<WasmObjectFile>>
 ObjectFile::createWasmObjectFile(MemoryBufferRef Buffer) {
   Error Err = Error::success();