forked from OSchip/llvm-project
![]() Clang now asserts for the below case: ``` void clang::CodeGen::CGOpenMPRuntime::createOffloadEntriesAndInfoMetadata(): Assertion `std::get<0>(E) && "All ordered entries must exist!"' failed. ``` The reason why Clang hit the assert is because in `emitTargetDataCalls`, both `BeginThenGen` and `BeginElseGen` call `registerTargetRegionEntryInfo` and try to register the Entry in OffloadEntriesTargetRegion with same key. If changing the expression in if clause to any constant expression, then the assert disappear. (https://godbolt.org/z/TW7haj) The assert itself is to avoid user from accessing elements out of bound inside `OrderedEntries` in `createOffloadEntriesAndInfoMetadata`. In this patch, I add a check in `registerTargetRegionEntryInfo` to avoid register the target region more than once. A test case that triggers assert: https://godbolt.org/z/4cnGW8 Reviewed By: ABataev Differential Revision: https://reviews.llvm.org/D90704 |
||
---|---|---|
.. | ||
ARCMigrate | ||
AST | ||
ASTMatchers | ||
Analysis | ||
Basic | ||
CodeGen | ||
CrossTU | ||
DirectoryWatcher | ||
Driver | ||
Edit | ||
Format | ||
Frontend | ||
FrontendTool | ||
Headers | ||
Index | ||
IndexSerialization | ||
Lex | ||
Parse | ||
Rewrite | ||
Sema | ||
Serialization | ||
StaticAnalyzer | ||
Testing | ||
Tooling | ||
CMakeLists.txt |