Skip to content

Commit 7f2392f

Browse files
committed
---
yaml --- r: 4957 b: refs/heads/master c: 2744bcd h: refs/heads/master i: 4955: d2cb0a1 v: v3
1 parent 3f890e8 commit 7f2392f

File tree

3 files changed

+8
-15
lines changed

3 files changed

+8
-15
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: f0820662c9bdc3d3150b7b7317bb165556c2348b
2+
refs/heads/master: 2744bcd693671869d17bc9b8db013d487fe465b1

trunk/src/comp/middle/trans.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6395,8 +6395,7 @@ fn trans_crate(sess: &session::session, crate: &@ast::crate, tcx: &ty::ctxt,
63956395
task_type: task_type,
63966396
builder: BuilderRef_res(llvm::LLVMCreateBuilder()),
63976397
shape_cx: shape::mk_ctxt(llmod),
6398-
gc_cx: gc::mk_ctxt(),
6399-
cstrcache: cstrcache::mk()};
6398+
gc_cx: gc::mk_ctxt()};
64006399
let cx = new_local_ctxt(ccx);
64016400
collect_items(ccx, crate);
64026401
collect_tag_ctors(ccx, crate);

trunk/src/comp/middle/trans_common.rs

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,7 @@ type crate_ctxt =
154154
task_type: TypeRef,
155155
builder: BuilderRef_res,
156156
shape_cx: shape::ctxt,
157-
gc_cx: gc::ctxt,
158-
cstrcache: cstrcache::t};
157+
gc_cx: gc::ctxt};
159158

160159
type local_ctxt =
161160
{path: [str],
@@ -843,11 +842,10 @@ fn C_u8(i: uint) -> ValueRef { ret C_integral(T_i8(), i, False); }
843842
// This is a 'c-like' raw string, which differs from
844843
// our boxed-and-length-annotated strings.
845844
fn C_cstr(cx: &@crate_ctxt, s: &str) -> ValueRef {
846-
let sc = llvm::LLVMConstString(safe_sbuf(cx, s),
847-
str::byte_len(s), False);
845+
let sc = llvm::LLVMConstString(str::buf(s), str::byte_len(s), False);
848846
let g =
849847
llvm::LLVMAddGlobal(cx.llmod, val_ty(sc),
850-
safe_sbuf(cx, cx.names.next("str")));
848+
str::buf(cx.names.next("str")));
851849
llvm::LLVMSetInitializer(g, sc);
852850
llvm::LLVMSetGlobalConstant(g, True);
853851
llvm::LLVMSetLinkage(g, lib::llvm::LLVMInternalLinkage as llvm::Linkage);
@@ -865,10 +863,10 @@ fn C_str(cx: &@crate_ctxt, s: &str) -> ValueRef {
865863
let box =
866864
C_struct([C_int(abi::const_refcount as int), C_int(len + 1u as int),
867865
C_int(len + 1u as int), C_int(0),
868-
llvm::LLVMConstString(safe_sbuf(cx, s), len, False)]);
866+
llvm::LLVMConstString(str::buf(s), len, False)]);
869867
let g =
870868
llvm::LLVMAddGlobal(cx.llmod, val_ty(box),
871-
safe_sbuf(cx, cx.names.next("str")));
869+
str::buf(cx.names.next("str")));
872870
llvm::LLVMSetInitializer(g, box);
873871
llvm::LLVMSetGlobalConstant(g, True);
874872
llvm::LLVMSetLinkage(g, lib::llvm::LLVMInternalLinkage as llvm::Linkage);
@@ -911,18 +909,14 @@ fn C_shape(ccx: &@crate_ctxt, bytes: &[u8]) -> ValueRef {
911909
let llshape = C_bytes(bytes);
912910
let llglobal =
913911
llvm::LLVMAddGlobal(ccx.llmod, val_ty(llshape),
914-
safe_sbuf(ccx, ccx.names.next("shape")));
912+
str::buf(ccx.names.next("shape")));
915913
llvm::LLVMSetInitializer(llglobal, llshape);
916914
llvm::LLVMSetGlobalConstant(llglobal, True);
917915
llvm::LLVMSetLinkage(llglobal,
918916
lib::llvm::LLVMInternalLinkage as llvm::Linkage);
919917
ret llvm::LLVMConstPointerCast(llglobal, T_ptr(T_i8()));
920918
}
921919

922-
fn safe_sbuf(ccx: &@crate_ctxt, s: &str) -> str::rustrt::sbuf {
923-
cstrcache::get_cstr(ccx.cstrcache, s)
924-
}
925-
926920
//
927921
// Local Variables:
928922
// mode: rust

0 commit comments

Comments
 (0)