Skip to content

Commit 141ce96

Browse files
Bleiemberian
authored andcommitted
---
yaml --- r: 63715 b: refs/heads/snap-stage3 c: 2234f61 h: refs/heads/master i: 63713: 492a7c1 63711: 227233e v: v3
1 parent 5fbdf95 commit 141ce96

File tree

8 files changed

+23
-92
lines changed

8 files changed

+23
-92
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 2d28d645422c1617be58c8ca7ad9a457264ca850
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 87c1b59e8bf59ca32e725ca72f09ebef98928091
4+
refs/heads/snap-stage3: 2234f61038f5a91fce0d7f4765eec55fc4b0c622
55
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/src/librustc/middle/trans/base.rs

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ use middle::trans::machine::{llalign_of_min, llsize_of};
5555
use middle::trans::meth;
5656
use middle::trans::monomorphize;
5757
use middle::trans::reachable;
58-
use middle::trans::shape::*;
5958
use middle::trans::tvec;
6059
use middle::trans::type_of;
6160
use middle::trans::type_of::*;
@@ -2870,6 +2869,26 @@ pub fn write_metadata(cx: &mut CrateContext, crate: &ast::crate) {
28702869
}
28712870
}
28722871
2872+
fn mk_global(ccx: &CrateContext,
2873+
name: &str,
2874+
llval: ValueRef,
2875+
internal: bool)
2876+
-> ValueRef {
2877+
unsafe {
2878+
let llglobal = do str::as_c_str(name) |buf| {
2879+
llvm::LLVMAddGlobal(ccx.llmod, val_ty(llval).to_ref(), buf)
2880+
};
2881+
llvm::LLVMSetInitializer(llglobal, llval);
2882+
llvm::LLVMSetGlobalConstant(llglobal, True);
2883+
2884+
if internal {
2885+
lib::llvm::SetLinkage(llglobal, lib::llvm::InternalLinkage);
2886+
}
2887+
2888+
return llglobal;
2889+
}
2890+
}
2891+
28732892
// Writes the current ABI version into the crate.
28742893
pub fn write_abi_version(ccx: &mut CrateContext) {
28752894
mk_global(ccx, "rust_abi_version", C_uint(ccx, abi::abi_version), false);

branches/snap-stage3/src/librustc/middle/trans/closure.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ pub fn store_environment(bcx: block,
210210
let ccx = bcx.ccx();
211211
let tcx = ccx.tcx;
212212

213-
// compute the shape of the closure
213+
// compute the type of the closure
214214
let cdata_ty = mk_closure_tys(tcx, bound_values);
215215

216216
// allocate closure in the heap

branches/snap-stage3/src/librustc/middle/trans/common.rs

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,7 @@ impl block_ {
658658
pub fn tuplify_box_ty(tcx: ty::ctxt, t: ty::t) -> ty::t {
659659
let ptr = ty::mk_ptr(
660660
tcx,
661-
ty::mt {ty: ty::mk_nil(), mutbl: ast::m_imm}
661+
ty::mt {ty: ty::mk_i8(), mutbl: ast::m_imm}
662662
);
663663
return ty::mk_tup(tcx, ~[ty::mk_uint(), ty::mk_type(tcx),
664664
ptr, ptr,
@@ -826,20 +826,6 @@ pub fn C_bytes_plus_null(bytes: &[u8]) -> ValueRef {
826826
}
827827
}
828828

829-
pub fn C_shape(ccx: &CrateContext, bytes: ~[u8]) -> ValueRef {
830-
unsafe {
831-
let llshape = C_bytes_plus_null(bytes);
832-
let name = fmt!("shape%u", token::gensym("shape"));
833-
let llglobal = do name.as_c_str |buf| {
834-
llvm::LLVMAddGlobal(ccx.llmod, val_ty(llshape).to_ref(), buf)
835-
};
836-
llvm::LLVMSetInitializer(llglobal, llshape);
837-
llvm::LLVMSetGlobalConstant(llglobal, True);
838-
lib::llvm::SetLinkage(llglobal, lib::llvm::InternalLinkage);
839-
return llvm::LLVMConstPointerCast(llglobal, Type::i8p().to_ref());
840-
}
841-
}
842-
843829
pub fn get_param(fndecl: ValueRef, param: uint) -> ValueRef {
844830
unsafe {
845831
llvm::LLVMGetParam(fndecl, param as c_uint)

branches/snap-stage3/src/librustc/middle/trans/context.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ use middle::trans::adt;
2222
use middle::trans::base;
2323
use middle::trans::debuginfo;
2424
use middle::trans::reachable;
25-
use middle::trans::shape;
2625
use middle::trans::type_use;
2726
use middle::ty;
2827

@@ -40,8 +39,6 @@ use middle::trans::common::{mono_id,new_namegen};
4039

4140
use middle::trans::base::{decl_crate_map};
4241

43-
use middle::trans::shape::{mk_ctxt};
44-
4542
pub struct CrateContext {
4643
sess: session::Session,
4744
llmod: ModuleRef,
@@ -110,7 +107,6 @@ pub struct CrateContext {
110107
float_type: Type,
111108
opaque_vec_type: Type,
112109
builder: BuilderRef_res,
113-
shape_cx: shape::Ctxt,
114110
crate_map: ValueRef,
115111
// Set when at least one function uses GC. Needed so that
116112
// decl_gc_metadata knows whether to link to the module metadata, which
@@ -223,7 +219,6 @@ impl CrateContext {
223219
float_type: float_type,
224220
opaque_vec_type: opaque_vec_type,
225221
builder: BuilderRef_res(llvm::LLVMCreateBuilderInContext(llcx)),
226-
shape_cx: mk_ctxt(llmod),
227222
crate_map: crate_map,
228223
uses_gc: false,
229224
dbg_cx: dbg_cx,

branches/snap-stage3/src/librustc/middle/trans/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ pub mod cabi_arm;
3535
pub mod cabi_mips;
3636
pub mod foreign;
3737
pub mod reflect;
38-
pub mod shape;
3938
pub mod debuginfo;
4039
pub mod type_use;
4140
pub mod reachable;

branches/snap-stage3/src/librustc/middle/trans/shape.rs

Lines changed: 0 additions & 63 deletions
This file was deleted.

branches/snap-stage3/src/test/run-pass/shape_intrinsic_tag_then_rec.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// xfail-fast
2-
31
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
42
// file at the top-level directory of this distribution and at
53
// http://rust-lang.org/COPYRIGHT.
@@ -14,9 +12,6 @@
1412
// on x86_64: when there is a enum embedded in an
1513
// interior record which is then itself interior to
1614
// something else, shape calculations were off.
17-
extern mod extra;
18-
use extra::list;
19-
use extra::list::list;
2015

2116
enum opt_span {
2217

0 commit comments

Comments
 (0)