Skip to content

Commit a574387

Browse files
committed
---
yaml --- r: 271735 b: refs/heads/master c: 70b8b94 h: refs/heads/master i: 271733: 4efe0d9 271731: 308bc32 271727: 284d825
1 parent 3a8758a commit a574387

File tree

33 files changed

+239
-146
lines changed

33 files changed

+239
-146
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 5b08ab50f783bc8e52655f05c98f4da19881d7f3
2+
refs/heads/master: 70b8b9487a94c5b9b1401007b040c584d9349582
33
refs/heads/snap-stage3: 235d77457d80b549dad3ac36d94f235208a1eafb
44
refs/heads/try: 49312a405e14a449b98fe0056b12a40ac128be4a
55
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105

trunk/configure

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1252,7 +1252,7 @@ $ pacman -R cmake && pacman -S mingw-w64-x86_64-cmake
12521252
bits=x86_64
12531253
msvc_part=amd64
12541254
;;
1255-
i686-*)
1255+
i*86-*)
12561256
bits=i386
12571257
msvc_part=
12581258
;;

trunk/mk/crates.mk

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,12 @@ TARGET_CRATES := libc std term \
5353
getopts collections test rand \
5454
core alloc \
5555
rustc_unicode rustc_bitflags \
56-
alloc_system alloc_jemalloc rustc_const_eval
56+
alloc_system alloc_jemalloc
5757
RUSTC_CRATES := rustc rustc_typeck rustc_mir rustc_borrowck rustc_resolve rustc_driver \
5858
rustc_trans rustc_back rustc_llvm rustc_privacy rustc_lint \
5959
rustc_data_structures rustc_front rustc_platform_intrinsics \
60-
rustc_plugin rustc_metadata rustc_passes rustc_save_analysis
60+
rustc_plugin rustc_metadata rustc_passes rustc_save_analysis \
61+
rustc_const_eval
6162
HOST_CRATES := syntax syntax_ext $(RUSTC_CRATES) rustdoc fmt_macros \
6263
flate arena graphviz rbml log serialize
6364
TOOLS := compiletest rustdoc rustc rustbook error_index_generator
@@ -94,9 +95,9 @@ DEPS_syntax_ext := syntax fmt_macros
9495
DEPS_rustc_const_eval := std syntax
9596

9697
DEPS_rustc := syntax fmt_macros flate arena serialize getopts rbml rustc_front\
97-
log graphviz rustc_llvm rustc_back rustc_data_structures\
98+
log graphviz rustc_back rustc_data_structures\
9899
rustc_const_eval
99-
DEPS_rustc_back := std syntax rustc_llvm rustc_front flate log libc
100+
DEPS_rustc_back := std syntax rustc_front flate log libc
100101
DEPS_rustc_borrowck := rustc rustc_front rustc_mir log graphviz syntax
101102
DEPS_rustc_data_structures := std log serialize
102103
DEPS_rustc_driver := arena flate getopts graphviz libc rustc rustc_back rustc_borrowck \
@@ -110,7 +111,7 @@ DEPS_rustc_metadata := rustc rustc_front syntax rbml rustc_const_eval
110111
DEPS_rustc_passes := syntax rustc core rustc_front
111112
DEPS_rustc_mir := rustc rustc_front syntax rustc_const_eval
112113
DEPS_rustc_resolve := arena rustc rustc_front log syntax
113-
DEPS_rustc_platform_intrinsics := rustc rustc_llvm
114+
DEPS_rustc_platform_intrinsics := std
114115
DEPS_rustc_plugin := rustc rustc_metadata syntax rustc_mir
115116
DEPS_rustc_privacy := rustc rustc_front log syntax
116117
DEPS_rustc_trans := arena flate getopts graphviz libc rustc rustc_back rustc_mir \

trunk/mk/main.mk

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ endif
493493
LD_LIBRARY_PATH_ENV_HOSTDIR$(1)_T_$(2)_H_$(3) := \
494494
$$(CURDIR)/$$(HLIB$(1)_H_$(3)):$$(CFG_LLVM_INST_DIR_$(3))/lib
495495
LD_LIBRARY_PATH_ENV_TARGETDIR$(1)_T_$(2)_H_$(3) := \
496-
$$(CURDIR)/$$(TLIB$(1)_T_$(2)_H_$(CFG_BUILD))
496+
$$(CURDIR)/$$(TLIB$(1)_T_$(2)_H_$(3))
497497

