Skip to content

Commit 9927528

Browse files
switch VTableDeclMap.contains
1 parent ea5d12a commit 9927528

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

clang/lib/CodeGen/CGOpenMPRuntime.cpp

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1835,8 +1835,7 @@ void CGOpenMPRuntime::emitAndRegisterVTable(CodeGenModule &CGM,
18351835
// Register C++ VTable to OpenMP Offload Entry if it's a new
18361836
// CXXRecordDecl.
18371837
if (CXXRecord && CXXRecord->isDynamicClass() &&
1838-
CGM.getOpenMPRuntime().VTableDeclMap.find(CXXRecord) ==
1839-
CGM.getOpenMPRuntime().VTableDeclMap.end()) {
1838+
!CGM.getOpenMPRuntime().VTableDeclMap.contains(CXXRecord)) {
18401839
CGM.getOpenMPRuntime().VTableDeclMap.try_emplace(CXXRecord, VD);
18411840
CGM.EmitVTable(CXXRecord);
18421841
CodeGenVTables VTables = CGM.getVTables();
@@ -1872,10 +1871,16 @@ void CGOpenMPRuntime::registerVTable(const OMPExecutableDirective &D) {
18721871
const VarDecl *VD = nullptr;
18731872
if (auto *DRE = dyn_cast<DeclRefExpr>(E))
18741873
VD = cast<VarDecl>(DRE->getDecl());
1875-
else if (auto *MRE = dyn_cast<MemberExpr>(E))
1876-
if (auto *BaseDRE = dyn_cast<DeclRefExpr>(MRE->getBase()))
1877-
if (auto *BaseVD = dyn_cast<VarDecl>(BaseDRE->getDecl()))
1874+
else if (auto *MRE = dyn_cast<MemberExpr>(E)){
1875+
printf("here\n");
1876+
if (auto *BaseDRE = dyn_cast<DeclRefExpr>(MRE->getBase())){
1877+
printf("here 1\n");
1878+
if (auto *BaseVD = dyn_cast<VarDecl>(BaseDRE->getDecl())){
18781879
VD = BaseVD;
1880+
printf("here 2\n");
1881+
}
1882+
}
1883+
}
18791884
return std::pair<CXXRecordDecl *, const VarDecl *>(CXXRecord, VD);
18801885
};
18811886
// Collect VTable from OpenMP map clause.

0 commit comments

Comments
 (0)