[PATCH] D70199: [Bug 43235] libLLVMObject.so.10svn fails to link error: undefined reference to 'llvm::raw_string_ostream::current_pos() const'

Joao Paulo Labegalini de Carvalho via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 13 12:08:17 PST 2019


jaopaulolc created this revision.
jaopaulolc added a project: LLVM.
Herald added subscribers: llvm-commits, hiraditya.

libLLVMObject.so.10svn fails to link due to undefined references to 'llvm::raw_string_ostream::current_pos() const'.

Managed to fix this by moving its definition from include/llvm/Support/raw_ostream.h to lib/Support/raw_ostream.cpp.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D70199

Files:
  llvm/include/llvm/Support/raw_ostream.h
  llvm/lib/Support/raw_ostream.cpp


Index: llvm/lib/Support/raw_ostream.cpp
===================================================================
--- llvm/lib/Support/raw_ostream.cpp
+++ llvm/lib/Support/raw_ostream.cpp
@@ -895,6 +895,10 @@
 //  raw_string_ostream
 //===----------------------------------------------------------------------===//
 
+/// Return the current position within the stream, not counting the bytes
+/// currently in the buffer.
+uint64_t raw_string_ostream::current_pos() const { return OS.size(); }
+
 raw_string_ostream::~raw_string_ostream() {
   flush();
 }
Index: llvm/include/llvm/Support/raw_ostream.h
===================================================================
--- llvm/include/llvm/Support/raw_ostream.h
+++ llvm/include/llvm/Support/raw_ostream.h
@@ -507,9 +507,7 @@
   /// See raw_ostream::write_impl.
   void write_impl(const char *Ptr, size_t Size) override;
 
-  /// Return the current position within the stream, not counting the bytes
-  /// currently in the buffer.
-  uint64_t current_pos() const override { return OS.size(); }
+  uint64_t current_pos() const override;
 
 public:
   explicit raw_string_ostream(std::string &O) : OS(O) {}


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D70199.229142.patch
Type: text/x-patch
Size: 1153 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191113/24a42cca/attachment.bin>


More information about the llvm-commits mailing list