[PATCH] Change representation of instruction ranges where variable is accessible.

David Blaikie dblaikie at gmail.com
Tue May 27 15:04:18 PDT 2014


================
Comment at: lib/CodeGen/AsmPrinter/DwarfDebug.cpp:1385
@@ -1384,3 @@
-        assert(MI.getNumOperands() > 1 && "Invalid machine instruction!");
-        // Keep track of user variables in order of appearance. Create the
-        // empty history for each variable so that the order of keys in
----------------
Alexey Samsonov wrote:
> David Blaikie wrote:
> > Did the need for this ahead-of-time initialization of the MapVector go away in your change? How?
> Yes, it went away. Need for ahead-of-time initialization is somewhat ugly, this really should be responsibility of calculateDbgValueHistory().
> 
> calculateDbgValueHistory() traverses all machine instructions in function, and the first time we see a DBG_VALUE for a new variable, it will
> be added to map by the call to "startInstrRange()".
> 
Was there a reason this wasn't possible previously? (I seem to recall this was kept around in the previous commit to provide stability to the output? - why is the "on first use" order stable now?)

It might've been helpful to pull this out as a separate commit if it's an isolated piece of cleanup (if it's not isolated I wouldn't mind unedrstanding what is it about the rest of your change that changed things here so that this was no longer needed)

http://reviews.llvm.org/D3861






More information about the llvm-commits mailing list