diff options
| author | bors <bors@rust-lang.org> | 2014-01-29 23:46:26 -0800 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-01-29 23:46:26 -0800 |
| commit | e3b1f3c443c048913e2d573fcc5a9c2be3484a78 (patch) | |
| tree | 36925f01ccfcbb10a8a7738b27de7c545740e65d /src/rustllvm/RustWrapper.cpp | |
| parent | 056363ff362231c6e78543290bbc5c151b899f3d (diff) | |
| parent | 8cd935f52a9af8620f608e1baad94282f038a864 (diff) | |
| download | rust-e3b1f3c443c048913e2d573fcc5a9c2be3484a78.tar.gz rust-e3b1f3c443c048913e2d573fcc5a9c2be3484a78.zip | |
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 (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!
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
| -rw-r--r-- | src/rustllvm/RustWrapper.cpp | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/src/rustllvm/RustWrapper.cpp b/src/rustllvm/RustWrapper.cpp index 2107f7c39a2..75e0375b13e 100644 --- a/src/rustllvm/RustWrapper.cpp +++ b/src/rustllvm/RustWrapper.cpp @@ -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); +} |
