llvm.org GIT mirror llvm / f2ec7ae
Update DanglingDebugInfo so that it can be used to track llvm.dbg.declare also. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112213 91177308-0d34-0410-b5e6-96231b3b80d8 Devang Patel 10 years ago
2 changed file(s) with 19 addition(s) and 8 deletion(s). Raw diff Collapse all Expand all
874874 void SelectionDAGBuilder::resolveDanglingDebugInfo(const Value *V,
875875 SDValue Val) {
876876 DanglingDebugInfo &DDI = DanglingDebugInfoMap[V];
877 if (DDI.getDI()) {
878 const DbgValueInst *DI = DDI.getDI();
877 MDNode *Variable = NULL;
878 uint64_t Offset = 0;
879
880 if (const DbgValueInst *DI = dyn_cast_or_null(DDI.getDI())) {
881 Variable = DI->getVariable();
882 Offset = DI->getOffset();
883 } else if (const DbgDeclareInst *DI =
884 dyn_cast_or_null(DDI.getDI()))
885 Variable = DI->getVariable();
886 else {
887 assert (DDI.getDI() == NULL && "Invalid debug info intrinsic!");
888 return;
889 }
890
891 if (Variable) {
879892 DebugLoc dl = DDI.getdl();
880893 unsigned DbgSDNodeOrder = DDI.getSDNodeOrder();
881 MDNode *Variable = DI->getVariable();
882 uint64_t Offset = DI->getOffset();
883894 SDDbgValue *SDV;
884895 if (Val.getNode()) {
885896 if (!EmitFuncArgumentDbgValue(V, Variable, Offset, Val)) {
3535 class BitCastInst;
3636 class BranchInst;
3737 class CallInst;
38 class DbgValueInst;
38 class DbgInfoIntrinsic;
3939 class ExtractElementInst;
4040 class ExtractValueInst;
4141 class FCmpInst;
9595
9696 /// DanglingDebugInfo - Helper type for DanglingDebugInfoMap.
9797 class DanglingDebugInfo {
98 const DbgValueInst* DI;
98 const DbgInfoIntrinsic* DI;
9999 DebugLoc dl;
100100 unsigned SDNodeOrder;
101101 public:
102102 DanglingDebugInfo() : DI(0), dl(DebugLoc()), SDNodeOrder(0) { }
103 DanglingDebugInfo(const DbgValueInst *di, DebugLoc DL, unsigned SDNO) :
103 DanglingDebugInfo(const DbgInfoIntrinsic *di, DebugLoc DL, unsigned SDNO) :
104104 DI(di), dl(DL), SDNodeOrder(SDNO) { }
105 const DbgValueInst* getDI() { return DI; }
105 const DbgInfoIntrinsic* getDI() { return DI; }
106106 DebugLoc getdl() { return dl; }
107107 unsigned getSDNodeOrder() { return SDNodeOrder; }
108108 };