Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rustc: Upgrade to LLVM 6 #47828

Merged
merged 1 commit into from
Feb 10, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/bootstrap/native.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ impl Step for Llvm {
}

// http://llvm.org/docs/HowToCrossCompileLLVM.html
if target != build.build {
if target != build.build && !emscripten {
builder.ensure(Llvm {
target: build.build,
emscripten: false,
Expand Down
2 changes: 1 addition & 1 deletion src/ci/docker/dist-i686-freebsd/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:16.04
FROM ubuntu:18.04

RUN apt-get update && apt-get install -y --no-install-recommends \
clang \
Expand Down
2 changes: 1 addition & 1 deletion src/dlmalloc
Submodule dlmalloc updated 2 files
+1 −1 src/dlmalloc.rs
+7 −10 src/wasm.rs
2 changes: 1 addition & 1 deletion src/libcompiler_builtins
7 changes: 5 additions & 2 deletions src/librustc_resolve/resolve_imports.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1026,9 +1026,12 @@ fn import_path_to_string(names: &[SpannedIdent],
if names.is_empty() {
import_directive_subclass_to_string(subclass)
} else {
(format!("{}::{}",
let x = format!("{}::{}",
names_to_string(names),
import_directive_subclass_to_string(subclass)))
import_directive_subclass_to_string(subclass));
assert!(!names.is_empty());
assert!(!x.starts_with("::"));
return x
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/llvm
Submodule llvm updated 14843 files
2 changes: 2 additions & 0 deletions src/rustllvm/RustWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -552,9 +552,11 @@ static unsigned fromRust(LLVMRustDIFlags Flags) {
if (isSet(Flags & LLVMRustDIFlags::FlagRValueReference)) {
Result |= DINode::DIFlags::FlagRValueReference;
}
#if LLVM_VERSION_LE(4, 0)
if (isSet(Flags & LLVMRustDIFlags::FlagExternalTypeRef)) {
Result |= DINode::DIFlags::FlagExternalTypeRef;
}
#endif
if (isSet(Flags & LLVMRustDIFlags::FlagIntroducedVirtual)) {
Result |= DINode::DIFlags::FlagIntroducedVirtual;
}
Expand Down
2 changes: 1 addition & 1 deletion src/rustllvm/llvm-rebuild-trigger
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# If this file is modified, then llvm will be (optionally) 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.
2018-01-25
2018-02-09
34 changes: 28 additions & 6 deletions src/test/run-pass/backtrace-debuginfo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,14 @@
// Unfortunately, LLVM has no "disable" option for this, so we have to set
// "enable" to 0 instead.

// compile-flags:-g -Cllvm-args=-enable-tail-merge=0
// compile-flags:-g -Cllvm-args=-enable-tail-merge=0 -Cllvm-args=-opt-bisect-limit=0
// ignore-pretty issue #37195
// ignore-cloudabi spawning processes is not supported
// ignore-emscripten spawning processes is not supported

// note that above `-opt-bisect-limit=0` is used to basically disable
// optimizations

use std::env;

#[path = "backtrace-debuginfo-aux.rs"] mod aux;
Expand Down Expand Up @@ -114,25 +117,34 @@ fn outer(mut counter: i32, main_pos: Pos) {
inner_inlined(&mut counter, main_pos, pos!());
}

fn check_trace(output: &str, error: &str) {
fn check_trace(output: &str, error: &str) -> Result<(), String> {
// reverse the position list so we can start with the last item (which was the first line)
let mut remaining: Vec<&str> = output.lines().map(|s| s.trim()).rev().collect();

assert!(error.contains("stack backtrace"), "no backtrace in the error: {}", error);
if !error.contains("stack backtrace") {
return Err(format!("no backtrace found in stderr:\n{}", error))
}
for line in error.lines() {
if !remaining.is_empty() && line.contains(remaining.last().unwrap()) {
remaining.pop();
}
}
assert!(remaining.is_empty(),
"trace does not match position list: {}\n---\n{}", error, output);
if !remaining.is_empty() {
return Err(format!("trace does not match position list\n\
still need to find {:?}\n\n\
--- stdout\n{}\n\
--- stderr\n{}",
remaining, output, error))
}
Ok(())
}

fn run_test(me: &str) {
use std::str;
use std::process::Command;

let mut i = 0;
let mut errors = Vec::new();
loop {
let out = Command::new(me)
.env("RUST_BACKTRACE", "full")
Expand All @@ -143,10 +155,20 @@ fn run_test(me: &str) {
assert!(output.contains("done."), "bad output for successful run: {}", output);
break;
} else {
check_trace(output, error);
if let Err(e) = check_trace(output, error) {
errors.push(e);
}
}
i += 1;
}
if errors.len() > 0 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think clippy would say to use !errors.is_empty() ;-)

for error in errors {
println!("---------------------------------------");
println!("{}", error);
}

panic!("found some errors");
}
}

#[inline(never)]
Expand Down