This patch prepares the necessary interfaces in the preprocessor part for D137527 since we need to recognize if we're in a module unit, the module kinds and the module declaration and the module we're importing in the preprocessor.
Details
Diff Detail
Event Timeline
clang/include/clang/Lex/Preprocessor.h | ||
---|---|---|
321–322 | This is needed since in fact we use @import in objective-c++ mode. See the test for example. |
I'm not familiar with standard C++ modules. @Bigcheese any thoughts?
clang/include/clang/Lex/Preprocessor.h | ||
---|---|---|
2372 | Preprocessor::isNamedModule() is bit misleading. How about Preprocessor::isInNamedModule()? Similar for other Preprocessor::is*() functions this patch introduces. |
clang/unittests/Lex/CMakeLists.txt | ||
---|---|---|
21 | It seems strange layering-wise that the Lex unit tests would depend on Frontend. Is there any way to prevent that dep? |
It looks like this causes a minor compile-time regression (about 0.2% on O0 builds): http://llvm-compile-time-tracker.com/compare.php?from=ad81d019a62d33e5d1f232844b83d3e164e4b160&to=6470706bc0ed2425704bc8c9e121a72e2d272616&stat=instructions:u
I wanted to check whether this is expected (as I don't think CTMark even compiles anything in C++20 mode).
This is strange since all the codes would only work if there is an import. And I didn't introduce any loops so it shouldn't cause compile-time regression.
clang/unittests/Lex/CMakeLists.txt | ||
---|---|---|
21 | I see. I'll try to look at it. |
clang/unittests/Lex/CMakeLists.txt | ||
---|---|---|
21 | I've addressed this in https://github.com/llvm/llvm-project/commit/54cf24dc6e6317f7a77f8a320f1fbccc31ea7291. |
This is needed since in fact we use @import in objective-c++ mode. See the test for example.