[PATCH] D115911: [InstrProf] Fix build error in Correlator class

Ellis Hoag via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 16 15:54:43 PST 2021


ellis created this revision.
Herald added subscribers: pengfei, hiraditya.
ellis requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

For some reason this did not fail to compile for me locally, but did
fail on one of the builders. Here is the error:

https://lab.llvm.org/buildbot/#/builders/58/builds/14969

  /home/buildbot/as-builder-4/lld-x86_64-ubuntu-fast/llvm-project/llvm/lib/ProfileData/InstrProfCorrelator.cpp: In static member function ‘static llvm::Expected<std::unique_ptr<llvm::InstrProfCorrelator::Context> > llvm::InstrProfCorrelator::Context::get(std::unique_ptr<llvm::MemoryBuffer>, const llvm::object::ObjectFile&)’:
  /home/buildbot/as-builder-4/lld-x86_64-ubuntu-fast/llvm-project/llvm/lib/ProfileData/InstrProfCorrelator.cpp:44:10: error: could not convert ‘C’ from ‘std::unique_ptr<llvm::InstrProfCorrelator::Context>’ to ‘llvm::Expected<std::unique_ptr<llvm::InstrProfCorrelator::Context> >’
     return C;


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D115911

Files:
  llvm/lib/ProfileData/InstrProfCorrelator.cpp


Index: llvm/lib/ProfileData/InstrProfCorrelator.cpp
===================================================================
--- llvm/lib/ProfileData/InstrProfCorrelator.cpp
+++ llvm/lib/ProfileData/InstrProfCorrelator.cpp
@@ -41,7 +41,7 @@
   C->CountersSectionStart = CountersSection->getAddress();
   C->CountersSectionEnd = C->CountersSectionStart + CountersSection->getSize();
   C->ShouldSwapBytes = Obj.isLittleEndian() != sys::IsLittleEndianHost;
-  return C;
+  return Expected<std::unique_ptr<Context>>(std::move(C));
 }
 
 llvm::Expected<std::unique_ptr<InstrProfCorrelator>>


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D115911.395021.patch
Type: text/x-patch
Size: 582 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211216/ca5fa5de/attachment.bin>


More information about the llvm-commits mailing list