[PATCH] D112088: [clang][deps] Keep #pragma push_macro, pop_macro and include_alias when minimizing source code.

Sylvain Audi via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 19 11:27:50 PDT 2021


saudi created this revision.
saudi added reviewers: dexonsmith, jansvoboda11, Bigcheese.
saudi added a project: clang.
Herald added a subscriber: jeroen.dobbelaere.
saudi requested review of this revision.
Herald added a subscriber: cfe-commits.

The `#pragma` directives `push_macro`/`pop_macro` and `include_alias` may influence the `#include` / `import` directives encountered by dependency scanning tools like `clang-scan-deps`.

This patch ensures that those directives are not removed during source code minimization.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D112088

Files:
  clang/include/clang/Lex/DependencyDirectivesSourceMinimizer.h
  clang/lib/Lex/DependencyDirectivesSourceMinimizer.cpp
  clang/test/ClangScanDeps/Inputs/preprocess_minimized_pragmas.h
  clang/test/ClangScanDeps/Inputs/preprocess_minimized_pragmas_cdb.json
  clang/test/ClangScanDeps/preprocess_minimized_pragmas.cpp
  clang/test/Lexer/minimize_source_to_dependency_directives_pragmas.c
  clang/unittests/Lex/DependencyDirectivesSourceMinimizerTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D112088.380735.patch
Type: text/x-patch
Size: 8941 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20211019/ec6cdbf3/attachment.bin>


More information about the cfe-commits mailing list