498498
HOST_RPATH_VAR$(1)_T_$(2)_H_$(3) := \
499499
$$(LD_LIBRARY_PATH_ENV_NAME$(1)_T_$(2)_H_$(3))=$$(LD_LIBRARY_PATH_ENV_HOSTDIR$(1)_T_$(2)_H_$(3)):$$$$$$(LD_LIBRARY_PATH_ENV_NAME$(1)_T_$(2)_H_$(3))
@@ -506,18 +506,14 @@ RPATH_VAR$(1)_T_$(2)_H_$(3) := $$(HOST_RPATH_VAR$(1)_T_$(2)_H_$(3))
506506
# if you're building a cross config, the host->* parts are
507507
# effectively stage1, since it uses the just-built stage0.
508508
#
509-
# This logic is similar to how the LD_LIBRARY_PATH variable must
510-
# change be slightly different when doing cross compilations.
511-
# The build doesn't copy over all target libraries into
512-
# a new directory, so we need to point the library path at
513-
# the build directory where all the target libraries came
514-
# from (the stage0 build host). Otherwise the relative rpaths
515-
# inside of the rustc binary won't get resolved correctly.
509+
# Also be sure to use the right rpath because we're loading libraries from the
510+
# CFG_BUILD's stage1 directory for our target, so switch this one instance of
511+
# `RPATH_VAR` to get the bootstrap working.
516512
ifeq ($(1),0)
517513
ifneq ($(strip $(CFG_BUILD)),$(strip $(3)))
518514
CFGFLAG$(1)_T_$(2)_H_$(3) = stage1
519515

520-
RPATH_VAR$(1)_T_$(2)_H_$(3) := $$(TARGET_RPATH_VAR$(1)_T_$(2)_H_$(3))
516+
RPATH_VAR$(1)_T_$(2)_H_$(3) := $$(TARGET_RPATH_VAR1_T_$(2)_H_$$(CFG_BUILD))
521517
endif
522518
endif
523519

trunk/mk/rt.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,11 +236,11 @@ COMPRT_LIB_$(1) := $$(RT_OUTPUT_DIR_$(1))/$$(COMPRT_NAME_$(1))
236236
COMPRT_BUILD_DIR_$(1) := $$(RT_OUTPUT_DIR_$(1))/compiler-rt
237237

238238
ifeq ($$(findstring msvc,$(1)),msvc)
239-
$$(COMPRT_LIB_$(1)): $$(COMPRT_DEPS) $$(MKFILE_DEPS) $$(LLVM_CONFIG_$(1))
239+
$$(COMPRT_LIB_$(1)): $$(COMPRT_DEPS) $$(MKFILE_DEPS) $$(LLVM_CONFIG_$$(CFG_BUILD))
240240
@$$(call E, cmake: compiler-rt)
241241
$$(Q)cd "$$(COMPRT_BUILD_DIR_$(1))"; $$(CFG_CMAKE) "$(S)src/compiler-rt" \
242242
-DCMAKE_BUILD_TYPE=$$(LLVM_BUILD_CONFIG_MODE) \
243-
-DLLVM_CONFIG_PATH=$$(LLVM_CONFIG_$(1)) \
243+
-DLLVM_CONFIG_PATH=$$(LLVM_CONFIG_$$(CFG_BUILD)) \
244244
-G"$$(CFG_CMAKE_GENERATOR)"
245245
$$(Q)$$(CFG_CMAKE) --build "$$(COMPRT_BUILD_DIR_$(1))" \
246246
--target lib/builtins/builtins \

