Skip to content

Commit 023c233

Browse files
committed
---
yaml --- r: 233658 b: refs/heads/beta c: 274dae9 h: refs/heads/master v: v3
1 parent 74021d6 commit 023c233

File tree

7 files changed

+43
-244
lines changed

7 files changed

+43
-244
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ refs/tags/0.9: 36870b185fc5f5486636d4515f0e22677493f225
2323
refs/tags/0.10: ac33f2b15782272ae348dbd7b14b8257b2148b5a
2424
refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
2525
refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
26-
refs/heads/beta: 0e71bda2424c9fabee6db817d7b8365694e59897
26+
refs/heads/beta: 274dae9a4ce210c95a11eaf98eed12eccac3913a
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
2828
refs/heads/tmp: 370fe2786109360f7c35b8ba552b83b773dd71d6
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f

branches/beta/src/librustc_data_structures/transitive_relation.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ impl<T:Debug+PartialEq> TransitiveRelation<T> {
110110
/// (there are corresponding tests below, btw). In each case,
111111
/// the query is `postdom_upper_bound(a, b)`:
112112
///
113-
/// ```text
113+
/// ```
114114
/// // returns Some(x), which is also LUB
115115
/// a -> a1 -> x
116116
/// ^

branches/beta/src/librustc_trans/trans/base.rs

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -917,14 +917,10 @@ pub fn call_lifetime_start(cx: Block, ptr: ValueRef) {
917917
let _icx = push_ctxt("lifetime_start");
918918
let ccx = cx.ccx();
919919

920-
let size = machine::llsize_of_alloc(ccx, val_ty(ptr).element_type());
921-
if size == 0 {
922-
return;
923-
}
924-
920+
let llsize = C_u64(ccx, machine::llsize_of_alloc(ccx, val_ty(ptr).element_type()));
925921
let ptr = PointerCast(cx, ptr, Type::i8p(ccx));
926922
let lifetime_start = ccx.get_intrinsic(&"llvm.lifetime.start");
927-
Call(cx, lifetime_start, &[C_u64(ccx, size), ptr], None, DebugLoc::None);
923+
Call(cx, lifetime_start, &[llsize, ptr], None, DebugLoc::None);
928924
}
929925

930926
pub fn call_lifetime_end(cx: Block, ptr: ValueRef) {
@@ -935,14 +931,10 @@ pub fn call_lifetime_end(cx: Block, ptr: ValueRef) {
935931
let _icx = push_ctxt("lifetime_end");
936932
let ccx = cx.ccx();
937933

938-
let size = machine::llsize_of_alloc(ccx, val_ty(ptr).element_type());
939-
if size == 0 {
940-
return;
941-
}
942-
934+
let llsize = C_u64(ccx, machine::llsize_of_alloc(ccx, val_ty(ptr).element_type()));
943935
let ptr = PointerCast(cx, ptr, Type::i8p(ccx));
944936
let lifetime_end = ccx.get_intrinsic(&"llvm.lifetime.end");
945-
Call(cx, lifetime_end, &[C_u64(ccx, size), ptr], None, DebugLoc::None);
937+
Call(cx, lifetime_end, &[llsize, ptr], None, DebugLoc::None);
946938
}
947939

948940
pub fn call_memcpy(cx: Block, dst: ValueRef, src: ValueRef, n_bytes: ValueRef, align: u32) {
@@ -964,11 +956,6 @@ pub fn memcpy_ty<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
964956
t: Ty<'tcx>) {
965957
let _icx = push_ctxt("memcpy_ty");
966958
let ccx = bcx.ccx();
967-
968-
if type_is_zero_size(ccx, t) {
969-
return;
970-
}
971-
972959
if t.is_structural() {
973960
let llty = type_of::type_of(ccx, t);
974961
let llsz = llsize_of(ccx, llty);

branches/beta/src/librustc_trans/trans/intrinsic.rs

Lines changed: 29 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -616,171 +616,171 @@ pub fn trans_intrinsic_call<'a, 'blk, 'tcx>(mut bcx: Block<'blk, 'tcx>,
616616
(_, "i8_add_with_overflow") =>
617617
with_overflow_intrinsic(bcx,
618618
"llvm.sadd.with.overflow.i8",
619-
ret_ty,
620619
llargs[0],
621620
llargs[1],
621+
llresult,
622622
call_debug_location),
623623
(_, "i16_add_with_overflow") =>
624624
with_overflow_intrinsic(bcx,
625625
"llvm.sadd.with.overflow.i16",
626-
ret_ty,
627626
llargs[0],
628627
llargs[1],
628+
llresult,
629629
call_debug_location),
630630
(_, "i32_add_with_overflow") =>
631631
with_overflow_intrinsic(bcx,
632632
"llvm.sadd.with.overflow.i32",
633-
ret_ty,
634633
llargs[0],
635634
llargs[1],
635+
llresult,
636636
call_debug_location),
637637
(_, "i64_add_with_overflow") =>
638638
with_overflow_intrinsic(bcx,
639639
"llvm.sadd.with.overflow.i64",
640-
ret_ty,
641640
llargs[0],
642641
llargs[1],
642+
llresult,
643643
call_debug_location),
644644

645645
(_, "u8_add_with_overflow") =>
646646
with_overflow_intrinsic(bcx,
647647
"llvm.uadd.with.overflow.i8",
648-
ret_ty,
649648
llargs[0],
650649
llargs[1],
650+
llresult,
651651
call_debug_location),
652652
(_, "u16_add_with_overflow") =>
653653
with_overflow_intrinsic(bcx,
654654
"llvm.uadd.with.overflow.i16",
655-
ret_ty,
656655
llargs[0],
657656
llargs[1],
657+
llresult,
658658
call_debug_location),
659659
(_, "u32_add_with_overflow") =>
660660
with_overflow_intrinsic(bcx,
661661
"llvm.uadd.with.overflow.i32",
662-
ret_ty,
663662
llargs[0],
664663
llargs[1],
664+
llresult,
665665
call_debug_location),
666666
(_, "u64_add_with_overflow") =>
667667
with_overflow_intrinsic(bcx,
668668
"llvm.uadd.with.overflow.i64",
669-
ret_ty,
670669
llargs[0],
671670
llargs[1],
671+
llresult,
672672
call_debug_location),
673673
(_, "i8_sub_with_overflow") =>
674674
with_overflow_intrinsic(bcx,
675675
"llvm.ssub.with.overflow.i8",
676-
ret_ty,
677676
llargs[0],
678677
llargs[1],
678+
llresult,
679679
call_debug_location),
680680
(_, "i16_sub_with_overflow") =>
681681
with_overflow_intrinsic(bcx,
682682
"llvm.ssub.with.overflow.i16",
683-
ret_ty,
684683
llargs[0],
685684
llargs[1],
685+
llresult,
686686
call_debug_location),
687687
(_, "i32_sub_with_overflow") =>
688688
with_overflow_intrinsic(bcx,
689689
"llvm.ssub.with.overflow.i32",
690-
ret_ty,
691690
llargs[0],
692691
llargs[1],
692+
llresult,
693693
call_debug_location),
694694
(_, "i64_sub_with_overflow") =>
695695
with_overflow_intrinsic(bcx,
696696
"llvm.ssub.with.overflow.i64",
697-
ret_ty,
698697
llargs[0],
699698
llargs[1],
699+
llresult,
700700
call_debug_location),
701701
(_, "u8_sub_with_overflow") =>
702702
with_overflow_intrinsic(bcx,
703703
"llvm.usub.with.overflow.i8",
704-
ret_ty,
705704
llargs[0],
706705
llargs[1],
706+
llresult,
707707
call_debug_location),
708708
(_, "u16_sub_with_overflow") =>
709709
with_overflow_intrinsic(bcx,
710710
"llvm.usub.with.overflow.i16",
711-
ret_ty,
712711
llargs[0],
713712
llargs[1],
713+
llresult,
714714
call_debug_location),
715715
(_, "u32_sub_with_overflow") =>
716716
with_overflow_intrinsic(bcx,
717717
"llvm.usub.with.overflow.i32",
718-
ret_ty,
719718
llargs[0],
720719
llargs[1],
720+
llresult,
721721
call_debug_location),
722722
(_, "u64_sub_with_overflow") =>
723723
with_overflow_intrinsic(bcx,
724724
"llvm.usub.with.overflow.i64",
725-
ret_ty,
726725
llargs[0],
727726
llargs[1],
727+
llresult,
728728
call_debug_location),
729729
(_, "i8_mul_with_overflow") =>
730730
with_overflow_intrinsic(bcx,
731731
"llvm.smul.with.overflow.i8",
732-
ret_ty,
733732
llargs[0],
734733
llargs[1],
734+
llresult,
735735
call_debug_location),
736736
(_, "i16_mul_with_overflow") =>
737737
with_overflow_intrinsic(bcx,
738738
"llvm.smul.with.overflow.i16",
739-
ret_ty,
740739
llargs[0],
741740
llargs[1],
741+
llresult,
742742
call_debug_location),
743743
(_, "i32_mul_with_overflow") =>
744744
with_overflow_intrinsic(bcx,
745745
"llvm.smul.with.overflow.i32",
746-
ret_ty,
747746
llargs[0],
748747
llargs[1],
748+
llresult,
749749
call_debug_location),
750750
(_, "i64_mul_with_overflow") =>
751751
with_overflow_intrinsic(bcx,
752752
"llvm.smul.with.overflow.i64",
753-
ret_ty,
754753
llargs[0],
755754
llargs[1],
755+
llresult,
756756
call_debug_location),
757757
(_, "u8_mul_with_overflow") =>
758758
with_overflow_intrinsic(bcx,
759759
"llvm.umul.with.overflow.i8",
760-
ret_ty,
761760
llargs[0],
762761
llargs[1],
762+
llresult,
763763
call_debug_location),
764764
(_, "u16_mul_with_overflow") =>
765765
with_overflow_intrinsic(bcx,
766766
"llvm.umul.with.overflow.i16",
767-
ret_ty,
768767
llargs[0],
769768
llargs[1],
769+
llresult,
770770
call_debug_location),
771771
(_, "u32_mul_with_overflow") =>
772772
with_overflow_intrinsic(bcx,
773773
"llvm.umul.with.overflow.i32",
774-
ret_ty,
775774
llargs[0],
776775
llargs[1],
776+
llresult,
777777
call_debug_location),
778778
(_, "u64_mul_with_overflow") =>
779779
with_overflow_intrinsic(bcx,
780780
"llvm.umul.with.overflow.i64",
781-
ret_ty,
782781
llargs[0],
783782
llargs[1],
783+
llresult,
784784
call_debug_location),
785785

786786
(_, "unchecked_udiv") => UDiv(bcx, llargs[0], llargs[1], call_debug_location),
@@ -1053,9 +1053,9 @@ fn count_zeros_intrinsic(bcx: Block,
10531053

10541054
fn with_overflow_intrinsic<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
10551055
name: &'static str,
1056-
t: Ty<'tcx>,
10571056
a: ValueRef,
10581057
b: ValueRef,
1058+
out: ValueRef,
10591059
call_debug_location: DebugLoc)
10601060
-> ValueRef {
10611061
let llfn = bcx.ccx().get_intrinsic(&name);
@@ -1064,16 +1064,10 @@ fn with_overflow_intrinsic<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
10641064
let val = Call(bcx, llfn, &[a, b], None, call_debug_location);
10651065
let result = ExtractValue(bcx, val, 0);
10661066
let overflow = ZExt(bcx, ExtractValue(bcx, val, 1), Type::bool(bcx.ccx()));
1067-
let ret = C_undef(type_of::type_of(bcx.ccx(), t));
1068-
let ret = InsertValue(bcx, ret, result, 0);
1069-
let ret = InsertValue(bcx, ret, overflow, 1);
1070-
if !arg_is_indirect(bcx.ccx(), t) {
1071-
let tmp = alloc_ty(bcx, t, "tmp");
1072-
Store(bcx, ret, tmp);
1073-
load_ty(bcx, tmp, t)
1074-
} else {
1075-
ret
1076-
}
1067+
Store(bcx, result, StructGEP(bcx, out, 0));
1068+
Store(bcx, overflow, StructGEP(bcx, out, 1));
1069+
1070+
C_nil(bcx.ccx())
10771071
}
10781072

10791073
fn try_intrinsic<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,

branches/beta/src/librustc_typeck/coherence/orphan.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,6 @@ impl<'cx, 'tcx> OrphanChecker<'cx, 'tcx> {
5050
span_err!(self.tcx.sess, span, E0390,
5151
"only a single inherent implementation marked with `#[lang = \"{}\"]` \
5252
is allowed for the `{}` primitive", lang, ty);
53-
span_help!(self.tcx.sess, span,
54-
"consider using a trait to implement these methods");
5553
}
5654
}
5755
}

0 commit comments

Comments
 (0)