Skip to content

Commit 90a9f65

Browse files
committed
Update LLVM
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.
1 parent 5e720aa commit 90a9f65

File tree

4 files changed

+18
-6
lines changed

4 files changed

+18
-6
lines changed

src/librustc/middle/trans/intrinsic.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -235,11 +235,15 @@ pub fn trans_intrinsic(ccx: &CrateContext,
235235
lib::llvm::SequentiallyConsistent =>
236236
lib::llvm::SequentiallyConsistent,
237237
};
238-
let old = AtomicCmpXchg(bcx, get_param(decl, first_real_arg),
238+
let res = AtomicCmpXchg(bcx, get_param(decl, first_real_arg),
239239
get_param(decl, first_real_arg + 1u),
240240
get_param(decl, first_real_arg + 2u),
241241
order, strongest_failure_ordering);
242-
Ret(bcx, old);
242+
if unsafe { lib::llvm::llvm::LLVMVersionMinor() >= 5 } {
243+
Ret(bcx, ExtractValue(bcx, res, 0));
244+
} else {
245+
Ret(bcx, res);
246+
}
243247
}
244248
"load" => {
245249
let old = AtomicLoad(bcx, get_param(decl, first_real_arg),

src/llvm

Submodule llvm updated 2239 files

src/rustllvm/RustWrapper.cpp

+10-2
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,7 @@ LLVMRustLinkInExternalBitcode(LLVMModuleRef dst, char *bc, size_t len) {
659659
extern "C" void*
660660
LLVMRustOpenArchive(char *path) {
661661
std::unique_ptr<MemoryBuffer> buf;
662-
error_code err = MemoryBuffer::getFile(path, buf);
662+
std::error_code err = MemoryBuffer::getFile(path, buf);
663663
if (err) {
664664
LLVMRustSetLastError(err.message().c_str());
665665
return NULL;
@@ -694,14 +694,18 @@ LLVMRustArchiveReadSection(Archive *ar, char *name, size_t *size) {
694694
#if LLVM_VERSION_MINOR >= 5
695695
Archive::child_iterator child = ar->child_begin(),
696696
end = ar->child_end();
697+
for (; child != end; ++child) {
698+
ErrorOr<StringRef> name_or_err = child->getName();
699+
if (name_or_err.getError()) continue;
700+
StringRef sect_name = name_or_err.get();
697701
#else
698702
Archive::child_iterator child = ar->begin_children(),
699703
end = ar->end_children();
700-
#endif
701704
for (; child != end; ++child) {
702705
StringRef sect_name;
703706
error_code err = child->getName(sect_name);
704707
if (err) continue;
708+
#endif
705709
if (sect_name.trim(" ") == name) {
706710
StringRef buf = child->getBuffer();
707711
*size = buf.size();
@@ -757,7 +761,11 @@ inline section_iterator *unwrap(LLVMSectionIteratorRef SI) {
757761
extern "C" int
758762
LLVMRustGetSectionName(LLVMSectionIteratorRef SI, const char **ptr) {
759763
StringRef ret;
764+
#if LLVM_VERSION_MINOR >= 5
765+
if (std::error_code ec = (*unwrap(SI))->getName(ret))
766+
#else
760767
if (error_code ec = (*unwrap(SI))->getName(ret))
768+
#endif
761769
report_fatal_error(ec.message());
762770
*ptr = ret.data();
763771
return ret.size();

src/rustllvm/llvm-auto-clean-trigger

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# If this file is modified, then llvm will be forcibly cleaned and then rebuilt.
22
# The actual contents of this file do not matter, but to trigger a change on the
33
# build bots then the contents should be changed so git updates the mtime.
4-
2014-05-20
4+
2014-06-20.2

0 commit comments

Comments
 (0)