diff options
author | Chuanqi Xu <yedeng.yd@linux.alibaba.com> | 2024-05-16 09:55:36 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-16 09:55:36 +0800 |
commit | 3a4c1b9b4428b08d4475decf74c11e0d328c5842 (patch) | |
tree | b9b2c3ff8f4364d59622417f0086f06aafad35e3 /flang/lib/Frontend/CompilerInvocation.cpp | |
parent | 1595988ee6f9732e7ea79928af8a470ad5ef7dbe (diff) | |
download | llvm-3a4c1b9b4428b08d4475decf74c11e0d328c5842.zip llvm-3a4c1b9b4428b08d4475decf74c11e0d328c5842.tar.gz llvm-3a4c1b9b4428b08d4475decf74c11e0d328c5842.tar.bz2 |
[Serialization] Read the initializer for interesting static variables before consuming it (#92218)
Close https://github.com/llvm/llvm-project/issues/91418
Since we load the variable's initializers lazily, it'd be problematic if
the initializers dependent on each other.
For example,
```
SomeType a = ...;
SomeType b = a;
```
Previously, when we load variable `b`, we need to load the initializer,
then we need to load `a`. We can only mark the variable `b` as loaded
after we load `a`. Then `a` is always initialized before `b`. However,
it is not true after we implement lazy loading for initializers.
So here we try to load the initializers of static variables to make sure
they are passed to code generator by order. If we read any thing
interesting, we would consume that before emitting the current
declaration.
Diffstat (limited to 'flang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions