[PATCH] D107095: Implement #pragma clang header_unsafe

2021-08-23 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. This revision is now accepted and ready to land. LGTM! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D107095/new/ https://reviews.llvm.org/D107095

[PATCH] D107095: Implement #pragma clang header_unsafe

2021-08-20 Thread Chris Bieneman via Phabricator via cfe-commits
beanz updated this revision to Diff 367863. beanz added a comment. Missed updating the flag name. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D107095/new/ https://reviews.llvm.org/D107095 Files: clang/docs/LanguageExtensions.rst clang/include

[PATCH] D107095: Implement #pragma clang header_unsafe

2021-08-20 Thread Chris Bieneman via Phabricator via cfe-commits
beanz updated this revision to Diff 367861. beanz added a comment. Cleaning up documentation wording to make more sense with the rename Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D107095/new/ https://reviews.llvm.org/D107095 Files: clang/docs/

[PATCH] D107095: Implement #pragma clang header_unsafe

2021-08-20 Thread Chris Bieneman via Phabricator via cfe-commits
beanz updated this revision to Diff 367856. beanz added a comment. Fixing documentation line wrapping. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D107095/new/ https://reviews.llvm.org/D107095 Files: clang/docs/LanguageExtensions.rst clang/in

[PATCH] D107095: Implement #pragma clang header_unsafe

2021-08-20 Thread Chris Bieneman via Phabricator via cfe-commits
beanz updated this revision to Diff 367851. beanz added a comment. Renaming to restrict_expansion Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D107095/new/ https://reviews.llvm.org/D107095 Files: clang/docs/LanguageExtensions.rst clang/include

[PATCH] D107095: Implement #pragma clang header_unsafe

2021-08-12 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D107095#2940638 , @beanz wrote: > +@lebedev.ri > > @aaron.ballman thank you for all the feedback and support! > > I'm not really sure where to go on the naming. I'm not attached to > `header_unsafe`, and totally understa

[PATCH] D107095: Implement #pragma clang header_unsafe

2021-08-11 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added a reviewer: lebedev.ri. beanz added a subscriber: lebedev.ri. beanz added a comment. +@lebedev.ri @aaron.ballman thank you for all the feedback and support! I'm not really sure where to go on the naming. I'm not attached to `header_unsafe`, and totally understand the confusion. I do

[PATCH] D107095: Implement #pragma clang header_unsafe

2021-08-11 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. The technical bits all LGTM, thank you for the functionality! There was a comment on IRC that `header_unsafe` might be confusing to users as it may suggest that the *header* is unsafe rather than the use of the macro. I don't know if we resolved the naming questio

[PATCH] D107095: Implement #pragma clang header_unsafe

2021-08-10 Thread Chris Bieneman via Phabricator via cfe-commits
beanz updated this revision to Diff 365487. beanz added a comment. Updated docs, added header-unsafe-macro diag group, and added test case to verify that the -Wpedantic-macros warnings don't trip on eachother. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.ll

[PATCH] D107095: Implement #pragma clang header_unsafe

2021-08-10 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/docs/LanguageExtensions.rst:3916 +processed by the preprocessor after the ``#pragma`` annotation will log a +a warning. For example: + May want to put something in here along the lines of: Redefining the macr

[PATCH] D107095: Implement #pragma clang header_unsafe

2021-08-10 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added inline comments. Comment at: clang/test/Lexer/Inputs/unsafe-macro-2.h:23-26 +// not-expected-warning@+1{{macro 'UNSAFE_MACRO_2' has been marked as unsafe for use in headers}} +#undef UNSAFE_MACRO_2 +// not-expected-warning@+1{{macro 'UNSAFE_MACRO_2' has been marked a

[PATCH] D107095: Implement #pragma clang header_unsafe

