[llvm-commits] [llvm] r112213 - in /llvm/trunk/lib/CodeGen/SelectionDAG: SelectionDAGBuilder.cpp SelectionDAGBuilder.h
Devang Patel
dpatel at apple.com
Thu Aug 26 13:06:46 PDT 2010
Author: dpatel
Date: Thu Aug 26 15:06:46 2010
New Revision: 112213
URL: http://llvm.org/viewvc/llvm-project?rev=112213&view=rev
Log:
Update DanglingDebugInfo so that it can be used to track llvm.dbg.declare also.
Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp?rev=112213&r1=112212&r2=112213&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp Thu Aug 26 15:06:46 2010
@@ -875,12 +875,23 @@
void SelectionDAGBuilder::resolveDanglingDebugInfo(const Value *V,
SDValue Val) {
DanglingDebugInfo &DDI = DanglingDebugInfoMap[V];
- if (DDI.getDI()) {
- const DbgValueInst *DI = DDI.getDI();
+ MDNode *Variable = NULL;
+ uint64_t Offset = 0;
+
+ if (const DbgValueInst *DI = dyn_cast_or_null<DbgValueInst>(DDI.getDI())) {
+ Variable = DI->getVariable();
+ Offset = DI->getOffset();
+ } else if (const DbgDeclareInst *DI =
+ dyn_cast_or_null<DbgDeclareInst>(DDI.getDI()))
+ Variable = DI->getVariable();
+ else {
+ assert (DDI.getDI() == NULL && "Invalid debug info intrinsic!");
+ return;
+ }
+
+ if (Variable) {
DebugLoc dl = DDI.getdl();
unsigned DbgSDNodeOrder = DDI.getSDNodeOrder();
- MDNode *Variable = DI->getVariable();
- uint64_t Offset = DI->getOffset();
SDDbgValue *SDV;
if (Val.getNode()) {
if (!EmitFuncArgumentDbgValue(V, Variable, Offset, Val)) {
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h?rev=112213&r1=112212&r2=112213&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h Thu Aug 26 15:06:46 2010
@@ -36,7 +36,7 @@
class BitCastInst;
class BranchInst;
class CallInst;
-class DbgValueInst;
+class DbgInfoIntrinsic;
class ExtractElementInst;
class ExtractValueInst;
class FCmpInst;
@@ -96,14 +96,14 @@
/// DanglingDebugInfo - Helper type for DanglingDebugInfoMap.
class DanglingDebugInfo {
- const DbgValueInst* DI;
+ const DbgInfoIntrinsic* DI;
DebugLoc dl;
unsigned SDNodeOrder;
public:
DanglingDebugInfo() : DI(0), dl(DebugLoc()), SDNodeOrder(0) { }
- DanglingDebugInfo(const DbgValueInst *di, DebugLoc DL, unsigned SDNO) :
+ DanglingDebugInfo(const DbgInfoIntrinsic *di, DebugLoc DL, unsigned SDNO) :
DI(di), dl(DL), SDNodeOrder(SDNO) { }
- const DbgValueInst* getDI() { return DI; }
+ const DbgInfoIntrinsic* getDI() { return DI; }
DebugLoc getdl() { return dl; }
unsigned getSDNodeOrder() { return SDNodeOrder; }
};
More information about the llvm-commits
mailing list