[PATCH] D55721: llvm-dwarfdump: Improve/fix pretty printing of array dimensions
Paul Robinson via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Dec 17 08:10:39 PST 2018
probinson added a comment.
In D55721#1331847 <https://reviews.llvm.org/D55721#1331847>, @dblaikie wrote:
> In D55721#1331812 <https://reviews.llvm.org/D55721#1331812>, @probinson wrote:
>
> > Note that the lower-bound might be implicit, but it's never "unknown."
> > We do need to account for the cases where the implicit lower-bound is 1. The Fortran people will need this, and the OpenVMS folks support several other languages that also have a default LB of 1.
> >
> > Using `[C]` (C = count) for both the count-only and upper-bound-only cases suggests that we're being descriptive rather than carefully reflecting the attributes that are in the subrange DIE, which is fine. So, if an explicit LB matches the language default, then the display should also be `[C]` (where C = count if we have a count, or C = U + (1 - L) if we have upper_bound).
>
>
> The only change you're suggesting is to detect when an explicit LB matches the language default, and treating that case the same as if the LB were not specified (in terms of how it's printed out)?
Sorry, no, in the course of editing the comment I lost the important part: When converting UB-only to Count, you need to correctly factor in the default LB: `C = UB + (1 - DefaultLBForLanguage)` otherwise the display for 1-based languages will be incorrect.
Then, since you have to know the default LB anyway, the rest seems not too hard.
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D55721/new/
https://reviews.llvm.org/D55721
More information about the llvm-commits
mailing list