[PATCH] Debug info: Support fragmented variables.
Eric Christopher
echristo at gmail.com
Mon Feb 10 17:11:00 PST 2014
I've got a few comments on the code, but there's no update for the documentation in SourceLevelDebugging.html. How about we get that solidified first so we've got a good idea of what format we're looking at for the metadata.
================
Comment at: include/llvm/DebugInfo.h:684
@@ +683,3 @@
+ uint64_t getPieceOffset() const;
+ /// getPieceOffset - Return the offset of this piece in bytes.
+ uint64_t getPieceSize() const;
----------------
Cut and paste.
================
Comment at: lib/CodeGen/AsmPrinter/DwarfDebug.cpp:1320
@@ +1319,3 @@
+static HistoryIter
+nextOverlappingHistroyEntry(HistoryIter DbgVal, HistoryIter End) {
+ DIVariable DV0 = getDbgVar(*DbgVal);
----------------
Typo in function name.
================
Comment at: lib/CodeGen/AsmPrinter/DwarfDebug.cpp:1305
@@ +1304,3 @@
+static DIVariable getDbgVar(const MachineInstr *MI) {
+ const MDNode *Var = MI->getOperand(MI->getNumOperands() - 1).getMetadata();
+ return DIVariable(Var);
----------------
Would probably be nice to have a function for getDebugMetadata or something for MachineInstr instead of the subtraction.
================
Comment at: lib/Transforms/Scalar/SROA.cpp:426
@@ -419,1 +425,3 @@
+ // Make a best effort to find a dbg.declare intrinsic describing
+ // the alloca by peeking at the next instruction.
----------------
Can't you just get the users here?
================
Comment at: lib/Transforms/Scalar/SROA.cpp:947
@@ +946,3 @@
+ ArrayRef<AllocaSlices::iterator> SplitUses,
+ DIBuilder &DIB);
+ bool splitAlloca(AllocaInst &AI, AllocaSlices &S, DIBuilder &DIB);
----------------
Instead of passing all of these down it should be possible to construct one.
http://llvm-reviews.chandlerc.com/D2680
More information about the llvm-commits
mailing list