- Mar 07, 2022
-
-
Jan Svoboda authored
This test started failing on Windows after b45888e9 due to path separators not matching up.
-
Jan Svoboda authored
Since D106876, PCM files don't report module maps as input files unless they contributed to the compilation. Reporting only module maps of (transitively) imported modules is not enough, though. For modules marked with `[no_undeclared_includes]`, other module maps affect the compilation by introducing anti-dependencies. This patch makes sure such module maps are being reported as input files. Depends on D120463. Reviewed By: dexonsmith Differential Revision: https://reviews.llvm.org/D120464
-
Jan Svoboda authored
This patch simplifies a test that checks only used module map files are reported as input files in PCM files. Instead of using opaque `diff`, this patch uses `clang -module-file-info` and `FileCheck` to verify this. Reviewed By: dexonsmith Differential Revision: https://reviews.llvm.org/D120463
-
- Mar 01, 2022
-
-
Iain Sandoe authored
Implementation partitions bring two extra cases where we have visibility of module-private data. 1) When we import a module implementation partition. 2) When a partition implementation imports the primary module intertace. We maintain a record of direct imports into the current module since partition decls from direct imports (but not trasitive ones) are visible. The rules on decl-reachability are much more relaxed (with the standard giving permission for an implementation to load dependent modules and for the decls there to be reachable, but not visible). Differential Revision: https://reviews.llvm.org/D118599
-
- Feb 26, 2022
-
-
Iain Sandoe authored
We cannot export partition implementation CMIs, but we can export the content of partition interface CMIs. Differential Revision: https://reviews.llvm.org/D118588
-
- Feb 25, 2022
-
-
Iain Sandoe authored
Partition implementations are special, they generate a CMI, but it does not have an 'export' line, and we cannot export anything from the it [that is it can only make decls available to other members of the owning module, not to importers of that]. Add initial testcases for partition handling, derived from the examples in Section 10 of the C++20 standard, which identifies what should be accepted and/or rejected. Differential Revision: https://reviews.llvm.org/D118587
-
- Feb 24, 2022
-
-
Aaron Ballman authored
This patch adds -Wno-strict-prototypes to all of the test cases that use functions without prototypes, but not as the primary concern of the test. e.g., attributes testing whether they can/cannot be applied to a function without a prototype, etc. This is done in preparation for enabling -Wstrict-prototypes by default.
-
Iain Sandoe authored
This implements the parsing and recognition of module partition CMIs and removes the FIXMEs in the parser. Module partitions are recognised in the base computation of visibility, however additional amendments to visibility follow in subsequent patches. Differential Revision: https://reviews.llvm.org/D118586
-
- Feb 23, 2022
-
-
Jan Svoboda authored
This patch enables inferring framework modules in explicit builds in all contexts. Until now, inferring framework modules only worked with `-fimplicit-module-maps` due to this block of code: ``` // HeaderSearch::loadFrameworkModule case LMM_InvalidModuleMap: // Try to infer a module map from the framework directory. if (HSOpts->ImplicitModuleMaps) ModMap.inferFrameworkModule(Dir, IsSystem, /*Parent=*/nullptr); break; ``` Reviewed By: Bigcheese Differential Revision: https://reviews.llvm.org/D113880
-
iains authored
This switches the testcase committed for initial C++20 modules import tracking to use split-file rather than preprocessor directives. Differential Revision: https://reviews.llvm.org/D120352
-
Iain Sandoe authored
It is useful to be able to visualise the C++20 modules content of a PCM file both for inspection and for testing. In particular, when adding more module types to support C++20 Partitions and Header Units, we would like to be able to confirm that the output PCM has the intended structure. The existing scheme for dumping data is restricted to the content of the AST file control block, which does not include structural data beyond imports. The change here makes use of the AST unit that is set up by BeginSourceFile to query for the information on the primary and sub-modules. We can then inspect each of these in turn, accounting for Global, Private, Imported and Exported modules/fragments and then showing the sub-stucture of the main module(s). The disadvantage of this mechanism is that it has no easy method to control the granularity of the output. Perhaps more detailed inspection would be better handled by a stand-alone module inspection tool. Differential Revision: https://reviews.llvm.org/D119823
-
- Feb 21, 2022
-
-
Iain Sandoe authored
In C++20 modules imports must be together and at the start of the module. Rather than growing more ad-hoc flags to test state, this keeps track of the phase of of a valid module TU (first decl, global module frag, module, private module frag). If the phasing is broken (with some diagnostic) the pattern does not conform to a valid C++20 module, and we set the state accordingly. We can thus issue diagnostics when imports appear in the wrong places and decouple the C++20 modules state from other module variants (modules-ts and clang modules). Additionally, we attempt to diagnose wrong imports before trying to find the module where possible (the latter will generally emit an unhelpful diagnostic about the module not being available). Although this generally simplifies the handling of C++20 module import diagnostics, the motivation was that, in particular, it allows detecting invalid imports like: import module A; int some_decl(); import module B; where being in a module purview is insufficient to identify them. Differential Revision: https://reviews.llvm.org/D118893
-
- Feb 20, 2022
-
-
Iain Sandoe authored
This reverts commit 8a3f9a58. need to investigate build failures that do not show on CI or local testing.
-
Iain Sandoe authored
In C++20 modules imports must be together and at the start of the module. Rather than growing more ad-hoc flags to test state, this keeps track of the phase of of a valid module TU (first decl, global module frag, module, private module frag). If the phasing is broken (with some diagnostic) the pattern does not conform to a valid C++20 module, and we set the state accordingly. We can thus issue diagnostics when imports appear in the wrong places and decouple the C++20 modules state from other module variants (modules-ts and clang modules). Additionally, we attempt to diagnose wrong imports before trying to find the module where possible (the latter will generally emit an unhelpful diagnostic about the module not being available). Although this generally simplifies the handling of C++20 module import diagnostics, the motivation was that, in particular, it allows detecting invalid imports like: import module A; int some_decl(); import module B; where being in a module purview is insufficient to identify them. Differential Revision: https://reviews.llvm.org/D118893
-
- Feb 11, 2022
-
-
ZezhengLi authored
An impilt used of C++ module without prebuild path may cause crash. For example: ``` // ./dir1/C.cppm export module C; // ./dir2/B.cppm export module B; import C; // ./A.cpp import B; import C; ``` When we compile A.cpp without the prebuild path of C.pcm, the compiler will crash. ``` clang++ -std=c++20 --precompile -c ./dir1/C.cppm -o ./dir1/C.pcm clang++ -std=c++20 --precompile -fprebuilt-module-path=./dir2 -c ./dir2/B.cppm -o ./dir2/B.pcm clang++ -std=c++20 -fprebuilt-module-path=./dir2 A.cpp ``` The prebuilt path of module C is cached when import module B, and in the function HeaderSearch::getCachedModuleFileName, the compiler try to get the filename by modulemap without check if modulemap exists, and there is no modulemap in C++ module. Reviewed By: ChuanqiXu Differential review: https://reviews.llvm.org/D119426
-
- Feb 10, 2022
-
-
Aaron Ballman authored
A significant number of our tests in C accidentally use functions without prototypes. This patch converts the function signatures to have a prototype for the situations where the test is not specific to K&R C declarations. e.g., void func(); becomes void func(void); This is the seventh batch of tests being updated (there are a significant number of other tests left to be updated).
-
- Jan 28, 2022
-
-
Chuanqi Xu authored
-
- Jan 24, 2022
-
-
Timm Bäder authored
The test case otherwise fails an assertion in Diagnostic::getArgKind(). Differential Revision: https://reviews.llvm.org/D116595
-
- Jan 17, 2022
-
-
Jake Egan authored
This patch emits an error on AIX and z/OS because XCOFF and GOFF does not currently implement builtin function `CFStringMakeConstantString`. Tests that use this builtin were also disabled. Reviewed By: SeanP Differential Revision: https://reviews.llvm.org/D117315
-
- Jan 16, 2022
-
-
hyeongyu kim authored
Turning on `enable_noundef_analysis` flag allows better codegen by removing freeze instructions. I modified clang by renaming `enable_noundef_analysis` flag to `disable-noundef-analysis` and turning it off by default. Test updates are made as a separate patch: D108453 Reviewed By: eugenis Differential Revision: https://reviews.llvm.org/D105169
-
- Jan 14, 2022
-
-
Chuanqi Xu authored
This patch fixes a crash due to following simple program: > export struct Unit { > bool operator<(const Unit&); > }; It would crash since the compiler would set the module ownership for Unit. And the declaration with a module ownership is assumed to own a module. But here isn't one. So here is the crash. This patch fixes this by exiting early if it finds the export decl is already invalid. Reviewed By: aaron.ballman Differential Revision: https://reviews.llvm.org/D117093
-
- Jan 11, 2022
-
-
Nick Desaulniers authored
As suggested in: https://reviews.llvm.org/D114895#3177794 X will be converted to i by SelectionDAGISEL anyways. Reviewed By: void, jyknight Differential Revision: https://reviews.llvm.org/D115311
-
Chuanqi Xu authored
The compiler would crash if we lookup for name in transparent decl context. See the tests attached for example. I think this should make sense since the member declared in transparent DeclContext are semantically defined in the enclosing (non-transparent) DeclContext, this is the definition for transparent DeclContext. Reviewed By: erichkeane Differential Revision: https://reviews.llvm.org/D116792
-
Adrian Prantl authored
Because of commit: https://reviews.llvm.org/D104291 the -gmodules .pcm files do not have the same DW_AT_language dialect as the .o file. This was a simple matter of passing the DebugStrictDwarf flag to the PCHContainerGenerator object's CodeGenOpts from the CompilerInstance passed in to it. Before this change if you ran dwarfdump on the gmodule cache folder you would get DW_AT_language (DW_LANG_C_plus_plus) even when using -std=c++14 with clang Patch by Shubham Rastogi! Differential Revision: https://reviews.llvm.org/D116790
-
- Jan 10, 2022
-
-
David Goldman authored
Clang will now search through the framework includes to identify the framework include path to a file, and then suggest a framework style include spelling for the file. Differential Revision: https://reviews.llvm.org/D115183
-
- Dec 23, 2021
-
-
Chuanqi Xu authored
In C++20 Modules, imported module which doesn't get exported wouldn't be recorded. This patch would record such modules to avoid possible incorrect visibility problems. Reviewed By: urnathan Differential Revision: https://reviews.llvm.org/D116098
-
Chuanqi Xu authored
This reverts commit 368318bc. The title is not right. It should be a patch about modules instead of coroutines.
-
Chuanqi Xu authored
In C++20 Modules, imported module which doesn't get exported wouldn't be recorded. This patch would record such modules to avoid possible incorrect visibility problems. Reviewed By: urnathan Differential Revision: https://reviews.llvm.org/D116098
-
- Dec 22, 2021
-
-
Chuanqi Xu authored
-
Chuanqi Xu authored
This commit adds two test about template class instantiation in transitively imported module. They are used as pre-commit tests for successive patches. Differential Revision: https://reviews.llvm.org/D116097
-
- Dec 21, 2021
-
-
Chuanqi Xu authored
Revert "[NFC] [C++20] [Modules] Add tests for template instantiation in transitively imported module" This reverts commit 4f103e95. The tests couldn't pass under windows.
-
Chuanqi Xu authored
This commit adds two test about template class instantiation in transitively imported module. They are used as pre-commit tests for successive patches.
-
- Dec 17, 2021
-
-
Chuanqi Xu authored
Implement `getUnresolvedUsingType()` and don't create a new `UnresolvedUsingType` when there is already canonical declaration. This solved an incorrect ODR detection in modules for uresolved using type. Reviewed By: rjmccall Differential Revision: https://reviews.llvm.org/D115792
-
- Dec 08, 2021
-
-
Chuanqi Xu authored
The compiler would judge two concepts is same by their addresses. However, when we use modules, the addresses wouldn't be the same all the time since one is parsed in their TU and another is imported in another TU. This patch fixes this by using isSameEntity to judge the two concepts. Reviewed By: rsmith Differential Revision: https://reviews.llvm.org/D114769
-
- Nov 24, 2021
-
-
Zarko Todorovski authored
Part of work to use more inclusive terms in clang/llvm.
-
- Nov 18, 2021
-
-
Jan Svoboda authored
-
Ilya Kuteev authored
Problem: PCM file includes references to all module maps used in compilation which created PCM. This problem leads to PCM-rebuilds in distributed compilations as some module maps could be missing in isolated compilation. (For example in our distributed build system we create a temp folder for every compilation with only modules and headers that are needed for that particular command). Solution: Add only affecting module map files to a PCM-file. Reviewed By: rsmith Differential Revision: https://reviews.llvm.org/D106876
-
- Nov 11, 2021
-
-
Kai Luo authored
Reviewed By: jsji Differential Revision: https://reviews.llvm.org/D113654
-
- Nov 08, 2021
-
-
Volodymyr Sapsai authored
Merge definition visibility the same way we do for other decls. Without the fix the added test emits `-Wobjc-method-access` as it cannot find a visible protocol. Make this warning `-Werror` so the test would fail when protocol visibility regresses. rdar://83600696 Differential Revision: https://reviews.llvm.org/D111860
-
hyeongyu kim authored
Revert "[Clang/Test]: Rename enable_noundef_analysis to disable-noundef-analysis and turn it off by default" This reverts commit aacfbb95. Revert "Fix lit test failures in CodeGenCoroutines" This reverts commit 63fff0f5.
-