]> git.lizzy.rs Git - rust.git/commitdiff
Update LLVM
authorBjörn Steinbrink <bsteinbr@gmail.com>
Tue, 17 Jun 2014 16:34:50 +0000 (18:34 +0200)
committerBjörn Steinbrink <bsteinbr@gmail.com>
Sat, 21 Jun 2014 17:59:58 +0000 (19:59 +0200)
To fix #8106, we need an LLVM version that contains r211082 aka 0dee6756
which fixes a bug that blocks that issue.

There have been some tiny API changes in LLVM, and cmpxchg changed its
return type. The i1 part of the new return type is only interesting when
using the new weak cmpxchg, which we don't do.

src/librustc/middle/trans/intrinsic.rs
src/llvm
src/rustllvm/RustWrapper.cpp
src/rustllvm/llvm-auto-clean-trigger

index 648a2c335e6860f0121e49840b5272e37953c1bf..7624a71c9dd35ca9a629eed3a1a568414b23ff8c 100644 (file)
@@ -235,11 +235,15 @@ fn count_zeros_intrinsic(bcx: &Block, name: &'static str) {
                     lib::llvm::SequentiallyConsistent =>
                         lib::llvm::SequentiallyConsistent,
                 };
-                let old = AtomicCmpXchg(bcx, get_param(decl, first_real_arg),
+                let res = AtomicCmpXchg(bcx, get_param(decl, first_real_arg),
                                         get_param(decl, first_real_arg + 1u),
                                         get_param(decl, first_real_arg + 2u),
                                         order, strongest_failure_ordering);
-                Ret(bcx, old);
+                if unsafe { lib::llvm::llvm::LLVMVersionMinor() >= 5 } {
+                    Ret(bcx, ExtractValue(bcx, res, 0));
+                } else {
+                    Ret(bcx, res);
+                }
             }
             "load" => {
                 let old = AtomicLoad(bcx, get_param(decl, first_real_arg),
index 0a894645cf120539876e9eb4eb0d7b572dfa9d14..1bba09755d95892bc826c558630e93803b0a4ee6 160000 (submodule)
--- a/src/llvm
+++ b/src/llvm
@@ -1 +1 @@
-Subproject commit 0a894645cf120539876e9eb4eb0d7b572dfa9d14
+Subproject commit 1bba09755d95892bc826c558630e93803b0a4ee6
index f42844b9f19d2612e3b7873ab5a344b62556e6c4..a1a88d1b14d45d8a9d97cce938dc4ceff0497de1 100644 (file)
@@ -659,7 +659,7 @@ LLVMRustLinkInExternalBitcode(LLVMModuleRef dst, char *bc, size_t len) {
 extern "C" void*
 LLVMRustOpenArchive(char *path) {
     std::unique_ptr<MemoryBuffer> buf;
-    error_code err = MemoryBuffer::getFile(path, buf);
+    std::error_code err = MemoryBuffer::getFile(path, buf);
     if (err) {
         LLVMRustSetLastError(err.message().c_str());
         return NULL;
@@ -694,14 +694,18 @@ LLVMRustArchiveReadSection(Archive *ar, char *name, size_t *size) {
 #if LLVM_VERSION_MINOR >= 5
     Archive::child_iterator child = ar->child_begin(),
                               end = ar->child_end();
+    for (; child != end; ++child) {
+        ErrorOr<StringRef> name_or_err = child->getName();
+        if (name_or_err.getError()) continue;
+        StringRef sect_name = name_or_err.get();
 #else
     Archive::child_iterator child = ar->begin_children(),
                               end = ar->end_children();
-#endif
     for (; child != end; ++child) {
         StringRef sect_name;
         error_code err = child->getName(sect_name);
         if (err) continue;
+#endif
         if (sect_name.trim(" ") == name) {
             StringRef buf = child->getBuffer();
             *size = buf.size();
@@ -757,7 +761,11 @@ inline section_iterator *unwrap(LLVMSectionIteratorRef SI) {
 extern "C" int
 LLVMRustGetSectionName(LLVMSectionIteratorRef SI, const char **ptr) {
     StringRef ret;
+#if LLVM_VERSION_MINOR >= 5
+    if (std::error_code ec = (*unwrap(SI))->getName(ret))
+#else
     if (error_code ec = (*unwrap(SI))->getName(ret))
+#endif
       report_fatal_error(ec.message());
     *ptr = ret.data();
     return ret.size();
index 4e599ad115db36dc9e66602a112073caae7ce50d..1bd3434b46eca59bdeae275dcb79edef06acdf67 100644 (file)
@@ -1,4 +1,4 @@
 # If this file is modified, then llvm will be forcibly cleaned and then rebuilt.
 # The actual contents of this file do not matter, but to trigger a change on the
 # build bots then the contents should be changed so git updates the mtime.
-2014-05-20
+2014-06-20.2