[PATCH] D57918: Add an attribute that causes clang to emit fortified calls to C stdlib functions

2019-03-13 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a subscriber: jyknight. erik.pilkington marked 2 inline comments as done. erik.pilkington added a comment. Herald added a subscriber: jdoerfert. I reverted this in r356103: Revert "Add a new attribute, fortify_stdlib" This reverts commit r353765. After talking with

[PATCH] D57918: Add an attribute that causes clang to emit fortified calls to C stdlib functions

2019-02-11 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington marked 8 inline comments as done. erik.pilkington added inline comments. Comment at: clang/include/clang/Basic/AttrDocs.td:987-989 +The first argument to the attribute is the type passed to +`__builtin_object_size`, and the second is the flag that the fortified

[PATCH] D57918: Add an attribute that causes clang to emit fortified calls to C stdlib functions

2019-02-11 Thread Phabricator via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL353765: Add a new attribute, fortify_stdlib (authored by epilk, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed prior to commit:

[PATCH] D57918: Add an attribute that causes clang to emit fortified calls to C stdlib functions

2019-02-11 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. LGTM aside from some very minor nits. Comment at: clang/include/clang/Basic/AttrDocs.td:987-989 +The first argument to the attribute is the type passed to +`__builtin_object_size`, and the second is the flag

[PATCH] D57918: Add an attribute that causes clang to emit fortified calls to C stdlib functions

2019-02-11 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington updated this revision to Diff 186300. erik.pilkington added a comment. Link to the GCC docs for `__builitn_object_size`. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D57918/new/ https://reviews.llvm.org/D57918 Files: clang/include/clang/Basic/Attr.td

[PATCH] D57918: Add an attribute that causes clang to emit fortified calls to C stdlib functions

2019-02-11 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington marked an inline comment as done. erik.pilkington added inline comments. Comment at: clang/include/clang/Basic/AttrDocs.td:987-989 +The first argument to the attribute is the type passed to +`__builtin_object_size`, and the second is the flag that the fortified

[PATCH] D57918: Add an attribute that causes clang to emit fortified calls to C stdlib functions

2019-02-11 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/include/clang/Basic/AttrDocs.td:987-989 +The first argument to the attribute is the type passed to +`__builtin_object_size`, and the second is the flag that the fortified format +functions accept. Maybe I'm

[PATCH] D57918: Add an attribute that causes clang to emit fortified calls to C stdlib functions

2019-02-08 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added inline comments. Comment at: clang/include/clang/Basic/AttrDocs.td:987 + +Only a specific set of standard library functions are supported: + - memcpy aaron.ballman wrote: > And we don't have Annex K versions for any of these, like

[PATCH] D57918: Add an attribute that causes clang to emit fortified calls to C stdlib functions

2019-02-08 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington updated this revision to Diff 186028. erik.pilkington marked 2 inline comments as done. erik.pilkington added a comment. Describe what the arguments do in the docs. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D57918/new/ https://reviews.llvm.org/D57918 Files:

[PATCH] D57918: Add an attribute that causes clang to emit fortified calls to C stdlib functions

2019-02-08 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/include/clang/Basic/Attr.td:1572 + let Spellings = [Clang<"fortify_stdlib">]; + let Args = [IntArgument<"Type">, IntArgument<"Flag">]; + let Subjects = SubjectList<[Function]>; Nothing in the docs

[PATCH] D57918: Add an attribute that causes clang to emit fortified calls to C stdlib functions

2019-02-08 Thread John McCall via Phabricator via cfe-commits
rjmccall accepted this revision. rjmccall added a comment. This revision is now accepted and ready to land. LGTM, thanks! Comment at: clang/include/clang/Basic/AttrDocs.td:986 + } + }]; +} erik.pilkington wrote: > rjmccall wrote: > > Probably worth

[PATCH] D57918: Add an attribute that causes clang to emit fortified calls to C stdlib functions

2019-02-08 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington updated this revision to Diff 186013. erik.pilkington marked 5 inline comments as done. erik.pilkington added a comment. Address John's comments. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D57918/new/ https://reviews.llvm.org/D57918 Files:

[PATCH] D57918: Add an attribute that causes clang to emit fortified calls to C stdlib functions

2019-02-08 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added inline comments. Comment at: clang/include/clang/Basic/AttrDocs.td:986 + } + }]; +} rjmccall wrote: > Probably worth clarifying somewhere in here that only a specific set of > stdlib functions are supported. I don't know that it's

[PATCH] D57918: Add an attribute that causes clang to emit fortified calls to C stdlib functions

2019-02-07 Thread John McCall via Phabricator via cfe-commits
rjmccall added inline comments. Comment at: clang/include/clang/Basic/AttrDocs.td:986 + } + }]; +} Probably worth clarifying somewhere in here that only a specific set of stdlib functions are supported. I don't know that it's important to spell that set

[PATCH] D57918: Add an attribute that causes clang to emit fortified calls to C stdlib functions

2019-02-07 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington created this revision. erik.pilkington added reviewers: aaron.ballman, rjmccall, eli.friedman. Herald added subscribers: dexonsmith, jkorous. Herald added a project: clang. This attribute applies to declarations of C stdlib functions (sprintf, memcpy...) that have known fortified