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),
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;
#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();
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();
# 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