HomePhabricator

[WebAssembly] Fix the order of destructors in the LowerGlobalDtors pass.

Authored by sunfishcode on Nov 24 2019, 7:27 AM.

Description

[WebAssembly] Fix the order of destructors in the LowerGlobalDtors pass.

Fix the LowerGlobalDtors pass to run destructors in the same order as the
regular LLVM destructor lowering -- in reverse order. Adjacent
destructors with the same associated object are grouped, but destructors
are not reordered based on associated objects.

Differential Revision: https://reviews.llvm.org/D70685