Skip to content

Commit bb48a76

Browse files
author
Shashwathi N
committed
Added call for HandleTopLevelDecl in SemaOpenmp
1 parent 7bbb30a commit bb48a76

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

clang/lib/CodeGen/CGOpenMPRuntime.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7803,13 +7803,6 @@ class MappableExprsHandler {
78037803
const auto *C = dyn_cast<OMPMapClause>(Cl);
78047804
if (!C)
78057805
continue;
7806-
if (auto *IE = dyn_cast_or_null<OMPIteratorExpr>(
7807-
const_cast<OMPMapClause *>(C)->getIteratorModifier())) {
7808-
if (auto *VD = dyn_cast<VarDecl>(IE->getIteratorDecl(0))) {
7809-
if (!VD->isLocalVarDecl())
7810-
CGF.CGM.EmitGlobal(GlobalDecl(VD));
7811-
}
7812-
}
78137806
MapKind Kind = Other;
78147807
if (llvm::is_contained(C->getMapTypeModifiers(),
78157808
OMPC_MAP_MODIFIER_present))

clang/lib/Sema/SemaOpenMP.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
//===----------------------------------------------------------------------===//
1313

1414
#include "clang/Sema/SemaOpenMP.h"
15+
#include "clang/AST/ASTConsumer.h"
1516

1617
#include "TreeTransform.h"
1718
#include "clang/AST/ASTContext.h"
@@ -22511,7 +22512,10 @@ ExprResult SemaOpenMP::ActOnOpenMPDeclareMapperDirectiveVarDecl(
2251122512

2251222513
void SemaOpenMP::ActOnOpenMPIteratorVarDecl(VarDecl *VD) {
2251322514
if (DSAStack->getDeclareMapperVarRef())
22515+
{
22516+
SemaRef.Consumer.HandleTopLevelDecl(DeclGroupRef(VD));
2251422517
DSAStack->addIteratorVarDecl(VD);
22518+
}
2251522519
}
2251622520

2251722521
bool SemaOpenMP::isOpenMPDeclareMapperVarDeclAllowed(const VarDecl *VD) const {

0 commit comments

Comments
 (0)