aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Walton <[email protected]>2010-12-09 13:49:26 -0800
committerPatrick Walton <[email protected]>2010-12-09 13:49:26 -0800
commite5bbe93646708ef13377840dd225022cf3077d2a (patch)
treea5e947520cb268d838b984055e54f408ccd1c6a7
parentrustc: Fix indirection problem with tag constructors (diff)
downloadrust-e5bbe93646708ef13377840dd225022cf3077d2a.tar.xz
rust-e5bbe93646708ef13377840dd225022cf3077d2a.zip
rustc: Mark constant strings as constants
-rw-r--r--src/comp/middle/trans.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/comp/middle/trans.rs b/src/comp/middle/trans.rs
index da4ea352..0a74b7a0 100644
--- a/src/comp/middle/trans.rs
+++ b/src/comp/middle/trans.rs
@@ -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;
}