1
Fork 0

trans: Upgrade LLVM

This brings some routine upgrades to the bundled LLVM that we're using, the most
notable of which is a bug fix to the way we handle range asserts when loading
the discriminant of an enum. This fix ended up being very similar to f9d4149c
where we basically can't have a range assert when loading a discriminant due to
filling drop, and appropriate flags were added to communicate this to
`trans::adt`.
This commit is contained in:
Alex Crichton 2015-10-22 22:07:19 -07:00
parent 142214d1f2
commit d1cace17af
17 changed files with 123 additions and 43 deletions

View file

@ -24,7 +24,13 @@ struct LLVMRustArchiveMember {
const char *name;
Archive::Child child;
LLVMRustArchiveMember(): filename(NULL), name(NULL), child(NULL, NULL) {}
LLVMRustArchiveMember(): filename(NULL), name(NULL),
#if LLVM_VERSION_MINOR >= 8
child(NULL, NULL, NULL)
#else
child(NULL, NULL)
#endif
{}
~LLVMRustArchiveMember() {}
};
@ -92,8 +98,18 @@ extern "C" const Archive::Child*
LLVMRustArchiveIteratorNext(RustArchiveIterator *rai) {
if (rai->cur == rai->end)
return NULL;
const Archive::Child *cur = rai->cur.operator->();
Archive::Child *ret = new Archive::Child(*cur);
#if LLVM_VERSION_MINOR >= 8
const ErrorOr<Archive::Child>* cur = rai->cur.operator->();
if (!*cur) {
LLVMRustSetLastError(cur->getError().message().c_str());
return NULL;
}
const Archive::Child &child = cur->get();
#else
const Archive::Child &child = *rai->cur.operator->();
#endif
Archive::Child *ret = new Archive::Child(child);
++rai->cur;
return ret;
}