From 8cd935f52a9af8620f608e1baad94282f038a864 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Mon, 27 Jan 2014 12:45:48 -0800 Subject: Upgrade LLVM This upgrade brings commit by @eddyb to help optimizations of virtual calls in a few places (https://github.com/llvm-mirror/llvm/commit/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! --- src/rustllvm/RustWrapper.cpp | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'src/rustllvm/RustWrapper.cpp') diff --git a/src/rustllvm/RustWrapper.cpp b/src/rustllvm/RustWrapper.cpp index 280df8cb10f..9b077e2254e 100644 --- a/src/rustllvm/RustWrapper.cpp +++ b/src/rustllvm/RustWrapper.cpp @@ -537,15 +537,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 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; } @@ -570,8 +570,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); @@ -589,3 +589,9 @@ extern "C" void LLVMRustDestroyArchive(Archive *ar) { delete ar; } + +extern "C" void +LLVMRustSetDLLExportStorageClass(LLVMValueRef Value) { + GlobalValue *V = unwrap(Value); + V->setDLLStorageClass(GlobalValue::DLLExportStorageClass); +} -- cgit 1.4.1-3-g733a5