[PATCH] D62838: [Object] add isExecutableObject member function
Alex Brachet via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 17 11:40:06 PDT 2019
abrachet marked an inline comment as done.
abrachet added inline comments.
================
Comment at: llvm/unittests/Object/ObjectFileTest.cpp:83
+ ASSERT_TRUE(!!ObjFileOrErr) << "invalid object file format";
+ ObjPtr = std::move(ObjFileOrErr.get());
+}
----------------
rupprecht wrote:
> This should just be returned, i.e. the method should have a signature:
>
> ```
> template <typename HeaderType>
> std::unique_ptr<ObjectFile> createObjectFile(const HeaderType &Header, file_magic Magic = file_magic::unknown)
> ```
>
> (+1 to using the name suggestion from James)
If I returned the unique_ptr then I couldn’t have the ASSERT_TRUE which returns void on error. I would like to keep it, but it isn’t totally necessary I suppose.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D62838/new/
https://reviews.llvm.org/D62838
More information about the llvm-commits
mailing list