[PATCH] D123436: [Clang] Use std::move in GlobalModuleIndex::readIndex. NFC

David Blaikie via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 27 09:13:44 PDT 2022

dblaikie added a comment.

In D123436#3475858 <https://reviews.llvm.org/D123436#3475858>, @junaire wrote:

> In D123436#3475002 <https://reviews.llvm.org/D123436#3475002>, @dblaikie wrote:
>> In D123436#3462567 <https://reviews.llvm.org/D123436#3462567>, @dblaikie wrote:
>>> Perhaps GlobalModuleIndex should create the cursor itself - it's being handed the buffer anyway?
>> Ping on this ^ - would this be a better direction that addresses the concerns?
> Sorry about missing this! :(
> However, I'm not sure that I understand your idea. Do you mean we can simply pass the buffer to the `GlobalModuleIndex` then we can construct the cursor in the constructor itself?

That's what I meant, yeah - since the buffer is actually already being passed.

> IMHO, we can't. that's because we need to use the cursor to sniff for the signature of the buffer, and we will return an error if it is failed. Please let me know if I understand you wrong :)

Ah, right ,I missed that usage before the call. Makes sense then - thanks for helping me understand!

  rG LLVM Github Monorepo



More information about the cfe-commits mailing list