about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2014-01-27 12:45:48 -0800
committerAlex Crichton <alex@alexcrichton.com>2014-01-29 23:43:39 -0800
commit8cd935f52a9af8620f608e1baad94282f038a864 (patch)
tree37c3a6ba8a08532e4d23c1d6987af072d98d1b65 /src/rustllvm/RustWrapper.cpp
parentd6d7812da841ddedf6c765eebb655be9866956ce (diff)
downloadrust-8cd935f52a9af8620f608e1baad94282f038a864.tar.gz
rust-8cd935f52a9af8620f608e1baad94282f038a864.zip
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!
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
-rw-r--r--src/rustllvm/RustWrapper.cpp20
1 files changed, 13 insertions, 7 deletions
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<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;
     }
@@ -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<GlobalValue>(Value);
+    V->setDLLStorageClass(GlobalValue::DLLExportStorageClass);
+}