Skip to content

Commit c681cd1

Browse files
committed
---
yaml --- r: 146070 b: refs/heads/try2 c: 462a28d h: refs/heads/master v: v3
1 parent 880e20c commit c681cd1

File tree

10 files changed

+38
-109
lines changed

10 files changed

+38
-109
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: cf7b9eb51f10fc0b27164c27a30600f80927a1d3
8+
refs/heads/try2: 462a28d0030a52eaaf3233219a4a892903f631b0
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/librustc/middle/trans/base.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2797,8 +2797,8 @@ pub fn declare_intrinsics(llmod: ModuleRef) -> HashMap<&'static str, ValueRef> {
27972797

27982798
ifn!(intrinsics, "llvm.fabs.f32", [Type::f32()], Type::f32());
27992799
ifn!(intrinsics, "llvm.fabs.f64", [Type::f64()], Type::f64());
2800-
ifn!(intrinsics, "llvm.copysign.f32", [Type::f32()], Type::f32());
2801-
ifn!(intrinsics, "llvm.copysign.f64", [Type::f64()], Type::f64());
2800+
ifn!(intrinsics, "llvm.copysign.f32", [Type::f32(), Type::f32()], Type::f32());
2801+
ifn!(intrinsics, "llvm.copysign.f64", [Type::f64(), Type::f64()], Type::f64());
28022802

28032803
ifn!(intrinsics, "llvm.floor.f32",[Type::f32()], Type::f32());
28042804
ifn!(intrinsics, "llvm.floor.f64",[Type::f64()], Type::f64());
@@ -2807,12 +2807,12 @@ pub fn declare_intrinsics(llmod: ModuleRef) -> HashMap<&'static str, ValueRef> {
28072807
ifn!(intrinsics, "llvm.trunc.f32",[Type::f32()], Type::f32());
28082808
ifn!(intrinsics, "llvm.trunc.f64",[Type::f64()], Type::f64());
28092809

2810-
ifn!(intrinsics, "llvm.rint.f32",[Type::f64()], Type::f64());
2811-
ifn!(intrinsics, "llvm.rint.f64",[Type::f64()], Type::f64());
2812-
ifn!(intrinsics, "llvm.nearbyint.f32",[Type::f64()], Type::f64());
2813-
ifn!(intrinsics, "llvm.nearbyint.f64",[Type::f64()], Type::f64());
2814-
ifn!(intrinsics, "llvm.round.f32",[Type::f64()], Type::f64());
2815-
ifn!(intrinsics, "llvm.round.f64",[Type::f64()], Type::f64());
2810+
ifn!(intrinsics, "llvm.rint.f32", [Type::f32()], Type::f32());
2811+
ifn!(intrinsics, "llvm.rint.f64", [Type::f64()], Type::f64());
2812+
ifn!(intrinsics, "llvm.nearbyint.f32", [Type::f32()], Type::f32());
2813+
ifn!(intrinsics, "llvm.nearbyint.f64", [Type::f64()], Type::f64());
2814+
ifn!(intrinsics, "llvm.round.f32", [Type::f32()], Type::f32());
2815+
ifn!(intrinsics, "llvm.round.f64", [Type::f64()], Type::f64());
28162816

28172817
ifn!(intrinsics, "llvm.ctpop.i8", [Type::i8()], Type::i8());
28182818
ifn!(intrinsics, "llvm.ctpop.i16",[Type::i16()], Type::i16());

