This is an archive of the discontinued LLVM Phabricator instance.

CodeGen: Strip exception specifications from function types in CFI type names.
ClosedPublic

Authored by pcc on Dec 2 2021, 5:46 PM.

Details

Summary

With C++17 the exception specification has been made part of the
function type, and therefore part of mangled type names.

However, it's valid to convert function pointers with an exception
specification to function pointers with the same argument and return
types but without an exception specification, which means that e.g. a
function of type "void () noexcept" can be called through a pointer
of type "void ()". We must therefore consider the two types to be
compatible for CFI purposes.

We can do this by stripping the exception specification before mangling
the type name, which is what this patch does.

Diff Detail

Event Timeline

pcc requested review of this revision.Dec 2 2021, 5:46 PM
pcc created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptDec 2 2021, 5:46 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
This revision is now accepted and ready to land.Dec 3 2021, 5:47 AM

I patched this in and verified that it fixes the make_top_domain_list_variables issue in https://bugs.chromium.org/p/chromium/issues/detail?id=1273966 and went ahead and landed this. Thanks!