[PATCH] Debug info: Teach the SDag type legalizer how to split up debug info for integer values that are split into a hi and lo part.

David Blaikie dblaikie at gmail.com
Mon Sep 15 15:56:13 PDT 2014


================
Comment at: test/DebugInfo/X86/sdagsplit-1.ll:10
@@ +9,3 @@
+;      long long res = b+1;
+;      if ( a == b )
+;        return res;
----------------
Some comments about what these bits of code are trying to demonstrate would be helpful.

Sometimes I find test cases easier to understand by using stubs to indicate which pieces I care about and why I care about them. (eg: if I need a variable to be 'used' I just have a sink function declared: "void sink(long long)" and call that - helps make it clear that I just want the variable to be used, not that I'm particularly interested in op== comparison, say)

In any case, it'd be helpful to understand what things this code is meant to demonstrate - probably apparent in the test case either by comment or self-documenting techniques like I described.

Given that you're just testing the location of 'res' - is there any reason you need the a and b parameters at all?

================
Comment at: test/DebugInfo/X86/sdagsplit-1.ll:19
@@ +18,3 @@
+; CHECK: [[LOC]]:
+; eax, piece 0x00000004, edx, piece 0x00000004
+; CHECK:   Location description: 50 93 04 52 93 04
----------------
what's the parameter to piece (the 0x00000004)? It might be helpful for this comment to use the DW_OP names and name the parameters here to make the expression a bit more explicit?

(I'm picturing something like what, I assume, Apple's dwarfdump does to print DWARF expressions)

http://reviews.llvm.org/D4832






More information about the llvm-commits mailing list