|
@@ -2172,7 +2172,7 @@ void Sema::ActOnOpenMPRegionStart(OpenMPDirectiveKind DKind, Scope *CurScope) {
|
|
case OMPD_teams:
|
|
case OMPD_teams:
|
|
case OMPD_teams_distribute:
|
|
case OMPD_teams_distribute:
|
|
case OMPD_teams_distribute_simd: {
|
|
case OMPD_teams_distribute_simd: {
|
|
- QualType KmpInt32Ty = Context.getIntTypeForBitwidth(32, 1);
|
|
|
|
|
|
+ QualType KmpInt32Ty = Context.getIntTypeForBitwidth(32, 1).withConst();
|
|
QualType KmpInt32PtrTy =
|
|
QualType KmpInt32PtrTy =
|
|
Context.getPointerType(KmpInt32Ty).withConst().withRestrict();
|
|
Context.getPointerType(KmpInt32Ty).withConst().withRestrict();
|
|
Sema::CapturedParamNameType Params[] = {
|
|
Sema::CapturedParamNameType Params[] = {
|
|
@@ -2190,17 +2190,21 @@ void Sema::ActOnOpenMPRegionStart(OpenMPDirectiveKind DKind, Scope *CurScope) {
|
|
case OMPD_target_parallel_for_simd:
|
|
case OMPD_target_parallel_for_simd:
|
|
case OMPD_target_teams_distribute:
|
|
case OMPD_target_teams_distribute:
|
|
case OMPD_target_teams_distribute_simd: {
|
|
case OMPD_target_teams_distribute_simd: {
|
|
- QualType KmpInt32Ty = Context.getIntTypeForBitwidth(32, 1);
|
|
|
|
- QualType Args[] = {Context.VoidPtrTy.withConst().withRestrict()};
|
|
|
|
|
|
+ QualType KmpInt32Ty = Context.getIntTypeForBitwidth(32, 1).withConst();
|
|
|
|
+ QualType VoidPtrTy = Context.VoidPtrTy.withConst().withRestrict();
|
|
|
|
+ QualType KmpInt32PtrTy =
|
|
|
|
+ Context.getPointerType(KmpInt32Ty).withConst().withRestrict();
|
|
|
|
+ QualType Args[] = {VoidPtrTy};
|
|
FunctionProtoType::ExtProtoInfo EPI;
|
|
FunctionProtoType::ExtProtoInfo EPI;
|
|
EPI.Variadic = true;
|
|
EPI.Variadic = true;
|
|
QualType CopyFnType = Context.getFunctionType(Context.VoidTy, Args, EPI);
|
|
QualType CopyFnType = Context.getFunctionType(Context.VoidTy, Args, EPI);
|
|
Sema::CapturedParamNameType Params[] = {
|
|
Sema::CapturedParamNameType Params[] = {
|
|
std::make_pair(".global_tid.", KmpInt32Ty),
|
|
std::make_pair(".global_tid.", KmpInt32Ty),
|
|
- std::make_pair(".part_id.", Context.getPointerType(KmpInt32Ty)),
|
|
|
|
- std::make_pair(".privates.", Context.VoidPtrTy.withConst()),
|
|
|
|
- std::make_pair(".copy_fn.",
|
|
|
|
- Context.getPointerType(CopyFnType).withConst()),
|
|
|
|
|
|
+ std::make_pair(".part_id.", KmpInt32PtrTy),
|
|
|
|
+ std::make_pair(".privates.", VoidPtrTy),
|
|
|
|
+ std::make_pair(
|
|
|
|
+ ".copy_fn.",
|
|
|
|
+ Context.getPointerType(CopyFnType).withConst().withRestrict()),
|
|
std::make_pair(".task_t.", Context.VoidPtrTy.withConst()),
|
|
std::make_pair(".task_t.", Context.VoidPtrTy.withConst()),
|
|
std::make_pair(StringRef(), QualType()) // __context with shared vars
|
|
std::make_pair(StringRef(), QualType()) // __context with shared vars
|
|
};
|
|
};
|
|
@@ -2210,15 +2214,13 @@ void Sema::ActOnOpenMPRegionStart(OpenMPDirectiveKind DKind, Scope *CurScope) {
|
|
// function directly.
|
|
// function directly.
|
|
getCurCapturedRegion()->TheCapturedDecl->addAttr(
|
|
getCurCapturedRegion()->TheCapturedDecl->addAttr(
|
|
AlwaysInlineAttr::CreateImplicit(
|
|
AlwaysInlineAttr::CreateImplicit(
|
|
- Context, AlwaysInlineAttr::Keyword_forceinline, SourceRange()));
|
|
|
|
|
|
+ Context, AlwaysInlineAttr::Keyword_forceinline));
|
|
Sema::CapturedParamNameType ParamsTarget[] = {
|
|
Sema::CapturedParamNameType ParamsTarget[] = {
|
|
std::make_pair(StringRef(), QualType()) // __context with shared vars
|
|
std::make_pair(StringRef(), QualType()) // __context with shared vars
|
|
};
|
|
};
|
|
// Start a captured region for 'target' with no implicit parameters.
|
|
// Start a captured region for 'target' with no implicit parameters.
|
|
ActOnCapturedRegionStart(DSAStack->getConstructLoc(), CurScope, CR_OpenMP,
|
|
ActOnCapturedRegionStart(DSAStack->getConstructLoc(), CurScope, CR_OpenMP,
|
|
ParamsTarget);
|
|
ParamsTarget);
|
|
- QualType KmpInt32PtrTy =
|
|
|
|
- Context.getPointerType(KmpInt32Ty).withConst().withRestrict();
|
|
|
|
Sema::CapturedParamNameType ParamsTeamsOrParallel[] = {
|
|
Sema::CapturedParamNameType ParamsTeamsOrParallel[] = {
|
|
std::make_pair(".global_tid.", KmpInt32PtrTy),
|
|
std::make_pair(".global_tid.", KmpInt32PtrTy),
|
|
std::make_pair(".bound_tid.", KmpInt32PtrTy),
|
|
std::make_pair(".bound_tid.", KmpInt32PtrTy),
|
|
@@ -2232,17 +2234,21 @@ void Sema::ActOnOpenMPRegionStart(OpenMPDirectiveKind DKind, Scope *CurScope) {
|
|
}
|
|
}
|
|
case OMPD_target:
|
|
case OMPD_target:
|
|
case OMPD_target_simd: {
|
|
case OMPD_target_simd: {
|
|
- QualType KmpInt32Ty = Context.getIntTypeForBitwidth(32, 1);
|
|
|
|
- QualType Args[] = {Context.VoidPtrTy.withConst().withRestrict()};
|
|
|
|
|
|
+ QualType KmpInt32Ty = Context.getIntTypeForBitwidth(32, 1).withConst();
|
|
|
|
+ QualType VoidPtrTy = Context.VoidPtrTy.withConst().withRestrict();
|
|
|
|
+ QualType KmpInt32PtrTy =
|
|
|
|
+ Context.getPointerType(KmpInt32Ty).withConst().withRestrict();
|
|
|
|
+ QualType Args[] = {VoidPtrTy};
|
|
FunctionProtoType::ExtProtoInfo EPI;
|
|
FunctionProtoType::ExtProtoInfo EPI;
|
|
EPI.Variadic = true;
|
|
EPI.Variadic = true;
|
|
QualType CopyFnType = Context.getFunctionType(Context.VoidTy, Args, EPI);
|
|
QualType CopyFnType = Context.getFunctionType(Context.VoidTy, Args, EPI);
|
|
Sema::CapturedParamNameType Params[] = {
|
|
Sema::CapturedParamNameType Params[] = {
|
|
std::make_pair(".global_tid.", KmpInt32Ty),
|
|
std::make_pair(".global_tid.", KmpInt32Ty),
|
|
- std::make_pair(".part_id.", Context.getPointerType(KmpInt32Ty)),
|
|
|
|
- std::make_pair(".privates.", Context.VoidPtrTy.withConst()),
|
|
|
|
- std::make_pair(".copy_fn.",
|
|
|
|
- Context.getPointerType(CopyFnType).withConst()),
|
|
|
|
|
|
+ std::make_pair(".part_id.", KmpInt32PtrTy),
|
|
|
|
+ std::make_pair(".privates.", VoidPtrTy),
|
|
|
|
+ std::make_pair(
|
|
|
|
+ ".copy_fn.",
|
|
|
|
+ Context.getPointerType(CopyFnType).withConst().withRestrict()),
|
|
std::make_pair(".task_t.", Context.VoidPtrTy.withConst()),
|
|
std::make_pair(".task_t.", Context.VoidPtrTy.withConst()),
|
|
std::make_pair(StringRef(), QualType()) // __context with shared vars
|
|
std::make_pair(StringRef(), QualType()) // __context with shared vars
|
|
};
|
|
};
|
|
@@ -2252,7 +2258,7 @@ void Sema::ActOnOpenMPRegionStart(OpenMPDirectiveKind DKind, Scope *CurScope) {
|
|
// function directly.
|
|
// function directly.
|
|
getCurCapturedRegion()->TheCapturedDecl->addAttr(
|
|
getCurCapturedRegion()->TheCapturedDecl->addAttr(
|
|
AlwaysInlineAttr::CreateImplicit(
|
|
AlwaysInlineAttr::CreateImplicit(
|
|
- Context, AlwaysInlineAttr::Keyword_forceinline, SourceRange()));
|
|
|
|
|
|
+ Context, AlwaysInlineAttr::Keyword_forceinline));
|
|
ActOnCapturedRegionStart(DSAStack->getConstructLoc(), CurScope, CR_OpenMP,
|
|
ActOnCapturedRegionStart(DSAStack->getConstructLoc(), CurScope, CR_OpenMP,
|
|
std::make_pair(StringRef(), QualType()));
|
|
std::make_pair(StringRef(), QualType()));
|
|
break;
|
|
break;
|
|
@@ -2279,17 +2285,21 @@ void Sema::ActOnOpenMPRegionStart(OpenMPDirectiveKind DKind, Scope *CurScope) {
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
case OMPD_task: {
|
|
case OMPD_task: {
|
|
- QualType KmpInt32Ty = Context.getIntTypeForBitwidth(32, 1);
|
|
|
|
- QualType Args[] = {Context.VoidPtrTy.withConst().withRestrict()};
|
|
|
|
|
|
+ QualType KmpInt32Ty = Context.getIntTypeForBitwidth(32, 1).withConst();
|
|
|
|
+ QualType VoidPtrTy = Context.VoidPtrTy.withConst().withRestrict();
|
|
|
|
+ QualType KmpInt32PtrTy =
|
|
|
|
+ Context.getPointerType(KmpInt32Ty).withConst().withRestrict();
|
|
|
|
+ QualType Args[] = {VoidPtrTy};
|
|
FunctionProtoType::ExtProtoInfo EPI;
|
|
FunctionProtoType::ExtProtoInfo EPI;
|
|
EPI.Variadic = true;
|
|
EPI.Variadic = true;
|
|
QualType CopyFnType = Context.getFunctionType(Context.VoidTy, Args, EPI);
|
|
QualType CopyFnType = Context.getFunctionType(Context.VoidTy, Args, EPI);
|
|
Sema::CapturedParamNameType Params[] = {
|
|
Sema::CapturedParamNameType Params[] = {
|
|
std::make_pair(".global_tid.", KmpInt32Ty),
|
|
std::make_pair(".global_tid.", KmpInt32Ty),
|
|
- std::make_pair(".part_id.", Context.getPointerType(KmpInt32Ty)),
|
|
|
|
- std::make_pair(".privates.", Context.VoidPtrTy.withConst()),
|
|
|
|
- std::make_pair(".copy_fn.",
|
|
|
|
- Context.getPointerType(CopyFnType).withConst()),
|
|
|
|
|
|
+ std::make_pair(".part_id.", KmpInt32PtrTy),
|
|
|
|
+ std::make_pair(".privates.", VoidPtrTy),
|
|
|
|
+ std::make_pair(
|
|
|
|
+ ".copy_fn.",
|
|
|
|
+ Context.getPointerType(CopyFnType).withConst().withRestrict()),
|
|
std::make_pair(".task_t.", Context.VoidPtrTy.withConst()),
|
|
std::make_pair(".task_t.", Context.VoidPtrTy.withConst()),
|
|
std::make_pair(StringRef(), QualType()) // __context with shared vars
|
|
std::make_pair(StringRef(), QualType()) // __context with shared vars
|
|
};
|
|
};
|
|
@@ -2299,35 +2309,40 @@ void Sema::ActOnOpenMPRegionStart(OpenMPDirectiveKind DKind, Scope *CurScope) {
|
|
// function directly.
|
|
// function directly.
|
|
getCurCapturedRegion()->TheCapturedDecl->addAttr(
|
|
getCurCapturedRegion()->TheCapturedDecl->addAttr(
|
|
AlwaysInlineAttr::CreateImplicit(
|
|
AlwaysInlineAttr::CreateImplicit(
|
|
- Context, AlwaysInlineAttr::Keyword_forceinline, SourceRange()));
|
|
|
|
|
|
+ Context, AlwaysInlineAttr::Keyword_forceinline));
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
case OMPD_taskloop:
|
|
case OMPD_taskloop:
|
|
case OMPD_taskloop_simd: {
|
|
case OMPD_taskloop_simd: {
|
|
QualType KmpInt32Ty =
|
|
QualType KmpInt32Ty =
|
|
- Context.getIntTypeForBitwidth(/*DestWidth=*/32, /*Signed=*/1);
|
|
|
|
|
|
+ Context.getIntTypeForBitwidth(/*DestWidth=*/32, /*Signed=*/1)
|
|
|
|
+ .withConst();
|
|
QualType KmpUInt64Ty =
|
|
QualType KmpUInt64Ty =
|
|
- Context.getIntTypeForBitwidth(/*DestWidth=*/64, /*Signed=*/0);
|
|
|
|
|
|
+ Context.getIntTypeForBitwidth(/*DestWidth=*/64, /*Signed=*/0)
|
|
|
|
+ .withConst();
|
|
QualType KmpInt64Ty =
|
|
QualType KmpInt64Ty =
|
|
- Context.getIntTypeForBitwidth(/*DestWidth=*/64, /*Signed=*/1);
|
|
|
|
- QualType Args[] = {Context.VoidPtrTy.withConst().withRestrict()};
|
|
|
|
|
|
+ Context.getIntTypeForBitwidth(/*DestWidth=*/64, /*Signed=*/1)
|
|
|
|
+ .withConst();
|
|
|
|
+ QualType VoidPtrTy = Context.VoidPtrTy.withConst().withRestrict();
|
|
|
|
+ QualType KmpInt32PtrTy =
|
|
|
|
+ Context.getPointerType(KmpInt32Ty).withConst().withRestrict();
|
|
|
|
+ QualType Args[] = {VoidPtrTy};
|
|
FunctionProtoType::ExtProtoInfo EPI;
|
|
FunctionProtoType::ExtProtoInfo EPI;
|
|
EPI.Variadic = true;
|
|
EPI.Variadic = true;
|
|
QualType CopyFnType = Context.getFunctionType(Context.VoidTy, Args, EPI);
|
|
QualType CopyFnType = Context.getFunctionType(Context.VoidTy, Args, EPI);
|
|
Sema::CapturedParamNameType Params[] = {
|
|
Sema::CapturedParamNameType Params[] = {
|
|
std::make_pair(".global_tid.", KmpInt32Ty),
|
|
std::make_pair(".global_tid.", KmpInt32Ty),
|
|
- std::make_pair(".part_id.", Context.getPointerType(KmpInt32Ty)),
|
|
|
|
- std::make_pair(".privates.",
|
|
|
|
- Context.VoidPtrTy.withConst().withRestrict()),
|
|
|
|
|
|
+ std::make_pair(".part_id.", KmpInt32PtrTy),
|
|
|
|
+ std::make_pair(".privates.", VoidPtrTy),
|
|
std::make_pair(
|
|
std::make_pair(
|
|
".copy_fn.",
|
|
".copy_fn.",
|
|
Context.getPointerType(CopyFnType).withConst().withRestrict()),
|
|
Context.getPointerType(CopyFnType).withConst().withRestrict()),
|
|
std::make_pair(".task_t.", Context.VoidPtrTy.withConst()),
|
|
std::make_pair(".task_t.", Context.VoidPtrTy.withConst()),
|
|
std::make_pair(".lb.", KmpUInt64Ty),
|
|
std::make_pair(".lb.", KmpUInt64Ty),
|
|
- std::make_pair(".ub.", KmpUInt64Ty), std::make_pair(".st.", KmpInt64Ty),
|
|
|
|
|
|
+ std::make_pair(".ub.", KmpUInt64Ty),
|
|
|
|
+ std::make_pair(".st.", KmpInt64Ty),
|
|
std::make_pair(".liter.", KmpInt32Ty),
|
|
std::make_pair(".liter.", KmpInt32Ty),
|
|
- std::make_pair(".reductions.",
|
|
|
|
- Context.VoidPtrTy.withConst().withRestrict()),
|
|
|
|
|
|
+ std::make_pair(".reductions.", VoidPtrTy),
|
|
std::make_pair(StringRef(), QualType()) // __context with shared vars
|
|
std::make_pair(StringRef(), QualType()) // __context with shared vars
|
|
};
|
|
};
|
|
ActOnCapturedRegionStart(DSAStack->getConstructLoc(), CurScope, CR_OpenMP,
|
|
ActOnCapturedRegionStart(DSAStack->getConstructLoc(), CurScope, CR_OpenMP,
|
|
@@ -2336,19 +2351,19 @@ void Sema::ActOnOpenMPRegionStart(OpenMPDirectiveKind DKind, Scope *CurScope) {
|
|
// function directly.
|
|
// function directly.
|
|
getCurCapturedRegion()->TheCapturedDecl->addAttr(
|
|
getCurCapturedRegion()->TheCapturedDecl->addAttr(
|
|
AlwaysInlineAttr::CreateImplicit(
|
|
AlwaysInlineAttr::CreateImplicit(
|
|
- Context, AlwaysInlineAttr::Keyword_forceinline, SourceRange()));
|
|
|
|
|
|
+ Context, AlwaysInlineAttr::Keyword_forceinline));
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
case OMPD_distribute_parallel_for_simd:
|
|
case OMPD_distribute_parallel_for_simd:
|
|
case OMPD_distribute_parallel_for: {
|
|
case OMPD_distribute_parallel_for: {
|
|
- QualType KmpInt32Ty = Context.getIntTypeForBitwidth(32, 1);
|
|
|
|
|
|
+ QualType KmpInt32Ty = Context.getIntTypeForBitwidth(32, 1).withConst();
|
|
QualType KmpInt32PtrTy =
|
|
QualType KmpInt32PtrTy =
|
|
Context.getPointerType(KmpInt32Ty).withConst().withRestrict();
|
|
Context.getPointerType(KmpInt32Ty).withConst().withRestrict();
|
|
Sema::CapturedParamNameType Params[] = {
|
|
Sema::CapturedParamNameType Params[] = {
|
|
std::make_pair(".global_tid.", KmpInt32PtrTy),
|
|
std::make_pair(".global_tid.", KmpInt32PtrTy),
|
|
std::make_pair(".bound_tid.", KmpInt32PtrTy),
|
|
std::make_pair(".bound_tid.", KmpInt32PtrTy),
|
|
- std::make_pair(".previous.lb.", Context.getSizeType()),
|
|
|
|
- std::make_pair(".previous.ub.", Context.getSizeType()),
|
|
|
|
|
|
+ std::make_pair(".previous.lb.", Context.getSizeType().withConst()),
|
|
|
|
+ std::make_pair(".previous.ub.", Context.getSizeType().withConst()),
|
|
std::make_pair(StringRef(), QualType()) // __context with shared vars
|
|
std::make_pair(StringRef(), QualType()) // __context with shared vars
|
|
};
|
|
};
|
|
ActOnCapturedRegionStart(DSAStack->getConstructLoc(), CurScope, CR_OpenMP,
|
|
ActOnCapturedRegionStart(DSAStack->getConstructLoc(), CurScope, CR_OpenMP,
|
|
@@ -2357,20 +2372,22 @@ void Sema::ActOnOpenMPRegionStart(OpenMPDirectiveKind DKind, Scope *CurScope) {
|
|
}
|
|
}
|
|
case OMPD_target_teams_distribute_parallel_for:
|
|
case OMPD_target_teams_distribute_parallel_for:
|
|
case OMPD_target_teams_distribute_parallel_for_simd: {
|
|
case OMPD_target_teams_distribute_parallel_for_simd: {
|
|
- QualType KmpInt32Ty = Context.getIntTypeForBitwidth(32, 1);
|
|
|
|
|
|
+ QualType KmpInt32Ty = Context.getIntTypeForBitwidth(32, 1).withConst();
|
|
QualType KmpInt32PtrTy =
|
|
QualType KmpInt32PtrTy =
|
|
Context.getPointerType(KmpInt32Ty).withConst().withRestrict();
|
|
Context.getPointerType(KmpInt32Ty).withConst().withRestrict();
|
|
|
|
+ QualType VoidPtrTy = Context.VoidPtrTy.withConst().withRestrict();
|
|
|
|
|
|
- QualType Args[] = {Context.VoidPtrTy.withConst().withRestrict()};
|
|
|
|
|
|
+ QualType Args[] = {VoidPtrTy};
|
|
FunctionProtoType::ExtProtoInfo EPI;
|
|
FunctionProtoType::ExtProtoInfo EPI;
|
|
EPI.Variadic = true;
|
|
EPI.Variadic = true;
|
|
QualType CopyFnType = Context.getFunctionType(Context.VoidTy, Args, EPI);
|
|
QualType CopyFnType = Context.getFunctionType(Context.VoidTy, Args, EPI);
|
|
Sema::CapturedParamNameType Params[] = {
|
|
Sema::CapturedParamNameType Params[] = {
|
|
std::make_pair(".global_tid.", KmpInt32Ty),
|
|
std::make_pair(".global_tid.", KmpInt32Ty),
|
|
- std::make_pair(".part_id.", Context.getPointerType(KmpInt32Ty)),
|
|
|
|
- std::make_pair(".privates.", Context.VoidPtrTy.withConst()),
|
|
|
|
- std::make_pair(".copy_fn.",
|
|
|
|
- Context.getPointerType(CopyFnType).withConst()),
|
|
|
|
|
|
+ std::make_pair(".part_id.", KmpInt32PtrTy),
|
|
|
|
+ std::make_pair(".privates.", VoidPtrTy),
|
|
|
|
+ std::make_pair(
|
|
|
|
+ ".copy_fn.",
|
|
|
|
+ Context.getPointerType(CopyFnType).withConst().withRestrict()),
|
|
std::make_pair(".task_t.", Context.VoidPtrTy.withConst()),
|
|
std::make_pair(".task_t.", Context.VoidPtrTy.withConst()),
|
|
std::make_pair(StringRef(), QualType()) // __context with shared vars
|
|
std::make_pair(StringRef(), QualType()) // __context with shared vars
|
|
};
|
|
};
|
|
@@ -2380,7 +2397,7 @@ void Sema::ActOnOpenMPRegionStart(OpenMPDirectiveKind DKind, Scope *CurScope) {
|
|
// function directly.
|
|
// function directly.
|
|
getCurCapturedRegion()->TheCapturedDecl->addAttr(
|
|
getCurCapturedRegion()->TheCapturedDecl->addAttr(
|
|
AlwaysInlineAttr::CreateImplicit(
|
|
AlwaysInlineAttr::CreateImplicit(
|
|
- Context, AlwaysInlineAttr::Keyword_forceinline, SourceRange()));
|
|
|
|
|
|
+ Context, AlwaysInlineAttr::Keyword_forceinline));
|
|
Sema::CapturedParamNameType ParamsTarget[] = {
|
|
Sema::CapturedParamNameType ParamsTarget[] = {
|
|
std::make_pair(StringRef(), QualType()) // __context with shared vars
|
|
std::make_pair(StringRef(), QualType()) // __context with shared vars
|
|
};
|
|
};
|
|
@@ -2400,8 +2417,8 @@ void Sema::ActOnOpenMPRegionStart(OpenMPDirectiveKind DKind, Scope *CurScope) {
|
|
Sema::CapturedParamNameType ParamsParallel[] = {
|
|
Sema::CapturedParamNameType ParamsParallel[] = {
|
|
std::make_pair(".global_tid.", KmpInt32PtrTy),
|
|
std::make_pair(".global_tid.", KmpInt32PtrTy),
|
|
std::make_pair(".bound_tid.", KmpInt32PtrTy),
|
|
std::make_pair(".bound_tid.", KmpInt32PtrTy),
|
|
- std::make_pair(".previous.lb.", Context.getSizeType()),
|
|
|
|
- std::make_pair(".previous.ub.", Context.getSizeType()),
|
|
|
|
|
|
+ std::make_pair(".previous.lb.", Context.getSizeType().withConst()),
|
|
|
|
+ std::make_pair(".previous.ub.", Context.getSizeType().withConst()),
|
|
std::make_pair(StringRef(), QualType()) // __context with shared vars
|
|
std::make_pair(StringRef(), QualType()) // __context with shared vars
|
|
};
|
|
};
|
|
// Start a captured region for 'teams' or 'parallel'. Both regions have
|
|
// Start a captured region for 'teams' or 'parallel'. Both regions have
|
|
@@ -2413,7 +2430,7 @@ void Sema::ActOnOpenMPRegionStart(OpenMPDirectiveKind DKind, Scope *CurScope) {
|
|
|
|
|
|
case OMPD_teams_distribute_parallel_for:
|
|
case OMPD_teams_distribute_parallel_for:
|
|
case OMPD_teams_distribute_parallel_for_simd: {
|
|
case OMPD_teams_distribute_parallel_for_simd: {
|
|
- QualType KmpInt32Ty = Context.getIntTypeForBitwidth(32, 1);
|
|
|
|
|
|
+ QualType KmpInt32Ty = Context.getIntTypeForBitwidth(32, 1).withConst();
|
|
QualType KmpInt32PtrTy =
|
|
QualType KmpInt32PtrTy =
|
|
Context.getPointerType(KmpInt32Ty).withConst().withRestrict();
|
|
Context.getPointerType(KmpInt32Ty).withConst().withRestrict();
|
|
|
|
|
|
@@ -2429,8 +2446,8 @@ void Sema::ActOnOpenMPRegionStart(OpenMPDirectiveKind DKind, Scope *CurScope) {
|
|
Sema::CapturedParamNameType ParamsParallel[] = {
|
|
Sema::CapturedParamNameType ParamsParallel[] = {
|
|
std::make_pair(".global_tid.", KmpInt32PtrTy),
|
|
std::make_pair(".global_tid.", KmpInt32PtrTy),
|
|
std::make_pair(".bound_tid.", KmpInt32PtrTy),
|
|
std::make_pair(".bound_tid.", KmpInt32PtrTy),
|
|
- std::make_pair(".previous.lb.", Context.getSizeType()),
|
|
|
|
- std::make_pair(".previous.ub.", Context.getSizeType()),
|
|
|
|
|
|
+ std::make_pair(".previous.lb.", Context.getSizeType().withConst()),
|
|
|
|
+ std::make_pair(".previous.ub.", Context.getSizeType().withConst()),
|
|
std::make_pair(StringRef(), QualType()) // __context with shared vars
|
|
std::make_pair(StringRef(), QualType()) // __context with shared vars
|
|
};
|
|
};
|
|
// Start a captured region for 'teams' or 'parallel'. Both regions have
|
|
// Start a captured region for 'teams' or 'parallel'. Both regions have
|
|
@@ -2442,17 +2459,21 @@ void Sema::ActOnOpenMPRegionStart(OpenMPDirectiveKind DKind, Scope *CurScope) {
|
|
case OMPD_target_update:
|
|
case OMPD_target_update:
|
|
case OMPD_target_enter_data:
|
|
case OMPD_target_enter_data:
|
|
case OMPD_target_exit_data: {
|
|
case OMPD_target_exit_data: {
|
|
- QualType KmpInt32Ty = Context.getIntTypeForBitwidth(32, 1);
|
|
|
|
- QualType Args[] = {Context.VoidPtrTy.withConst().withRestrict()};
|
|
|
|
|
|
+ QualType KmpInt32Ty = Context.getIntTypeForBitwidth(32, 1).withConst();
|
|
|
|
+ QualType VoidPtrTy = Context.VoidPtrTy.withConst().withRestrict();
|
|
|
|
+ QualType KmpInt32PtrTy =
|
|
|
|
+ Context.getPointerType(KmpInt32Ty).withConst().withRestrict();
|
|
|
|
+ QualType Args[] = {VoidPtrTy};
|
|
FunctionProtoType::ExtProtoInfo EPI;
|
|
FunctionProtoType::ExtProtoInfo EPI;
|
|
EPI.Variadic = true;
|
|
EPI.Variadic = true;
|
|
QualType CopyFnType = Context.getFunctionType(Context.VoidTy, Args, EPI);
|
|
QualType CopyFnType = Context.getFunctionType(Context.VoidTy, Args, EPI);
|
|
Sema::CapturedParamNameType Params[] = {
|
|
Sema::CapturedParamNameType Params[] = {
|
|
std::make_pair(".global_tid.", KmpInt32Ty),
|
|
std::make_pair(".global_tid.", KmpInt32Ty),
|
|
- std::make_pair(".part_id.", Context.getPointerType(KmpInt32Ty)),
|
|
|
|
- std::make_pair(".privates.", Context.VoidPtrTy.withConst()),
|
|
|
|
- std::make_pair(".copy_fn.",
|
|
|
|
- Context.getPointerType(CopyFnType).withConst()),
|
|
|
|
|
|
+ std::make_pair(".part_id.", KmpInt32PtrTy),
|
|
|
|
+ std::make_pair(".privates.", VoidPtrTy),
|
|
|
|
+ std::make_pair(
|
|
|
|
+ ".copy_fn.",
|
|
|
|
+ Context.getPointerType(CopyFnType).withConst().withRestrict()),
|
|
std::make_pair(".task_t.", Context.VoidPtrTy.withConst()),
|
|
std::make_pair(".task_t.", Context.VoidPtrTy.withConst()),
|
|
std::make_pair(StringRef(), QualType()) // __context with shared vars
|
|
std::make_pair(StringRef(), QualType()) // __context with shared vars
|
|
};
|
|
};
|
|
@@ -2462,7 +2483,7 @@ void Sema::ActOnOpenMPRegionStart(OpenMPDirectiveKind DKind, Scope *CurScope) {
|
|
// function directly.
|
|
// function directly.
|
|
getCurCapturedRegion()->TheCapturedDecl->addAttr(
|
|
getCurCapturedRegion()->TheCapturedDecl->addAttr(
|
|
AlwaysInlineAttr::CreateImplicit(
|
|
AlwaysInlineAttr::CreateImplicit(
|
|
- Context, AlwaysInlineAttr::Keyword_forceinline, SourceRange()));
|
|
|
|
|
|
+ Context, AlwaysInlineAttr::Keyword_forceinline));
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
case OMPD_threadprivate:
|
|
case OMPD_threadprivate:
|