[PATCH] D65761: Add Windows Control Flow Guard checks (/guard:cf).

2019-08-05 Thread Andrew Paverd via Phabricator via cfe-commits
ajpaverd created this revision. Herald added subscribers: llvm-commits, cfe-commits, dexonsmith, steven_wu, hiraditya, kristof.beyls, javed.absar, mgorny, mehdi_amini. Herald added projects: clang, LLVM. A new module pass (Transforms/CFGuard/CFGuard.cpp) inserts CFGuard checks on indirect functio

[PATCH] D65761: Add Windows Control Flow Guard checks (/guard:cf).

2019-10-04 Thread Andrew Paverd via Phabricator via cfe-commits
ajpaverd updated this revision to Diff 223167. ajpaverd marked 22 inline comments as done. ajpaverd added a comment. Improved Control Flow Guard implementation. As suggested by @rnk, the CFGuard dispatch mechanism now uses a new `cfguardtarget` operand bundle to pass the indirect call target. In

[PATCH] D65761: Add Windows Control Flow Guard checks (/guard:cf).

2019-10-04 Thread Andrew Paverd via Phabricator via cfe-commits
ajpaverd added a comment. In D65761#1660121 , @rnk wrote: > Here is some feedback, I apologize for dragging my feet. > > Also, I would really like to get feedback from @pcc. He's OOO currently, > though. Thanks for this really helpful feedback @rnk! I t

[PATCH] D65761: Add Windows Control Flow Guard checks (/guard:cf).

2019-10-04 Thread Andrew Paverd via Phabricator via cfe-commits
ajpaverd marked 9 inline comments as done. ajpaverd added inline comments. Comment at: clang/include/clang/Driver/Options.td:500 def b : JoinedOrSeparate<["-"], "b">, Flags<[Unsupported]>; +def cfguard_no_checks : Flag<["-"], "cfguard-no-checks">, Flags<[CC1Option]>, + HelpText

[PATCH] D65761: Add Windows Control Flow Guard checks (/guard:cf).

2019-10-21 Thread Andrew Paverd via Phabricator via cfe-commits
ajpaverd updated this revision to Diff 225943. ajpaverd marked 6 inline comments as done. ajpaverd added a comment. Final changes and tests suggested by @rnk. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D65761/new/ https://reviews.llvm.org/D65761

[PATCH] D65761: Add Windows Control Flow Guard checks (/guard:cf).

2019-10-21 Thread Andrew Paverd via Phabricator via cfe-commits
ajpaverd updated this revision to Diff 225955. ajpaverd marked 3 inline comments as done. ajpaverd added a comment. Formatting fixes for CFGuard patch. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D65761/new/ https://reviews.llvm.org/D65761 Files:

[PATCH] D65761: Add Windows Control Flow Guard checks (/guard:cf).

2019-10-23 Thread Andrew Paverd via Phabricator via cfe-commits
ajpaverd updated this revision to Diff 226164. ajpaverd added a comment. Split cfguard_setjmp test into target-specific tests and add missing cfguard_longjmp pass for ARM and AArch64. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D65761/new/ https:

[PATCH] D65761: Add Windows Control Flow Guard checks (/guard:cf).

2020-06-24 Thread Andrew Paverd via Phabricator via cfe-commits
ajpaverd added a comment. Herald added a reviewer: jdoerfert. In D65761#2102525 , @mehdi_amini wrote: > It seems like this pass was added in lib/Transforms but does not have any > unit-tests (lit tests) provided. It isn't even linked into `opt`. As it is

[PATCH] D65761: Add Windows Control Flow Guard checks (/guard:cf).

2019-08-29 Thread Andrew Paverd via Phabricator via cfe-commits
ajpaverd added a comment. In D65761#1646059 , @rnk wrote: > I plan to take a look at this tomorrow, sorry for putting this off for a > while. :( Thanks @rnk! If there's anything I can clarify/fix, please let me know. Repository: rG LLVM Github Monor

[PATCH] D72167: Add support for __declspec(guard(nocf))

