Skip to content

Commit d1924d9

Browse files
committed
Initialize and destroy OmpSs-2 DSA stack
1 parent df90959 commit d1924d9

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

clang/lib/Sema/Sema.cpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,8 @@ Sema::Sema(Preprocessor &pp, ASTContext &ctxt, ASTConsumer &consumer,
158158
CurrentInstantiationScope(nullptr), DisableTypoCorrection(false),
159159
TyposCorrected(0), AnalysisWarnings(*this),
160160
ThreadSafetyDeclCache(nullptr), VarDataSharingAttributesStack(nullptr),
161-
CurScope(nullptr), Ident_super(nullptr), Ident___float128(nullptr) {
161+
VarDataSharingAttributesStackOmpSs(nullptr), CurScope(nullptr),
162+
Ident_super(nullptr), Ident___float128(nullptr) {
162163
TUScope = nullptr;
163164
isConstantEvaluatedOverride = false;
164165

@@ -383,6 +384,9 @@ Sema::~Sema() {
383384
// Destroys data sharing attributes stack for OpenMP
384385
DestroyDataSharingAttributesStack();
385386

387+
// Destroys data sharing attributes stack for OmpSs-2
388+
DestroyDataSharingAttributesStackOmpSs();
389+
386390
// Detach from the PP callback handler which outlives Sema since it's owned
387391
// by the preprocessor.
388392
SemaPPCallbackHandler->reset();

clang/lib/Sema/SemaOmpSs.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -651,6 +651,8 @@ void Sema::InitDataSharingAttributesStackOmpSs() {
651651

652652
#define DSAStack static_cast<DSAStackTy *>(VarDataSharingAttributesStackOmpSs)
653653

654+
void Sema::DestroyDataSharingAttributesStackOmpSs() { delete DSAStack; }
655+
654656
void Sema::StartOmpSsDSABlock(OmpSsDirectiveKind DKind,
655657
Scope *CurScope, SourceLocation Loc) {
656658
DSAStack->push(DKind, CurScope, Loc);

0 commit comments

Comments
 (0)