Restore the ability to check if LLVMCreateObjectFile was successful
authorBjorn Steinbrink <bsteinbr@gmail.com>
Fri, 5 Sep 2014 21:22:09 +0000 (21:22 +0000)
committerBjorn Steinbrink <bsteinbr@gmail.com>
Fri, 5 Sep 2014 21:22:09 +0000 (21:22 +0000)
commitea388503c47ba1af00b0ab2d4f5d8ae2fcbef727
treea3cd0c3bb491b5e1d40c0ec53b16fb773f1355e7
parent2d1c2853e137fb65fb6babf6c914c862fbd60b1b
Restore the ability to check if LLVMCreateObjectFile was successful

Summary:
Until r216870 LLVMCreateObjectFile returned nullptr in case of an error,
so callers could check if the call was successful. Now, it always
returns an OwningBinary wrapped as an LLVMObjectFileRef, so callers
can't check if the call was successul.

This results in a segfault running e.g.

 llvm-c-test --object-list-sections < /dev/null

So the old behaviour should be restored.

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D5143

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217279 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Object/Object.cpp
test/Bindings/llvm-c/objectfile.ll [new file with mode: 0644]