On Sun, Aug 17, 2014 at 4:25 PM, David Blaikie <[email protected]> wrote:
> On Sun, Aug 17, 2014 at 3:20 PM, Rafael Espindola > <[email protected]> wrote: > > Author: rafael > > Date: Sun Aug 17 17:20:41 2014 > > New Revision: 215856 > > > > URL: http://llvm.org/viewvc/llvm-project?rev=215856&view=rev > > Log: > > Update for llvm api changes. > > > > Modified: > > cfe/trunk/lib/ARCMigrate/ObjCMT.cpp > > cfe/trunk/lib/Basic/VirtualFileSystem.cpp > > > > Modified: cfe/trunk/lib/ARCMigrate/ObjCMT.cpp > > URL: > http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/ARCMigrate/ObjCMT.cpp?rev=215856&r1=215855&r2=215856&view=diff > > > ============================================================================== > > --- cfe/trunk/lib/ARCMigrate/ObjCMT.cpp (original) > > +++ cfe/trunk/lib/ARCMigrate/ObjCMT.cpp Sun Aug 17 17:20:41 2014 > > @@ -1939,7 +1939,7 @@ public: > > return true; > > > > llvm::SourceMgr SM; > > - Stream YAMLStream(FileBufOrErr.get().release(), SM); > > + Stream YAMLStream(std::move(FileBufOrErr.get()), SM); > > Thought: this is actually one place where I more strongly prefer using > the pointer-like API of ErrorOr. Seeing "move(x.get())" makes me > twitch and think "is that moving a raw pointer? some mistake where the > user was trying to indicate transfer of ownership from a unique_ptr > and clearly failing". Whereas move(*x) seems clear/sort of better. > > Not an ironclad argument - but just a thought I've been pondering. > I agree. Generally I imagine this would apply for anything (that is not smart pointer-like) with a .get(). As a side note, given this .get() potential for confusion, is there a reason ErrorOr has both .get() and operator*? -- Sean Silva > > > document_iterator I = YAMLStream.begin(); > > if (I == YAMLStream.end()) > > return true; > > > > Modified: cfe/trunk/lib/Basic/VirtualFileSystem.cpp > > URL: > http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/VirtualFileSystem.cpp?rev=215856&r1=215855&r2=215856&view=diff > > > ============================================================================== > > --- cfe/trunk/lib/Basic/VirtualFileSystem.cpp (original) > > +++ cfe/trunk/lib/Basic/VirtualFileSystem.cpp Sun Aug 17 17:20:41 2014 > > @@ -869,7 +869,7 @@ VFSFromYAML *VFSFromYAML::create(std::un > > IntrusiveRefCntPtr<FileSystem> > ExternalFS) { > > > > SourceMgr SM; > > - yaml::Stream Stream(Buffer.release(), SM); > > + yaml::Stream Stream(std::move(Buffer), SM); > > > > SM.setDiagHandler(DiagHandler, DiagContext); > > yaml::document_iterator DI = Stream.begin(); > > > > > > _______________________________________________ > > cfe-commits mailing list > > [email protected] > > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits > _______________________________________________ > cfe-commits mailing list > [email protected] > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits >
_______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
