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

MyDeveloperDay via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 7 02:24:16 PST 2021


MyDeveloperDay added a comment.

I've not used this before, but you seem to be suggesting that `#pragma hdrstop` should be used to determine when the files main header should now be placed?

Could you explain a little more as to why you think that should be the case (i.e. is there a technical reason as to why, I'm happy to be educated).



================
Comment at: clang/lib/Format/Format.cpp:2308
         IncludesInBlock.clear();
-        FirstIncludeBlock = false;
+        if (Trimmed == "#pragma hdrstop") // precompiled headers
+          FirstIncludeBlock = true;
----------------
Should this handle this form?

```
#pragma hdrstop( "c:\\projects\\include\\myinc.pch" )
```


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