Since D69561 we started to import readonly vars with non-trivial initializers. However this isn't always the case with compile time constants, because thin LTO analysis pass is not always detecting them as readonly. Such thing happens in two cases:
- constant object is referenced in initializer of some other object
- constant object is referenced by instruction which is not non-volatile load.
This patch forces read-only attribute for constants, regardless of their usage
Does the change to the write only initialization affect anything user visible? I was trying to reason through it but haven't convinced myself either way. I.e. will it affect which variables are internalized/zeroinitialized?