[PATCH] Avoid empty .debug_loc entries and lists

Duncan P. N. Exon Smith dexonsmith at apple.com
Sun Jun 21 10:12:15 PDT 2015

>> Thanks for the reviews all.  I'll come back to this early next week.
>> A few things I'm (still) not clear on:
>> 1. My original patches created fewer variables, skipping ones with no
>>   ranges.  Instead, should we still create the variables with no
>>   ranges attached?  (Just as easy for me either way.)
> Possible that this is what you wanted to say anyway, but to clarify:
> Is it doable to produce the variables without a DW_AT_location?
> I believe that it is a better experience if the debugger can tell you that a variable has been optimized away rather than returning, e.g., a long and confusing expression parse error.

Okay, I've committed something along these lines in r240244 (note that I
also committed r240243 to simplify/clarify initialization of `DbgVariable`
-- and I think a lot more could be done there, maybe a tagged union or
subclasses or something?).

>> 2. Variables that are known a priori not to have any ranges are skipped
>>   right now (aren't created unless they're function parameters).  My
>>   patches don't affect this logic at all, but depending on (1) it
>>   sounds kind of fishy.  Should we be creating them *always*, just not
>>   attaching ranges if they've been optimized out?  If so, I'll file a
>>   PR.
> I think we should be emitting them.


> -- adrian

More information about the llvm-commits mailing list