This is an archive of the discontinued LLVM Phabricator instance.

[clang] Set function attributes on SEH filter functions correctly.
ClosedPublic

Authored by sanwou01 on Jan 15 2020, 9:59 AM.

Details

Summary

When compiling with -munwind-tables, the SEH filter funclet needs the uwtable
function attribute, which gets automatically added if we use
SetInternalFunctionAttributes. The filter funclet is internal so this seems
appropriate.

Diff Detail

Event Timeline

sanwou01 created this revision.Jan 15 2020, 9:59 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 15 2020, 9:59 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
rnk added a comment.Jan 15 2020, 10:55 AM

Thanks, the code change looks good, but please adjust the tests a bit.

clang/test/CodeGen/exceptions-seh-finally.c
284–286

We shouldn't be marking this thing noinline. I believe it appears because clang applies noinline everywhere at O0. Please add -O1 -disable-llvm-passes to the RUN line so that it doesn't appear. The appearance of nounwind should be expected, so keep that here.

clang/test/CodeGenCXX/exceptions-seh-filter-uwtable.cpp
2

Is "arm64-windowsj" a typo? Also, please add -O1 -disable-llvm-passes as above.

sanwou01 updated this revision to Diff 238431.Jan 16 2020, 1:57 AM

Fix tests, thanks rnk

sanwou01 marked 2 inline comments as done.Jan 16 2020, 1:57 AM
rnk accepted this revision.Jan 16 2020, 10:56 AM

lgtm, just some test comment tweaks.

clang/test/CodeGen/exceptions-seh-finally.c
3

I guess it would be best to move the comment about why we pass -O1 -disable-llvm-passes here. We are doing it to avoid applying optnone and noinline attributes everywhere.

284–286

Please leave at least "Look for the absence of noinline." from the original comment. I think I added this test because we used to mark these noinline.

This revision is now accepted and ready to land.Jan 16 2020, 10:56 AM
This revision was automatically updated to reflect the committed changes.
sanwou01 marked 2 inline comments as done.Jan 17 2020, 10:14 AM