[PATCH] D107095: Implement #pragma clang header_unsafe

Chris Bieneman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 2 12:22:38 PDT 2021


beanz added a reviewer: lattner.
beanz added a subscriber: lattner.
beanz added a comment.

+ at 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:1417 Random drive-by, but in non-LTO builds of clang, this is adding an unnecessary call/return on the expansion path for all non-deprecated macros (the common case).  I'd recommend something like:
>
> // Inline in header:
> void emitMacroExpansionWarnings(const Token &Identifier) {
>  if (Identifier.getIdentifierInfo()->isDeprecatedMacro())
>
>   emitMacroExpansionWarningsImpl(Identifier);
>
> }
>
> and then put emitMacroExpansionWarningsImpl in the .cpp file.

Thanks!


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D107095/new/

https://reviews.llvm.org/D107095



More information about the cfe-commits mailing list