Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion clang/include/clang/Basic/OpenMPKinds.def
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ OPENMP_DEVICE_MODIFIER(device_num)
// Variable-category attributes for 'default' clause.
OPENMP_DEFAULT_VARIABLE_CATEGORY(aggregate)
OPENMP_DEFAULT_VARIABLE_CATEGORY(all)
OPENMP_DEFAULT_VARIABLE_CATEGORY(allocatable)
OPENMP_DEFAULT_VARIABLE_CATEGORY(pointer)
OPENMP_DEFAULT_VARIABLE_CATEGORY(scalar)

Expand Down
19 changes: 4 additions & 15 deletions clang/lib/Sema/SemaOpenMP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,10 @@ enum DefaultDataSharingAttributes {
/// Not mentioning any Variable category attribute indicates
/// the modifier (DefaultDataSharingAttributes) is for all variables.
enum DefaultDataSharingVCAttributes {
DSA_VC_all = 0, /// for all variables.
DSA_VC_aggregate, /// for aggregate variables.
DSA_VC_allocatable, /// for allocatable variables.
DSA_VC_pointer, /// for pointer variables.
DSA_VC_scalar, /// for scalar variables.
DSA_VC_all = 0, /// for all variables.
DSA_VC_aggregate, /// for aggregate variables.
DSA_VC_pointer, /// for pointer variables.
DSA_VC_scalar, /// for scalar variables.
};

/// Stack for tracking declarations used in OpenMP directives and
Expand Down Expand Up @@ -760,11 +759,6 @@ class DSAStackTy {
getTopOfStack().DefaultVCAttr = DSA_VC_all;
getTopOfStack().DefaultAttrVCLoc = VCLoc;
}
/// Set default data sharing variable category attribute to allocatable.
void setDefaultDSAVCAllocatable(SourceLocation VCLoc) {
getTopOfStack().DefaultVCAttr = DSA_VC_allocatable;
getTopOfStack().DefaultAttrVCLoc = VCLoc;
}
/// Set default data sharing variable category attribute to pointer.
void setDefaultDSAVCPointer(SourceLocation VCLoc) {
getTopOfStack().DefaultVCAttr = DSA_VC_pointer;
Expand Down Expand Up @@ -1373,11 +1367,6 @@ DSAStackTy::DSAVarData DSAStackTy::getDSA(const_iterator &Iter,
if (!VD->getType()->isAggregateType())
IterDA = DSA_none;
break;
case DSA_VC_allocatable:
if (!(VD->getType()->isPointerType() ||
VD->getType()->isVariableArrayType()))
IterDA = DSA_none;
break;
case DSA_VC_pointer:
if (!VD->getType()->isPointerType())
IterDA = DSA_none;
Expand Down
5 changes: 5 additions & 0 deletions clang/test/OpenMP/parallel_default_messages.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ int main(int argc, char **argv) {
++x;
++y;
}
#pragma omp parallel default(private: allocatable) private(x,y) // expected-error {{wrong variable category specified with modifier private in the default clause}}
{
++x;
++y;
}
#endif
return 0;
}
Expand Down
Loading