Skip to content

Commit 4ade310

Browse files
---
yaml --- r: 90478 b: refs/heads/master c: 45e472a h: refs/heads/master v: v3
1 parent 6bd1381 commit 4ade310

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
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: 7eae649a015cd2e4c5764b2955edb7542410f1f1
2+
refs/heads/master: 45e472aa4bdcec7a5bfd8cdaa10dd00435242162
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: a6d3e57dca68fde4effdda3e4ae2887aa535fcd6
55
refs/heads/try: b160761e35efcd1207112b3b782c06633cf441a8

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ use util::common::indenter;
220220
use util::ppaux::{Repr, vec_map_to_str};
221221

222222
use std::hashmap::HashMap;
223+
use std::ptr;
223224
use std::vec;
224225
use syntax::ast;
225226
use syntax::ast::Ident;
@@ -2046,7 +2047,10 @@ pub fn store_arg(mut bcx: @mut Block,
20462047
// Debug information (the llvm.dbg.declare intrinsic to be precise) always expects to get an
20472048
// alloca, which only is the case on the general path, so lets disable the optimized path when
20482049
// debug info is enabled.
2049-
let fast_path = !bcx.ccx().sess.opts.extra_debuginfo && simple_identifier(pat).is_some();
2050+
let arg_is_alloca = unsafe { llvm::LLVMIsAAllocaInst(llval) != ptr::null() };
2051+
2052+
let fast_path = (arg_is_alloca || !bcx.ccx().sess.opts.extra_debuginfo)
2053+
&& simple_identifier(pat).is_some();
20502054

20512055
if fast_path {
20522056
// Optimized path for `x: T` case. This just adopts

0 commit comments

Comments
 (0)