2020-01-03 Thread Andrew Paverd via Phabricator via cfe-commits
ajpaverd created this revision. ajpaverd added reviewers: rnk, dmajor, pcc, hans. Herald added subscribers: llvm-commits, cfe-commits, hiraditya. Herald added projects: clang, LLVM. Avoid using the `nocf_check` attribute with Control Flow Guard. Instead, use a new `"guard_nocf"` function attribut

[PATCH] D65761: Add Windows Control Flow Guard checks (/guard:cf).

2020-01-03 Thread Andrew Paverd via Phabricator via cfe-commits
ajpaverd added a comment. In D65761#1772076 , @dmajor wrote: > Well, this patch specifically has code (even a test) that `nocf_check` > prevents CFG, so it looks like the intent was there, it's just that there > isn't a way to get that attribute onto fun

[PATCH] D72167: Add support for __declspec(guard(nocf))

2020-01-07 Thread Andrew Paverd via Phabricator via cfe-commits
ajpaverd updated this revision to Diff 236572. ajpaverd marked 5 inline comments as done. ajpaverd added a comment. Make guard_nocf an attribute of individual call instructions Instead of using "guard_nocf" as a function attribute, make this an attribute on individual call instructions for which

[PATCH] D72167: Add support for __declspec(guard(nocf))

2020-01-07 Thread Andrew Paverd via Phabricator via cfe-commits
ajpaverd added a comment. In D72167#1803395 , @aaron.ballman wrote: > Can you please add some Sema tests that verify the attribute only appertains > to functions, accepts the right number of arguments, etc? Also, some tests > showing how this attribute

[PATCH] D72167: Add support for __declspec(guard(nocf))

2020-01-07 Thread Andrew Paverd via Phabricator via cfe-commits
ajpaverd added a comment. In D72167#180 , @dmajor wrote: > Thanks for doing this! > > When I applied this patch and added `__declspec(guard(nocf))` to the function > that was giving us trouble >

[PATCH] D72167: Add support for __declspec(guard(nocf))

2020-01-08 Thread Andrew Paverd via Phabricator via cfe-commits
ajpaverd updated this revision to Diff 236806. ajpaverd added a comment. - Make guard_nocf an attribute of individual call instructions Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72167/new/ https://reviews.llvm.org/D72167 Files: clang/include

[PATCH] D72167: Add support for __declspec(guard(nocf))

2020-01-08 Thread Andrew Paverd via Phabricator via cfe-commits
ajpaverd updated this revision to Diff 236906. ajpaverd marked 7 inline comments as done. ajpaverd added a comment. - Address comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72167/new/ https://reviews.llvm.org/D72167 Files: clang/include/

[PATCH] D72167: Add support for __declspec(guard(nocf))

2020-01-08 Thread Andrew Paverd via Phabricator via cfe-commits
ajpaverd added a comment. Thanks for the feedback @aaron.ballman and @dmajor! Comment at: clang/include/clang/Basic/Attr.td:2914 + let Spellings = [Declspec<"guard">]; + let Subjects = SubjectList<[Function]>; + let Args = [EnumArgument<"Guard", "GuardArg", ["nocf"], ["nocf"

[PATCH] D65761: Add Windows Control Flow Guard checks (/guard:cf).

2020-01-10 Thread Andrew Paverd via Phabricator via cfe-commits
ajpaverd added a comment. In D65761#1811097 , @hubert.reinterpretcast wrote: > In D65761#1804302 , > @hubert.reinterpretcast wrote: > > > I have confirmed that the case I mentioned fails with rGd157a9b > >

[PATCH] D75047: Add Control Flow Guard in Clang release notes.

2020-02-24 Thread Andrew Paverd via Phabricator via cfe-commits
ajpaverd created this revision. ajpaverd added a reviewer: hans. Herald added a project: clang. Herald added a subscriber: cfe-commits. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D75047 Files: clang/docs/ReleaseNotes.rst Index: clang/docs/ReleaseNotes.rst

[PATCH] D75047: Add Control Flow Guard in Clang release notes.

2020-02-25 Thread Andrew Paverd via Phabricator via cfe-commits
ajpaverd added a comment. In D75047#1890976 , @hans wrote: > Do you have commits access, or would you like me to commit for you? I don't yet have commit access. Please could you commit this for me. Thanks! Repository: rG LLVM Github Monorepo CHANGES