llvm.org GIT mirror llvm / 8e741ed
Tidy up. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112858 91177308-0d34-0410-b5e6-96231b3b80d8 Devang Patel 10 years ago
1 changed file(s) with 11 addition(s) and 13 deletion(s). Raw diff Collapse all Expand all
40634063 }
40644064 case Intrinsic::dbg_declare: {
40654065 const DbgDeclareInst &DI = cast(I);
4066 if (!DIVariable(DI.getVariable()).Verify())
4066 MDNode *Variable = DI.getVariable();
4067 const Value *Address = DI.getAddress();
4068 if (!Address || !DIVariable(DI.getVariable()).Verify())
40674069 return 0;
4068
4069 MDNode *Variable = DI.getVariable();
4070 // Parameters are handled specially.
4071 bool isParameter =
4072 DIVariable(Variable).getTag() == dwarf::DW_TAG_arg_variable;
4073 const Value *Address = DI.getAddress();
4074 if (!Address)
4075 return 0;
4076 if (const BitCastInst *BCI = dyn_cast(Address))
4077 Address = BCI->getOperand(0);
4078 const AllocaInst *AI = dyn_cast(Address);
40794070
40804071 // Build an entry in DbgOrdering. Debug info input nodes get an SDNodeOrder
40814072 // but do not always have a corresponding SDNode built. The SDNodeOrder
40884079 N = UnusedArgNodeMap[Address];
40894080 SDDbgValue *SDV;
40904081 if (N.getNode()) {
4082 // Parameters are handled specially.
4083 bool isParameter =
4084 DIVariable(Variable).getTag() == dwarf::DW_TAG_arg_variable;
4085 if (const BitCastInst *BCI = dyn_cast(Address))
4086 Address = BCI->getOperand(0);
4087 const AllocaInst *AI = dyn_cast(Address);
4088
40914089 if (isParameter && !AI) {
40924090 FrameIndexSDNode *FINode = dyn_cast(N.getNode());
40934091 if (FINode)
41124110 if (!EmitFuncArgumentDbgValue(Address, Variable, 0, N)) {
41134111 SDV = DAG.getDbgValue(Variable, UndefValue::get(Address->getType()),
41144112 0, dl, SDNodeOrder);
4115 DAG.AddDbgValue(SDV, 0, isParameter);
4113 DAG.AddDbgValue(SDV, 0, false);
41164114 }
41174115 }
41184116 return 0;