This is an archive of the discontinued LLVM Phabricator instance.

[clang][slh] add attribute for speculative load hardening
ClosedPublic

Authored by zbrid on Nov 26 2018, 2:00 PM.

Details

Summary

The prior diff had to be reverted because there were two tests
that failed. I updated the two tests in this diff

clang/test/Misc/pragma-attribute-supported-attributes-list.test
clang/test/SemaCXX/attr-speculative-load-hardening.cpp

  • Summary from Previous Diff (Still Accurate) -----

LLVM IR already has an attribute for speculative_load_hardening. Before
this commit, when a user passed the -mspeculative-load-hardening flag to
Clang, every function would have this attribute added to it. This Clang
attribute will allow users to opt into SLH on a function by function basis.

This can be applied to functions and Objective C methods.

Diff Detail

Repository
rL LLVM

Event Timeline

zbrid created this revision.Nov 26 2018, 2:00 PM
zbrid marked 2 inline comments as done.Nov 26 2018, 2:02 PM
zbrid added inline comments.
clang/test/Misc/pragma-attribute-supported-attributes-list.test
119 ↗(On Diff #175336)

This is the other change (also see line 5) that fixed a test which was failing the build after committing the last diff.

clang/test/SemaCXX/attr-speculative-load-hardening.cpp
19 ↗(On Diff #175336)

I didn't have the clang namespace on the attributes here after changing the spelling to Clang from CXX11.

aaron.ballman accepted this revision.Nov 26 2018, 2:28 PM

LGTM!

Btw, if you're fixing an issue with something you had to revert due to bots, you can use your own judgement and commit the fixed code without review. However, if the fix is extensive or you want to get second opinions on the changes, then by all means get more review on it.

This revision is now accepted and ready to land.Nov 26 2018, 2:28 PM
zbrid added a comment.Nov 26 2018, 4:05 PM

Oh okay. Thanks for the info!

This revision was automatically updated to reflect the committed changes.