[flang-commits] [flang] [flang] Use precompiled parsing headers (PR #130600)
Kajetan Puchalski via flang-commits
flang-commits at lists.llvm.org
Mon Mar 10 06:45:09 PDT 2025
================
@@ -72,3 +72,11 @@ add_flang_library(flangFrontend
clangBasic
clangDriver
)
+
+target_precompile_headers(flangFrontend PRIVATE
+ [["flang/Parser/parsing.h"]]
+ [["flang/Parser/parse-tree.h"]]
+ [["flang/Parser/dump-parse-tree.h"]]
+ [["flang/Lower/PFTBuilder.h"]]
+ [["flang/Lower/Bridge.h"]]
+)
----------------
mrkajetanp wrote:
Sort of, doing that would work except that we can either only re-use or only precompile everything from scratch for a given target. Re-using then adding extra ones doesn't work because of how this is implemented in CMake from what I can tell.
```
CMake will halt with an error if the PRECOMPILE_HEADERS property of <target> is already set when the REUSE_FROM form is used.
```
In this case I could precompile the Parser ones under Parser/, but then I wouldn't be able to add the Lower/ ones for the frontend. Since the Lower/ ones pull in the parse tree headers anyway, that somewhat beats the point of doing this.
The intention here was "precompile some of the headers that Frontend will need then link them to the Frontend".
https://github.com/llvm/llvm-project/pull/130600
More information about the flang-commits
mailing list