[PATCH] D94202: Preserve the lexical order of global variables during llvm-link merge

Jin Lin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 2 09:13:11 PST 2021


jinlin added a comment.

In D94202#2597598 <https://reviews.llvm.org/D94202#2597598>, @jdoerfert wrote:

> This looks brittle and wrong to fiddle with the initializers of the variables and doing some complex logic.
> You want to preserve the order, ok, couldn't we just sort the globals in the resulting module according to the order in the source(s)?

Sorry I have sent the wrong patch to the review and it causes many lit cases fails.

The order of the globals is determined when the globals are generated. If you want to sort the order, you have to regenerate the globals and replace the old ones with new ones.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D94202/new/

https://reviews.llvm.org/D94202



More information about the llvm-commits mailing list