1
Fork 0

auto merge of #11853 : alexcrichton/rust/up-llvm, r=brson

This upgrade brings commit by @eddyb to help optimizations of virtual calls in
a few places (6d2bd95) as well as a
commit by @c-a to *greatly* improve the runtime of the optimization passes
(https://github.com/rust-lang/llvm/pull/3).

Nice work to these guys!
This commit is contained in:
bors 2014-01-29 23:46:26 -08:00
commit e3b1f3c443
8 changed files with 26 additions and 16 deletions

View file

@ -545,15 +545,15 @@ extern "C" bool
LLVMRustLinkInExternalBitcode(LLVMModuleRef dst, char *bc, size_t len) {
Module *Dst = unwrap(dst);
MemoryBuffer* buf = MemoryBuffer::getMemBufferCopy(StringRef(bc, len));
std::string Err;
Module *Src = llvm::getLazyBitcodeModule(buf, Dst->getContext(), &Err);
if (Src == NULL) {
LLVMRustError = Err.c_str();
ErrorOr<Module *> Src = llvm::getLazyBitcodeModule(buf, Dst->getContext());
if (!Src) {
LLVMRustError = Src.getError().message().c_str();
delete buf;
return false;
}
if (Linker::LinkModules(Dst, Src, Linker::DestroySource, &Err)) {
std::string Err;
if (Linker::LinkModules(Dst, *Src, Linker::DestroySource, &Err)) {
LLVMRustError = Err.c_str();
return false;
}
@ -578,8 +578,8 @@ LLVMRustOpenArchive(char *path) {
extern "C" const char*
LLVMRustArchiveReadSection(Archive *ar, char *name, size_t *size) {
for (Archive::child_iterator child = ar->begin_children(),
end = ar->end_children();
for (Archive::child_iterator child = ar->child_begin(),
end = ar->child_end();
child != end; ++child) {
StringRef sect_name;
error_code err = child->getName(sect_name);
@ -597,3 +597,9 @@ extern "C" void
LLVMRustDestroyArchive(Archive *ar) {
delete ar;
}
extern "C" void
LLVMRustSetDLLExportStorageClass(LLVMValueRef Value) {
GlobalValue *V = unwrap<GlobalValue>(Value);
V->setDLLStorageClass(GlobalValue::DLLExportStorageClass);
}