This is an archive of the discontinued LLVM Phabricator instance.

stop using associative comdats for SEH filter functions
ClosedPublic

Authored by inglorion on Feb 17 2017, 2:05 PM.

Details

Summary

We implement structured exception handling (SEH) by generating filter functions for functions that use exceptions. Currently, we use associative comdats to ensure that the filter functions are preserved if and only if the functions we generated them for are preserved. This can lead to problems when generating COFF objects - LLVM may decide to inline a function that uses SEH and remove its body, at which point we will end up with a comdat that COFF cannot represent. To avoid running into that situation, this change makes us not use associative comdats for SEH filter functions. We can still get the benefits we used the associative comdats for: we will always preserve filter functions we use, and dead stripping can eliminate the ones we don't use.

Diff Detail

Repository
rL LLVM

Event Timeline

inglorion created this revision.Feb 17 2017, 2:05 PM

With this change, LLVM, Clang, and lld compile using LTO and pass tests on Windows. Without the change, the tests fail to compile ("Associative COMDAT symbol ... does not exist", https://bugs.llvm.org//show_bug.cgi?id=31974).

rnk accepted this revision.Feb 17 2017, 4:20 PM

LGTM. The fact that we didn't apply the comdat when the try was internal indicates that we've encountered this before.

This revision is now accepted and ready to land.Feb 17 2017, 4:20 PM
This revision was automatically updated to reflect the committed changes.