[PATCH] Debug info: Support fragmented variables.

Adrian Prantl aprantl at apple.com
Tue Feb 11 15:45:18 PST 2014


On Feb 10, 2014, at 17:11, Eric Christopher <echristo at gmail.com> wrote:

> 
>  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: 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.

Sure, I’ll add this later.

> 
> ================
> 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?

AFAIK debug intrinsics are no regular users, right?
> 
> ================
> 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.
> 

I was concerned that it would be a lot more expensive if we construct a new down here.

-- adrian



More information about the llvm-commits mailing list