trunk/src/etc/platform-intrinsics/generator.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -759,12 +759,11 @@ def open(self, platform):
759759
760760
use {{Intrinsic, Type}};
761761
use IntrinsicDef::Named;
762-
use rustc::middle::ty::TyCtxt;
763762
764763
// The default inlining settings trigger a pathological behaviour in
765764
// LLVM, which causes makes compilation very slow. See #28273.
766765
#[inline(never)]
767-
pub fn find<'tcx>(_tcx: &TyCtxt<'tcx>, name: &str) -> Option<Intrinsic> {{
766+
pub fn find(name: &str) -> Option<Intrinsic> {{
768767
if !name.starts_with("{0}") {{ return None }}
769768
Some(match &name["{0}".len()..] {{'''.format(platform.intrinsic_prefix())
770769

trunk/src/librustc/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,5 @@ rustc_bitflags = { path = "../librustc_bitflags" }
2121
rustc_const_eval = { path = "../librustc_const_eval" }
2222
rustc_data_structures = { path = "../librustc_data_structures" }
2323
rustc_front = { path = "../librustc_front" }
24-
rustc_llvm = { path = "../librustc_llvm" }
2524
serialize = { path = "../libserialize" }
2625
syntax = { path = "../libsyntax" }

trunk/src/librustc/infer/mod.rs

Lines changed: 22 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -386,33 +386,6 @@ pub fn normalizing_infer_ctxt<'a, 'tcx>(tcx: &'a TyCtxt<'tcx>,
386386
infcx
387387
}
388388

389-
/// Computes the least upper-bound of `a` and `b`. If this is not possible, reports an error and
390-
/// returns ty::err.
391-
pub fn common_supertype<'a, 'tcx>(cx: &InferCtxt<'a, 'tcx>,
392-
origin: TypeOrigin,
393-
a_is_expected: bool,
394-
a: Ty<'tcx>,
395-
b: Ty<'tcx>)
396-
-> Ty<'tcx>
397-
{
398-
debug!("common_supertype({:?}, {:?})",
399-
a, b);
400-
401-
let trace = TypeTrace {
402-
origin: origin,
403-
values: Types(expected_found(a_is_expected, a, b))
404-
};
405-
406-
let result = cx.commit_if_ok(|_| cx.lub(a_is_expected, trace.clone()).relate(&a, &b));
407-
match result {
408-
Ok(t) => t,
409-
Err(ref err) => {
410-
cx.report_and_explain_type_error(trace, err).emit();
411-
cx.tcx.types.err
412-
}
413-
}
414-
}
415-
416389
pub fn mk_subty<'a, 'tcx>(cx: &InferCtxt<'a, 'tcx>,
417390
a_is_expected: bool,
418391
origin: TypeOrigin,
@@ -434,7 +407,7 @@ pub fn can_mk_subty<'a, 'tcx>(cx: &InferCtxt<'a, 'tcx>,
434407
origin: TypeOrigin::Misc(codemap::DUMMY_SP),
435408
values: Types(expected_found(true, a, b))
436409
};
437-
cx.sub(true, trace).relate(&a, &b).map(|_| ())
410+
cx.sub(true, trace, &a, &b).map(|_| ())
438411
})
439412
}
440413

@@ -695,32 +668,32 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
695668
cause: None}
696669
}
697670

698-
// public so that it can be used from the rustc_driver unit tests
699-
pub fn equate(&'a self, a_is_expected: bool, trace: TypeTrace<'tcx>)
700-
-> equate::Equate<'a, 'tcx>
671+
pub fn equate<T>(&'a self, a_is_expected: bool, trace: TypeTrace<'tcx>, a: &T, b: &T)
672+
-> RelateResult<'tcx, T>
673+
where T: Relate<'a, 'tcx>
701674
{
702-
self.combine_fields(a_is_expected, trace).equate()
675+
self.combine_fields(a_is_expected, trace).equate().relate(a, b)
703676
}
704677

705-
// public so that it can be used from the rustc_driver unit tests
706-
pub fn sub(&'a self, a_is_expected: bool, trace: TypeTrace<'tcx>)
707-
-> sub::Sub<'a, 'tcx>
678+
pub fn sub<T>(&'a self, a_is_expected: bool, trace: TypeTrace<'tcx>, a: &T, b: &T)
679+
-> RelateResult<'tcx, T>
680+
where T: Relate<'a, 'tcx>
708681
{
709-
self.combine_fields(a_is_expected, trace).sub()
682+
self.combine_fields(a_is_expected, trace).sub().relate(a, b)
710683
}
711684

712-
// public so that it can be used from the rustc_driver unit tests
713-
pub fn lub(&'a self, a_is_expected: bool, trace: TypeTrace<'tcx>)
714-
-> lub::Lub<'a, 'tcx>
685+
pub fn lub<T>(&'a self, a_is_expected: bool, trace: TypeTrace<'tcx>, a: &T, b: &T)
686+
-> RelateResult<'tcx, T>
687+
where T: Relate<'a, 'tcx>
715688
{
716-
self.combine_fields(a_is_expected, trace).lub()
689+
self.combine_fields(a_is_expected, trace).lub().relate(a, b)
717690
}
718691

719-
// public so that it can be used from the rustc_driver unit tests
720-
pub fn glb(&'a self, a_is_expected: bool, trace: TypeTrace<'tcx>)
721-
-> glb::Glb<'a, 'tcx>
692+
pub fn glb<T>(&'a self, a_is_expected: bool, trace: TypeTrace<'tcx>, a: &T, b: &T)
693+
-> RelateResult<'tcx, T>
694+
where T: Relate<'a, 'tcx>
722695
{
723-
self.combine_fields(a_is_expected, trace).glb()
696+
self.combine_fields(a_is_expected, trace).glb().relate(a, b)
724697
}
725698

726699
fn start_snapshot(&self) -> CombinedSnapshot {
@@ -861,7 +834,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
861834
debug!("sub_types({:?} <: {:?})", a, b);
862835
self.commit_if_ok(|_| {
863836
let trace = TypeTrace::types(origin, a_is_expected, a, b);
864-
self.sub(a_is_expected, trace).relate(&a, &b).map(|_| ())
837+
self.sub(a_is_expected, trace, &a, &b).map(|_| ())
865838
})
866839
}
867840

@@ -874,7 +847,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
874847
{
875848
self.commit_if_ok(|_| {
876849
let trace = TypeTrace::types(origin, a_is_expected, a, b);
877-
self.equate(a_is_expected, trace).relate(&a, &b).map(|_| ())
850+
self.equate(a_is_expected, trace, &a, &b).map(|_| ())
878851
})
879852
}
880853

@@ -893,7 +866,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
893866
origin: origin,
894867
values: TraitRefs(expected_found(a_is_expected, a.clone(), b.clone()))
895868
};
896-
self.equate(a_is_expected, trace).relate(&a, &b).map(|_| ())
869+
self.equate(a_is_expected, trace, &a, &b).map(|_| ())
897870
})
898871
}
899872

@@ -912,7 +885,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
912885
origin: origin,
913886
values: PolyTraitRefs(expected_found(a_is_expected, a.clone(), b.clone()))
914887
};
915-
self.sub(a_is_expected, trace).relate(&a, &b).map(|_| ())
888+
self.sub(a_is_expected, trace, &a, &b).map(|_| ())
916889
})
917890
}
918891

@@ -1461,7 +1434,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
14611434
origin: TypeOrigin::Misc(codemap::DUMMY_SP),
14621435
values: Types(expected_found(true, e, e))
14631436
};
1464-
self.equate(true, trace).relate(a, b)
1437+
self.equate(true, trace, a, b)
14651438
}).map(|_| ())
14661439
}
14671440

trunk/src/librustc/lib.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ extern crate getopts;
5050
extern crate graphviz;
5151
extern crate libc;
5252
extern crate rbml;
53-
pub extern crate rustc_llvm as llvm;
5453
extern crate rustc_back;
5554
extern crate rustc_front;
5655
extern crate rustc_data_structures;
@@ -140,10 +139,6 @@ pub mod util {
140139
pub mod fs;
141140
}
142141

143-
pub mod lib {
144-
pub use llvm;
145-
}
146-
147142
// A private module so that macro-expanded idents like
148143
// `::rustc::lint::Lint` will also work in `rustc` itself.
149144
//

trunk/src/librustc/session/config.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ use std::env;
3838
use std::fmt;
3939
use std::path::PathBuf;
4040

41-
use llvm;
42-
4341
pub struct Config {
4442
pub target: Target,
4543
pub int_type: IntTy,
@@ -1052,10 +1050,6 @@ pub fn build_session_options(matches: &getopts::Matches) -> Options {
10521050
let dump_dep_graph = debugging_opts.dump_dep_graph;
10531051
let no_analysis = debugging_opts.no_analysis;
10541052

1055-
if debugging_opts.debug_llvm {
1056-
unsafe { llvm::LLVMSetDebug(1); }
1057-
}
1058-
10591053
let mut output_types = HashMap::new();
10601054
if !debugging_opts.parse_only && !no_trans {
10611055
for list in matches.opt_strs("emit") {

trunk/src/librustc/ty/relate.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -602,6 +602,17 @@ impl<'a,'tcx:'a> Relate<'a,'tcx> for ty::ClosureSubsts<'tcx> {
602602
}
603603
}
604604

605+
impl<'a,'tcx:'a> Relate<'a,'tcx> for Substs<'tcx> {
606+
fn relate<R>(relation: &mut R,
607+
a: &Substs<'tcx>,
608+
b: &Substs<'tcx>)
609+
-> RelateResult<'tcx, Substs<'tcx>>
610+
where R: TypeRelation<'a,'tcx>
611+
{
612+
relate_substs(relation, None, a, b)
613+
}
614+
}
615+
605616
impl<'a,'tcx:'a> Relate<'a,'tcx> for ty::Region {
606617
fn relate<R>(relation: &mut R,
607618
a: &ty::Region,

trunk/src/librustc_back/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ crate-type = ["dylib"]
1111
[dependencies]
1212
syntax = { path = "../libsyntax" }
1313
serialize = { path = "../libserialize" }
14-
rustc_llvm = { path = "../librustc_llvm" }
1514
rustc_front = { path = "../librustc_front" }
1615
log = { path = "../liblog" }
1716

trunk/src/librustc_back/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
extern crate syntax;
4646
extern crate libc;
4747
extern crate serialize;
48-
extern crate rustc_llvm;
4948
extern crate rustc_front;
5049
#[macro_use] extern crate log;
5150

trunk/src/librustc_driver/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,10 @@ pub fn run_compiler<'a>(args: &[String],
166166

167167
let sopts = config::build_session_options(&matches);
168168

169+
if sopts.debugging_opts.debug_llvm {
170+
unsafe { llvm::LLVMSetDebug(1); }
171+
}
172+
169173
let descriptions = diagnostics_registry();
170174

171175
do_or_return!(callbacks.early_callback(&matches,

0 commit comments

Comments
 (0)