r215856 - Update for llvm api changes.

David Blaikie dblaikie at gmail.com
Sun Aug 17 16:25:19 PDT 2014


On Sun, Aug 17, 2014 at 3:20 PM, Rafael Espindola
<rafael.espindola at gmail.com> 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.

>      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
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits



More information about the cfe-commits mailing list