[PATCH] D94217: [clang-format] Find main include after block ended with #pragma hdrstop

RafaƂ Jelonek via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 7 08:34:50 PST 2021


rjelonek added a comment.

heh, maybe you seen unexpectedly closed IDE, errors while expanding list in source editor or blinking gui, etc ;D
I made plugin to use clang-format in Builder.

After reading the msvc documentation, I agree with you.  `#pragma hdrstop( "c:\\projects\\include\\myinc.pch" )` should be supported, also. I will change this soon.
Builder just ignore everything after `#pragma hdrstop` to the end of line. I check it on Builder ver. XE7



================
Comment at: clang/lib/Format/Format.cpp:2308
         IncludesInBlock.clear();
-        FirstIncludeBlock = false;
+        if (Trimmed == "#pragma hdrstop") // precompiled headers
+          FirstIncludeBlock = true;
----------------
MyDeveloperDay wrote:
> Should this handle this form?
> 
> ```
> #pragma hdrstop( "c:\\projects\\include\\myinc.pch" )
> ```
No


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D94217



More information about the cfe-commits mailing list