branches/try2/src/librustc/middle/trans/intrinsic.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -460,20 +460,20 @@ pub fn trans_intrinsic(ccx: @mut CrateContext,
460460
"fmaf64" => simple_llvm_intrinsic(bcx, "llvm.fma.f64", 3),
461461
"fabsf32" => simple_llvm_intrinsic(bcx, "llvm.fabs.f32", 1),
462462
"fabsf64" => simple_llvm_intrinsic(bcx, "llvm.fabs.f64", 1),
463-
"copysignf32" => simple_llvm_intrinsic(bcx, "llvm.copysign.f32", 1),
464-
"copysignf64" => simple_llvm_intrinsic(bcx, "llvm.copysign.f64", 1),
463+
"copysignf32" => simple_llvm_intrinsic(bcx, "llvm.copysign.f32", 2),
464+
"copysignf64" => simple_llvm_intrinsic(bcx, "llvm.copysign.f64", 2),
465465
"floorf32" => simple_llvm_intrinsic(bcx, "llvm.floor.f32", 1),
466466
"floorf64" => simple_llvm_intrinsic(bcx, "llvm.floor.f64", 1),
467467
"ceilf32" => simple_llvm_intrinsic(bcx, "llvm.ceil.f32", 1),
468468
"ceilf64" => simple_llvm_intrinsic(bcx, "llvm.ceil.f64", 1),
469469
"truncf32" => simple_llvm_intrinsic(bcx, "llvm.trunc.f32", 1),
470470
"truncf64" => simple_llvm_intrinsic(bcx, "llvm.trunc.f64", 1),
471-
"rintf64" => simple_llvm_intrinsic(bcx, "llvm.rint.f64", 1),
472471
"rintf32" => simple_llvm_intrinsic(bcx, "llvm.rint.f32", 1),
473-
"nearbyintf32" => simple_llvm_intrinsic(bcx, "llvm.nearbyint.f64", 1),
474-
"nearbyintf64" => simple_llvm_intrinsic(bcx, "llvm.nearbyint.f32", 1),
475-
"roundf32" => simple_llvm_intrinsic(bcx, "llvm.round.f64", 1),
476-
"roundf64" => simple_llvm_intrinsic(bcx, "llvm.round.f32", 1),
472+
"rintf64" => simple_llvm_intrinsic(bcx, "llvm.rint.f64", 1),
473+
"nearbyintf32" => simple_llvm_intrinsic(bcx, "llvm.nearbyint.f32", 1),
474+
"nearbyintf64" => simple_llvm_intrinsic(bcx, "llvm.nearbyint.f64", 1),
475+
"roundf32" => simple_llvm_intrinsic(bcx, "llvm.round.f32", 1),
476+
"roundf64" => simple_llvm_intrinsic(bcx, "llvm.round.f64", 1),
477477
"ctpop8" => simple_llvm_intrinsic(bcx, "llvm.ctpop.i8", 1),
478478
"ctpop16" => simple_llvm_intrinsic(bcx, "llvm.ctpop.i16", 1),
479479
"ctpop32" => simple_llvm_intrinsic(bcx, "llvm.ctpop.i32", 1),

branches/try2/src/librustc/middle/typeck/check/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3809,8 +3809,8 @@ pub fn check_intrinsic_type(ccx: @mut CrateCtxt, it: @ast::foreign_item) {
38093809
}
38103810
"fabsf32" => (0, ~[ ty::mk_f32() ], ty::mk_f32()),
38113811
"fabsf64" => (0, ~[ ty::mk_f64() ], ty::mk_f64()),
3812-
"copysignf32" => (0, ~[ ty::mk_f32() ], ty::mk_f32()),
3813-
"copysignf64" => (0, ~[ ty::mk_f64() ], ty::mk_f64()),
3812+
"copysignf32" => (0, ~[ ty::mk_f32(), ty::mk_f32() ], ty::mk_f32()),
3813+
"copysignf64" => (0, ~[ ty::mk_f64(), ty::mk_f64() ], ty::mk_f64()),
38143814
"floorf32" => (0, ~[ ty::mk_f32() ], ty::mk_f32()),
38153815
"floorf64" => (0, ~[ ty::mk_f64() ], ty::mk_f64()),
38163816
"ceilf32" => (0, ~[ ty::mk_f32() ], ty::mk_f32()),

branches/try2/src/librustpkg/conditions.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ condition! {
4747
pub no_rust_path: (~str) -> Path;
4848
}
4949

50+
condition! {
51+
pub not_a_workspace: (~str) -> Path;
52+
}
53+
5054
condition! {
5155
pub failed_to_create_temp_dir: (~str) -> Path;
5256
}

branches/try2/src/librustpkg/package_source.rs

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ use crate::Crate;
1919
use messages::*;
2020
use source_control::{safe_git_clone, git_clone_url, DirToUse, CheckedOutSources};
2121
use source_control::make_read_only;
22-
use path_util::{find_dir_using_rust_path_hack, make_dir_rwx_recursive, default_workspace};
23-
use path_util::{target_build_dir, versionize, dir_has_crate_file};
22+
use path_util::{find_dir_using_rust_path_hack, make_dir_rwx_recursive};
23+
use path_util::{target_build_dir, versionize};
2424
use util::{compile_crate, DepMap};
2525
use workcache_support;
2626
use workcache_support::crate_tag;
@@ -197,23 +197,7 @@ impl PkgSrc {
197197
match ok_d {
198198
Some(d) => d,
199199
None => {
200-
// See if the sources are in $CWD
201-
let cwd = os::getcwd();
202-
if dir_has_crate_file(&cwd) {
203-
return PkgSrc {
204-
// In this case, source_workspace isn't really a workspace.
205-
// This data structure needs yet more refactoring.
206-
source_workspace: cwd.clone(),
207-
destination_workspace: default_workspace(),
208-
build_in_destination: true,
209-
start_dir: cwd,
210-
id: id,
211-
libs: ~[],
212-
mains: ~[],
213-
benchs: ~[],
214-
tests: ~[]
215-
}
216-
} else if use_rust_path_hack {
200+
if use_rust_path_hack {
217201
match find_dir_using_rust_path_hack(&id) {
218202
Some(d) => d,
219203
None => {

branches/try2/src/librustpkg/path_util.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -414,11 +414,6 @@ pub fn uninstall_package_from(workspace: &Path, pkgid: &PkgId) {
414414

415415
}
416416

417-
pub fn dir_has_crate_file(dir: &Path) -> bool {
418-
dir_has_file(dir, "lib.rs") || dir_has_file(dir, "main.rs")
419-
|| dir_has_file(dir, "test.rs") || dir_has_file(dir, "bench.rs")
420-
}
421-
422417
fn dir_has_file(dir: &Path, file: &str) -> bool {
423418
assert!(dir.is_absolute());
424419
os::path_exists(&dir.join(file))
@@ -432,7 +427,8 @@ pub fn find_dir_using_rust_path_hack(p: &PkgId) -> Option<Path> {
432427
// has a name that's a single component
433428
if dir.ends_with_path(&p.path) || dir.ends_with_path(&versionize(&p.path, &p.version)) {
434429
debug2!("In find_dir_using_rust_path_hack: checking dir {}", dir.display());
435-
if dir_has_crate_file(dir) {
430+
if dir_has_file(dir, "lib.rs") || dir_has_file(dir, "main.rs")
431+
|| dir_has_file(dir, "test.rs") || dir_has_file(dir, "bench.rs") {
436432
debug2!("Did find id {} in dir {}", p.to_str(), dir.display());
437433
return Some(dir.clone());
438434
}

branches/try2/src/librustpkg/rustpkg.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ use messages::{error, warn, note};
3838
use path_util::{build_pkg_id_in_workspace, built_test_in_workspace};
3939
use path_util::{U_RWX, in_rust_path};
4040
use path_util::{built_executable_in_workspace, built_library_in_workspace, default_workspace};
41-
use path_util::{target_executable_in_workspace, target_library_in_workspace, dir_has_crate_file};
41+
use path_util::{target_executable_in_workspace, target_library_in_workspace};
4242
use source_control::{CheckedOutSources, is_git_dir, make_read_only};
4343
use workspace::{each_pkg_parent_workspace, pkg_parent_workspaces, cwd_to_workspace};
4444
use workspace::determine_destination;
@@ -48,6 +48,7 @@ use context::{Context, BuildContext,
4848
use package_id::PkgId;
4949
use package_source::PkgSrc;
5050
use target::{WhatToBuild, Everything, is_lib, is_main, is_test, is_bench, Tests};
51+
// use workcache_support::{discover_outputs, digest_only_date};
5152
use workcache_support::digest_only_date;
5253
use exit_codes::{COPY_FAILED_CODE, BAD_FLAG_CODE};
5354

@@ -209,11 +210,10 @@ pub trait CtxMethods {
209210

210211
impl CtxMethods for BuildContext {
211212
fn build_args(&self, args: ~[~str], what: &WhatToBuild) -> Option<(PkgId, Path)> {
212-
let cwd = os::getcwd();
213-
214213
if args.len() < 1 {
215214
match cwd_to_workspace() {
216-
None if dir_has_crate_file(&cwd) => {
215+
None if self.context.use_rust_path_hack => {
216+
let cwd = os::getcwd();
217217
// FIXME (#9639): This needs to handle non-utf8 paths
218218
let pkgid = PkgId::new(cwd.filename_str().unwrap());
219219
let mut pkg_src = PkgSrc::new(cwd, default_workspace(), true, pkgid);
@@ -260,7 +260,6 @@ impl CtxMethods for BuildContext {
260260
}
261261
}
262262
fn run(&self, cmd: &str, args: ~[~str]) {
263-
let cwd = os::getcwd();
264263
match cmd {
265264
"build" => {
266265
self.build_args(args, &Everything);
@@ -279,6 +278,7 @@ impl CtxMethods for BuildContext {
279278
// The package id is presumed to be the first command-line
280279
// argument
281280
let pkgid = PkgId::new(args[0].clone());
281+
let cwd = os::getcwd();
282282
self.clean(&cwd, &pkgid); // tjc: should use workspace, not cwd
283283
}
284284
}
@@ -295,9 +295,9 @@ impl CtxMethods for BuildContext {
295295
"install" => {
296296
if args.len() < 1 {
297297
match cwd_to_workspace() {
298-
None if dir_has_crate_file(&cwd) => {
298+
None if self.context.use_rust_path_hack => {
299+
let cwd = os::getcwd();
299300
// FIXME (#9639): This needs to handle non-utf8 paths
300-
301301
let inferred_pkgid =
302302
PkgId::new(cwd.filename_str().unwrap());
303303
self.install(PkgSrc::new(cwd, default_workspace(),

branches/try2/src/librustpkg/tests.rs

Lines changed: 2 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -580,11 +580,7 @@ fn test_make_dir_rwx() {
580580
assert!(os::remove_dir_recursive(&dir));
581581
}
582582

583-
// n.b. I ignored the next two tests for now because something funny happens on linux
584-
// and I don't want to debug the issue right now (calling into the rustpkg lib directly
585-
// is a little sketchy anyway)
586583
#[test]
587-
#[ignore]
588584
fn test_install_valid() {
589585
use path_util::installed_library_in_workspace;
590586

@@ -625,7 +621,6 @@ fn test_install_valid() {
625621
}
626622

627623
#[test]
628-
#[ignore]
629624
fn test_install_invalid() {
630625
let sysroot = test_sysroot();
631626
let pkgid = fake_pkg();
@@ -646,44 +641,7 @@ fn test_install_invalid() {
646641
assert!(result == Err(()));
647642
}
648643

649-
#[test]
650-
fn test_install_valid_external() {
651-
let temp_pkg_id = PkgId::new("foo");
652-
let (tempdir, _) = mk_temp_workspace(&temp_pkg_id.path,
653-
&temp_pkg_id.version);
654-
let temp_workspace = tempdir.path();
655-
command_line_test([~"install", ~"foo"], temp_workspace);
656-
657-
// Check that all files exist
658-
let exec = target_executable_in_workspace(&temp_pkg_id, temp_workspace);
659-
debug2!("exec = {}", exec.display());
660-
assert!(os::path_exists(&exec));
661-
assert!(is_rwx(&exec));
662-
663-
let lib = installed_library_in_workspace(&temp_pkg_id.path, temp_workspace);
664-
debug2!("lib = {:?}", lib);
665-
assert!(lib.as_ref().map_default(false, |l| os::path_exists(l)));
666-
assert!(lib.as_ref().map_default(false, |l| is_rwx(l)));
667-
668-
// And that the test and bench executables aren't installed
669-
assert!(!os::path_exists(&target_test_in_workspace(&temp_pkg_id, temp_workspace)));
670-
let bench = target_bench_in_workspace(&temp_pkg_id, temp_workspace);
671-
debug2!("bench = {}", bench.display());
672-
assert!(!os::path_exists(&bench));
673-
674-
}
675-
676-
#[test]
677-
#[ignore(reason = "9994")]
678-
fn test_install_invalid_external() {
679-
let cwd = os::getcwd();
680-
command_line_test_expect_fail([~"install", ~"foo"],
681-
&cwd,
682-
None,
683-
// FIXME #3408: Should be NONEXISTENT_PACKAGE_CODE
684-
COPY_FAILED_CODE);
685-
}
686-
644+
// Tests above should (maybe) be converted to shell out to rustpkg, too
687645
#[test]
688646
fn test_install_git() {
689647
let temp_pkg_id = git_repo_pkg();
@@ -1409,8 +1367,6 @@ fn rust_path_hack_test(hack_flag: bool) {
14091367
assert!(!built_executable_exists(workspace, "foo"));
14101368
}
14111369

1412-
// Notice that this is the only test case where the --rust-path-hack
1413-
// flag is actually needed
14141370
#[test]
14151371
fn test_rust_path_can_contain_package_dirs_with_flag() {
14161372
/*
@@ -2073,6 +2029,7 @@ fn test_rustpkg_test_output() {
20732029
}
20742030
20752031
#[test]
2032+
#[ignore(reason = "Issue 9441")]
20762033
fn test_rebuild_when_needed() {
20772034
let foo_id = PkgId::new("foo");
20782035
let foo_workspace = create_local_package(&foo_id);
@@ -2239,18 +2196,6 @@ fn test_compile_error() {
22392196
}
22402197
}
22412198

2242-
#[test]
2243-
fn find_sources_in_cwd() {
2244-
let temp_dir = TempDir::new("sources").expect("find_sources_in_cwd failed");
2245-
let temp_dir = temp_dir.path();
2246-
let source_dir = temp_dir.join("foo");
2247-
os::mkdir_recursive(&source_dir, U_RWX);
2248-
writeFile(&source_dir.join("main.rs"),
2249-
"fn main() { let _x = (); }");
2250-
command_line_test([~"install", ~"foo"], &source_dir);
2251-
assert_executable_exists(&source_dir.join(".rust"), "foo");
2252-
}
2253-
22542199
/// Returns true if p exists and is executable
22552200
fn is_executable(p: &Path) -> bool {
22562201
use std::libc::consts::os::posix88::{S_IXUSR};

branches/try2/src/libstd/unstable/intrinsics.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -414,9 +414,9 @@ extern "rust-intrinsic" {
414414
pub fn fabsf64(x: f64) -> f64;
415415

416416
#[cfg(not(stage0))]
417-
pub fn copysignf32(x: f32) -> f32;
417+
pub fn copysignf32(x: f32, y: f32) -> f32;
418418
#[cfg(not(stage0))]
419-
pub fn copysignf64(x: f64) -> f64;
419+
pub fn copysignf64(x: f64, y: f64) -> f64;
420420

421421
pub fn floorf32(x: f32) -> f32;
422422
pub fn floorf64(x: f64) -> f64;

0 commit comments

Comments
 (0)