diff options
author | Devang Patel <dpatel@apple.com> | 2010-09-15 18:13:55 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2010-09-15 18:13:55 +0000 |
commit | 46b96c4ba0b3720d26683e3fc1b7f7aed5c8405a (patch) | |
tree | ecaf9d5809200dc4ee5ba1bda3acdac2cbad479f /llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | |
parent | 73982b94e3b2c8ed30c3648128aa734b8f56b4a3 (diff) | |
download | bcm5719-llvm-46b96c4ba0b3720d26683e3fc1b7f7aed5c8405a.tar.gz bcm5719-llvm-46b96c4ba0b3720d26683e3fc1b7f7aed5c8405a.zip |
Check bb to ensure that alloca is in separate basic block.
This fixes funcargs.exp regression reported by gdb testsuite.
llvm-svn: 113992
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp index db3ca111738..b29a5b5ffec 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp @@ -4122,13 +4122,15 @@ SelectionDAGBuilder::visitIntrinsicCall(const CallInst &I, unsigned Intrinsic) { // If variable is pinned by a alloca in dominating bb then // use StaticAllocaMap. if (const AllocaInst *AI = dyn_cast<AllocaInst>(Address)) { - DenseMap<const AllocaInst*, int>::iterator SI = - FuncInfo.StaticAllocaMap.find(AI); - if (SI != FuncInfo.StaticAllocaMap.end()) { - SDV = DAG.getDbgValue(Variable, SI->second, - 0, dl, SDNodeOrder); - DAG.AddDbgValue(SDV, 0, false); - return 0; + if (AI->getParent() != DI.getParent()) { + DenseMap<const AllocaInst*, int>::iterator SI = + FuncInfo.StaticAllocaMap.find(AI); + if (SI != FuncInfo.StaticAllocaMap.end()) { + SDV = DAG.getDbgValue(Variable, SI->second, + 0, dl, SDNodeOrder); + DAG.AddDbgValue(SDV, 0, false); + return 0; + } } } // Otherwise add undef to help track missing debug info. |