[PATCH] OpenMP parallel directive
Doug Gregor
dgregor at apple.com
Wed Apr 24 21:42:41 PDT 2013
================
Comment at: lib/Basic/OpenMPKinds.cpp:63-64
@@ +62,4 @@
+ return "threadprivate or thread local";
+ default:
+ break;
+ }
----------------
Dmitri Gribenko wrote:
> Alexey Bataev wrote:
> > Dmitri Gribenko wrote:
> > > 'default' should not be needed -- here and in other functions in this file.
> > There is NUM_OPENMP_CLAUSES, which is not covered. Should I include it explicitly into the switch?
> Oh, I see. Then it is up to you -- I don't remember any precedents of doing it one way or another.
The canonical approach is
case NUM_OPENMP_CLAUSES:
llvm_unreachable("invalid OpenMP clause");
that way, you'll get warnings if you add a new clause and forget to update this switch.
http://llvm-reviews.chandlerc.com/D572
More information about the cfe-commits
mailing list