Skip to content

Commit

Permalink
Update LLVM
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dotdash committed Jun 21, 2014
1 parent 5e720aa commit 90a9f65
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 6 deletions.
8 changes: 6 additions & 2 deletions src/librustc/middle/trans/intrinsic.rs
Expand Up @@ -235,11 +235,15 @@ pub fn trans_intrinsic(ccx: &CrateContext,
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),
Expand Down
2 changes: 1 addition & 1 deletion src/llvm
Submodule llvm updated 2239 files
12 changes: 10 additions & 2 deletions src/rustllvm/RustWrapper.cpp
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion src/rustllvm/llvm-auto-clean-trigger
@@ -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

0 comments on commit 90a9f65

Please sign in to comment.