llvm-project/clang/lib/Serialization
Michael Kruse 2130117f92 [Clang][OpenMP] Allow loop-transformations with template parameters.
Clang would reject

    #pragma omp for
    #pragma omp tile sizes(P)
    for (int i = 0; i < 128; ++i) {}

where P is a template parameter, but the loop itself is not
template-dependent. Because P context-dependent, the TransformedStmt
cannot be generated and therefore is nullptr (until the template is
instantiated by TreeTransform). The OMPForDirective would still expect
the a loop is the dependent context and trigger an error.

Fix by introducing a NumGeneratedLoops field to OMPLoopTransformation.
This is used to distinguish the case where no TransformedStmt will be
generated at all (e.g. #pragma omp unroll full) and template
instantiation is needed. In the latter case, delay resolving the
iteration space like when the for-loop itself is template-dependent
until the template instatiation.

A more radical solution would always delay the iteration space analysis
until template instantiation, but would also break many test cases.

Reviewed By: ABataev

Differential Revision: https://reviews.llvm.org/D111124
2021-10-06 12:21:04 -05:00
..
ASTCommon.cpp [Clang] Add __ibm128 type to represent ppc_fp128 2021-09-06 18:00:58 +08:00
ASTCommon.h
ASTReader.cpp [clang][NFC] refactor GlobalMethodPool to encapsulate its map 2021-09-16 14:02:14 -07:00
ASTReaderDecl.cpp [clang] Replace report_fatal_error(std::string) uses with report_fatal_error(Twine) 2021-10-06 11:43:19 +01:00
ASTReaderInternals.h
ASTReaderStmt.cpp [Clang][OpenMP] Allow loop-transformations with template parameters. 2021-10-06 12:21:04 -05:00
ASTWriter.cpp [clang] Introduce SourceLocation::[U]IntTy typedefs. 2021-07-21 10:45:46 +01:00
ASTWriterDecl.cpp [clang] p1099 using enum part 2 2021-06-08 11:11:46 -07:00
ASTWriterStmt.cpp [Clang][OpenMP] Allow loop-transformations with template parameters. 2021-10-06 12:21:04 -05:00
CMakeLists.txt [openmp] Base of tablegen generated OpenMP common declaration 2020-06-23 10:32:32 -04:00
GeneratePCH.cpp [pch] Honour -fallow-pch-with-compiler-errors for overall compilation status 2020-03-31 13:50:12 -07:00
GlobalModuleIndex.cpp [clang][NFC] Use SmallString instead of SmallVector<char 2020-11-17 13:02:58 +00:00
InMemoryModuleCache.cpp Revert "[modules] Do not cache invalid state for modules that we attempted to load." 2020-03-10 10:59:26 -07:00
ModuleFile.cpp clang/Modules: Move Serialization/Module.{h,cpp} to ModuleFile, NFC 2019-11-21 19:07:00 -08:00
ModuleFileExtension.cpp [modules] Use `HashBuilder` and `MD5` for the module hash. 2021-09-03 11:13:36 -07:00
ModuleManager.cpp Change Module::ASTFile and ModuleFile::File => Optional<FileEntryRef>, NFC 2020-11-02 15:11:51 -05:00
MultiOnDiskHashTable.h
PCHContainerOperations.cpp [Clang] Migrate llvm::make_unique to std::make_unique 2019-08-14 23:04:18 +00:00