RFR: 8365829: Multiple definitions of static 'phase_names' [v2]
Kim Barrett
kbarrett at openjdk.org
Wed Aug 20 19:38:36 UTC 2025
On Wed, 20 Aug 2025 14:45:53 GMT, Francesco Andreuzzi <duke at openjdk.org> wrote:
>> `phase_name` is accessed by `static CompilerPhaseType find_phase`, should we make it a `friend` of the `CompilerPhaseTypeHelper`?
>
> Underscore: 90e9c537709ad4c384f7efd2ed18c63a4c21b51b
Don't make it a friend, make it a static member function, and fix the one
caller (later in this file). (The definition of find_phase could be moved to
the new .cpp file.) I think the caller also has an ODR problem, with calls
from different including TUs getting a different file-scoped find_phase.
It looks like there might be a lot of file-scoped static declarations from
header files in our code. I've made a note to look into this.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/26851#discussion_r2289113847
More information about the hotspot-compiler-dev
mailing list