2021-08-10 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/test/Lexer/Inputs/unsafe-macro-2.h:23-26 +// not-expected-warning@+1{{macro 'UNSAFE_MACRO_2' has been marked as unsafe for use in headers}} +#undef UNSAFE_MACRO_2 +// not-expected-warning@+1{{macro 'UNSAFE_MACRO_2' has been

[PATCH] D107095: Implement #pragma clang header_unsafe

2021-08-10 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added inline comments. Comment at: clang/test/Lexer/Inputs/unsafe-macro-2.h:23-26 +// not-expected-warning@+1{{macro 'UNSAFE_MACRO_2' has been marked as unsafe for use in headers}} +#undef UNSAFE_MACRO_2 +// not-expected-warning@+1{{macro 'UNSAFE_MACRO_2' has been marked a

[PATCH] D107095: Implement #pragma clang header_unsafe

2021-08-10 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/include/clang/Basic/DiagnosticLexKinds.td:535 +def note_pp_macro_annotation : + Note<"macro marked %select{deprecated|header_unsafe}0 here">; + Repository: rG LLVM Github Monorepo CHANGES SINCE LAST AC

[PATCH] D107095: Implement #pragma clang header_unsafe

2021-08-10 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/test/Lexer/Inputs/unsafe-macro-2.h:23-26 +// not-expected-warning@+1{{macro 'UNSAFE_MACRO_2' has been marked as unsafe for use in headers}} +#undef UNSAFE_MACRO_2 +// not-expected-warning@+1{{macro 'UNSAFE_MACRO_2' has been

[PATCH] D107095: Implement #pragma clang header_unsafe

2021-08-09 Thread Chris Bieneman via Phabricator via cfe-commits
beanz updated this revision to Diff 365324. beanz added a comment. Updating documentation to be more clear about the behavior. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D107095/new/ https://reviews.llvm.org/D107095 Files: clang/docs/LanguageE

[PATCH] D107095: Implement #pragma clang header_unsafe

2021-08-09 Thread Chris Bieneman via Phabricator via cfe-commits
beanz updated this revision to Diff 365322. beanz added a comment. Addressing feedback by @aaron.ballman. If the pattern I used for the note diagnostic is good here, I'll apply it to the deprecated extension too. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://review

[PATCH] D107095: Implement #pragma clang header_unsafe

2021-08-09 Thread Chris Bieneman via Phabricator via cfe-commits
beanz marked 5 inline comments as done. beanz added a comment. @aaron.ballman, thanks for the feedback! Some comments, but I'll work on updated patches and try to get them up tonight or tomorrow morning. Comment at: clang/docs/LanguageExtensions.rst:3913 +Clang supports the p

[PATCH] D107095: Implement #pragma clang header_unsafe

2021-08-09 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/docs/LanguageExtensions.rst:3913 +Clang supports the pragma ``#pragma clang header_unsafe``, which can be used to +mark macros as unsafe to use in headers. This can be valuable when providing +headers with ABI stability requi

[PATCH] D107095: Implement #pragma clang header_unsafe

2021-08-02 Thread Chris Bieneman via Phabricator via cfe-commits
beanz updated this revision to Diff 363550. beanz added a comment. Updates based on post-commit feedback from @lattner on D106732 . This should inline the determination for emitting warnings, but keep the actual warning emission in a call. Repository: rG LLV

[PATCH] D107095: Implement #pragma clang header_unsafe

2021-08-02 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added a reviewer: lattner. beanz added a subscriber: lattner. beanz added a comment. +@lattner, Chris provided some post-commit feedback on the macro deprecation patch, I'll address his feedback here since I'm touching the same code. Chris' feedback is: > /clang/lib/Lex/Preprocessor.cpp:

[PATCH] D107095: Implement #pragma clang header_unsafe

2021-07-29 Thread Chris Bieneman via Phabricator via cfe-commits
beanz updated this revision to Diff 362856. beanz added a comment. Re-adding a newline that was inadvertently remvoed. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D107095/new/ https://reviews.llvm.org/D107095 Files: clang/docs/LanguageExtension