rustc: Mark constant strings as constants

This commit is contained in:
Patrick Walton 2010-12-09 13:49:26 -08:00
parent e652e58bfc
commit e5bbe93646

View file

@ -374,6 +374,7 @@ fn C_str(@crate_ctxt cx, str s) -> ValueRef {
auto g = llvm.LLVMAddGlobal(cx.llmod, val_ty(sc),
_str.buf(cx.names.next("str")));
llvm.LLVMSetInitializer(g, sc);
llvm.LLVMSetGlobalConstant(g, True);
ret g;
}