[PATCH] D63508: make -frewrite-includes also rewrite conditions in #if/#elif

Luboš Luňák via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Jun 30 10:33:41 PDT 2019


llunak updated this revision to Diff 207229.
llunak added a comment.

Updated the patch again, commenting out just a part of #if didn't work either, so it seems there's no good way to comment out unwanted #if. This patch surrounds rewritten #if conditions by extra #if 0 #endif block to disable them, moreover it makes the conditions be part of an empty #if #endif block, so they do not break nesting.

I've also created https://reviews.llvm.org/D63979 to verify that the results in fact do compile.


Repository:
  rC Clang

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

https://reviews.llvm.org/D63508

Files:
  clang/lib/Frontend/Rewrite/InclusionRewriter.cpp
  clang/test/Frontend/rewrite-includes-conditions.c
  clang/test/Frontend/rewrite-includes.c
  clang/test/Modules/preprocess-module.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D63508.207229.patch
Type: text/x-patch
Size: 19750 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190630/d3c886e3/attachment-0001.bin>


More information about the cfe-commits mailing list