[Lldb-commits] [PATCH] D147669: PECOFF: enforce move semantics and consume errors properly

Stefan Gränitz via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Apr 6 15:30:22 PDT 2023


sgraenitz requested changes to this revision.
sgraenitz added a comment.
This revision now requires changes to proceed.

First of all, yes the existing code is incorrect. Thanks for looking into this. However, I am afraid this isn't the right solution.

In the `if` body you can not `std::move()` from `err` twice. I guess we have to do something like:

  if (log)
    LLDB_LOG(...)
  else
    consumeError(...)



> which resulted in a check failure under LLVM_ENABLE_ABI_BREAKING_CHANGES

You probably mean `LLVM_ENABLE_ABI_BREAKING_CHECKS`? For `Error` this enables logic to make sure the error was checked: https://github.com/llvm/llvm-project/blob/release/16.x/llvm/include/llvm/Support/Error.h#L724 I think your observation is a side effect of the issue you look at and has nothing to do with compiler optimizations like NRVO. If logging is off, the error isn't consumed.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D147669



More information about the lldb-commits mailing list