rustc: Mark constant strings as constants
This commit is contained in:
parent
e652e58bfc
commit
e5bbe93646
1 changed files with 1 additions and 0 deletions
|
@ -374,6 +374,7 @@ fn C_str(@crate_ctxt cx, str s) -> ValueRef {
|
||||||
auto g = llvm.LLVMAddGlobal(cx.llmod, val_ty(sc),
|
auto g = llvm.LLVMAddGlobal(cx.llmod, val_ty(sc),
|
||||||
_str.buf(cx.names.next("str")));
|
_str.buf(cx.names.next("str")));
|
||||||
llvm.LLVMSetInitializer(g, sc);
|
llvm.LLVMSetInitializer(g, sc);
|
||||||
|
llvm.LLVMSetGlobalConstant(g, True);
|
||||||
ret g;
|
ret g;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue