RFR (tedious) 8216022: Use #pragma once
Kim Barrett
kim.barrett at oracle.com
Thu Jan 3 21:30:43 UTC 2019
> On Jan 3, 2019, at 2:26 PM, Erik Österlund <erik.osterlund at oracle.com> wrote:
>
> It happens quite a lot actually. For example, it looks like there are currently 126 barrier set files, of which 67 are header files. I had something to do with most of them. I will never forget the include guard horrors when *BarrierSetAssembler was renamed.
>
> Sometimes I think the include guard horrors make us grow files too large, because of that extra overhead of creating a new file. Same goes for renaming or moving files that obviously have the wrong name or are in the wrong directory, like memory/heap.hpp, that should arguably be code/codeHeap.hpp.
>
> Not to talk about when the "vm" directory was dropped. We are still living in the aftermath of that, and include guards now inconsistently sometimes have the VM_ prefix and sometimes not depending on how old the file is and how the author of new files since then have thought about it. Did they want to blend in with the old (wrong) prefix, or use the correct prefix? Or when the gc_interface/gc_implementation directories were removed, making all GC files move. Ouch.
I mentioned it in my earlier reply, but it may have been lost in the clutter. This looks pretty useful for such scenarios:
https://github.com/cgmb/guardonce
Utilities for converting from C/C++ include guards to #pragma once and back again.
More information about the hotspot-dev
mailing list