RFR: 8350212: Track source end positions of declarations that support @SuppressWarnings [v4]
Maurizio Cimadamore
mcimadamore at openjdk.org
Fri May 30 10:15:53 UTC 2025
On Thu, 29 May 2025 21:53:42 GMT, Archie Cobbs <acobbs at openjdk.org> wrote:
> From what I could tell, the `EndPosTable` is never null in the existing code. Assuming that's the case, there's no point in optimizing any code to avoid the use of `EndPosTable` just because it might not be there. So my patch includes some cleanups along these lines, for example, adding a new `EndPosTable` to the `TreeInfo.endPos()` method, thereby making it "safe" to use with any node type.
Note, I still think we're mixing up the functions: `TreeInfo::endPos` doesn't even look at the end pos table before this PR! It's `TreeInfo::getEndPos` that does. The difference in method name is maddeningly subtle, but the two methods are rather different beasts -- as you point out `TreeInfo::endPos` is really a special method that only works on a subset of block-like nodes -- and that has nothing to do with the problem you are trying to solve.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/23669#issuecomment-2921908921
More information about the compiler-dev
mailing list