Skip to content

Commit 936e8ae

Browse files
committed
---
yaml --- r: 124354 b: refs/heads/master c: 459ffc2 h: refs/heads/master v: v3
1 parent 5792597 commit 936e8ae

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: aa760a849ee9f4d6817c81aad25fdc7990e894ed
2+
refs/heads/master: 459ffc2adc74f5e8b64a76f5670edb419b9f65da
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: afbcbbc77ffc6b10053bc543daf7d2e05d68cc01
55
refs/heads/try: dff46952ab5c4567d1b5b35bfbd8befc45cdd38e

trunk/src/librustc/driver/config.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,8 @@ cgoptions!(
332332
"prefer dynamic linking to static linking"),
333333
no_integrated_as: bool = (false, parse_bool,
334334
"use an external assembler rather than LLVM's integrated one"),
335+
no_redzone: bool = (false, parse_bool,
336+
"disable the use of the redzone"),
335337
relocation_model: String = ("pic".to_string(), parse_string,
336338
"choose the relocation model to use (llc -relocation-model for details)"),
337339
metadata: Vec<String> = (Vec::new(), parse_list,

trunk/src/librustc/middle/trans/base.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,14 @@ fn decl_fn(ccx: &CrateContext, name: &str, cc: llvm::CallConv,
193193
_ => {}
194194
}
195195

196+
if ccx.tcx.sess.opts.cg.no_redzone {
197+
unsafe {
198+
llvm::LLVMAddFunctionAttribute(llfn,
199+
llvm::FunctionIndex as c_uint,
200+
llvm::NoRedZoneAttribute as uint64_t)
201+
}
202+
}
203+
196204
llvm::SetFunctionCallConv(llfn, cc);
197205
// Function addresses in Rust are never significant, allowing functions to be merged.
198206
llvm::SetUnnamedAddr(llfn, true);

0 commit comments

Comments
 (0)