junaire created this revision. junaire added reviewers: aaron.ballman, RKSimon, dblaikie. Herald added a subscriber: arphaman. Herald added a project: All. junaire requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits.
BitstreamCursors are heavy-weight objects that should not be passed by value. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D123436 Files: clang/include/clang/Serialization/GlobalModuleIndex.h clang/lib/Serialization/GlobalModuleIndex.cpp Index: clang/lib/Serialization/GlobalModuleIndex.cpp =================================================================== --- clang/lib/Serialization/GlobalModuleIndex.cpp +++ clang/lib/Serialization/GlobalModuleIndex.cpp @@ -127,7 +127,7 @@ GlobalModuleIndex::GlobalModuleIndex( std::unique_ptr<llvm::MemoryBuffer> IndexBuffer, - llvm::BitstreamCursor Cursor) + llvm::BitstreamCursor &Cursor) : Buffer(std::move(IndexBuffer)), IdentifierIndex(), NumIdentifierLookups(), NumIdentifierLookupHits() { auto Fail = [&](llvm::Error &&Err) { Index: clang/include/clang/Serialization/GlobalModuleIndex.h =================================================================== --- clang/include/clang/Serialization/GlobalModuleIndex.h +++ clang/include/clang/Serialization/GlobalModuleIndex.h @@ -113,7 +113,7 @@ /// Internal constructor. Use \c readIndex() to read an index. explicit GlobalModuleIndex(std::unique_ptr<llvm::MemoryBuffer> Buffer, - llvm::BitstreamCursor Cursor); + llvm::BitstreamCursor &Cursor); GlobalModuleIndex(const GlobalModuleIndex &) = delete; GlobalModuleIndex &operator=(const GlobalModuleIndex &) = delete;
Index: clang/lib/Serialization/GlobalModuleIndex.cpp =================================================================== --- clang/lib/Serialization/GlobalModuleIndex.cpp +++ clang/lib/Serialization/GlobalModuleIndex.cpp @@ -127,7 +127,7 @@ GlobalModuleIndex::GlobalModuleIndex( std::unique_ptr<llvm::MemoryBuffer> IndexBuffer, - llvm::BitstreamCursor Cursor) + llvm::BitstreamCursor &Cursor) : Buffer(std::move(IndexBuffer)), IdentifierIndex(), NumIdentifierLookups(), NumIdentifierLookupHits() { auto Fail = [&](llvm::Error &&Err) { Index: clang/include/clang/Serialization/GlobalModuleIndex.h =================================================================== --- clang/include/clang/Serialization/GlobalModuleIndex.h +++ clang/include/clang/Serialization/GlobalModuleIndex.h @@ -113,7 +113,7 @@ /// Internal constructor. Use \c readIndex() to read an index. explicit GlobalModuleIndex(std::unique_ptr<llvm::MemoryBuffer> Buffer, - llvm::BitstreamCursor Cursor); + llvm::BitstreamCursor &Cursor); GlobalModuleIndex(const GlobalModuleIndex &) = delete; GlobalModuleIndex &operator=(const GlobalModuleIndex &) = delete;
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits