swift
11d92e97 - SILOptimizer: Don't optimize initializers for dynamically-sized globals

Commit
5 years ago
SILOptimizer: Don't optimize initializers for dynamically-sized globals If the size of a global variable is not known at compile time, we emit a fixed size buffer together with initialization code when the global variable is initialized. Make sure the SIL optimizer does not convert this into a static initialization, even if the size of the type is known inside the module where the global is declared, because we don't have a way to statically initialize something that looks like a fixed-size buffer to client code. Fixes <https://bugs.swift.org/browse/SR-11709>.
Author
Committer
Parents
  • lib
    • IRGen
      • File
        IRGenSIL.cpp
    • SILOptimizer/IPO
      • File
        GlobalOpt.cpp
  • test/SILOptimizer
    • File
      globalopt_resilience_testing.swift