Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[LLVM-3.9] Use old way of getting next child
This was changed back in
rust-lang/llvm@aacf2fbf
  • Loading branch information
badboy committed Jul 29, 2016
1 parent d0e5aa4 commit f439aee
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/rustllvm/ArchiveWrapper.cpp
Expand Up @@ -79,7 +79,12 @@ extern "C" RustArchiveIterator*
LLVMRustArchiveIteratorNew(RustArchive *ra) {
Archive *ar = ra->getBinary();
RustArchiveIterator *rai = new RustArchiveIterator();
#if LLVM_VERSION_MINOR >= 9
Error err;
rai->cur = ar->child_begin(err);
#else
rai->cur = ar->child_begin();
#endif
rai->end = ar->child_end();
return rai;
}
Expand All @@ -88,8 +93,8 @@ extern "C" const Archive::Child*
LLVMRustArchiveIteratorNext(RustArchiveIterator *rai) {
if (rai->cur == rai->end)
return NULL;
#if LLVM_VERSION_MINOR >= 8
const ErrorOr<Archive::Child>* cur = rai->cur.operator->();
#if LLVM_VERSION_MINOR == 8
Archive::Child* cur = rai->cur.operator->();
if (!*cur) {
LLVMRustSetLastError(cur->getError().message().c_str());
return NULL;
Expand Down

0 comments on commit f439aee

Please sign in to comment.