[PATCH] D82129: [DebugInfo] Drop location ranges for variables which exist entirely outside the variable's scope

Adrian Prantl via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 19 15:46:39 PDT 2020


aprantl added inline comments.


================
Comment at: llvm/lib/CodeGen/AsmPrinter/DbgEntityHistoryCalculator.cpp:201
+    for (auto EI = HistoryMapEntries.begin(), EE = HistoryMapEntries.end();
+         EI != EE; ++EI, ++StartIndex) {
+      // Only DBG_VALUEs can open location ranges so skip anything else.
----------------
Orlando wrote:
> aprantl wrote:
> > this looks like it could be a range-based for loop?
> I agree that this loop is a little bit ugly; I'm doing it this way to update `StartIndex`.
I see. I guess that is better than 

```
for (auto EI : HistoryMapEntries) {
  LLVM_DEFER { StartIndex++; };
  ...
```


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D82129/new/

https://reviews.llvm.org/D82129





More information about the llvm-commits mailing list