5 Commits

Author SHA1 Message Date
Chuanqi Xu
fc0144a30c
[Serialization] Read the initializer for interesting static variables before consuming it (#92353)
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. 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.
2024-05-20 10:36:03 +08:00
Chuanqi Xu
3c2638dae5 Revert "[Serialization] Read the initializer for interesting static variables before consuming it (#92218)"
This reverts commit 3a4c1b9b4428b08d4475decf74c11e0d328c5842.

This breaks a bot on clang-s390x-linux
2024-05-16 13:59:11 +08:00
Chuanqi Xu
3a4c1b9b44
[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.
2024-05-16 09:55:36 +08:00
Mehdi Amini
eb103104ef Revert "[Serialization] Read the initializer for interesting static variables before consuming it"
This reverts commit 11b059145d177ee287c7ada9864addf8d083c160.

The premerge bot is broken.
2024-05-14 19:53:38 -07:00
Chuanqi Xu
11b059145d [Serialization] Read the initializer for interesting static variables before consuming it
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. 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.
2024-05-15 10:29:49 +08:00