[PATCH] [OPENMP] Clause 'num_threads'

Alexey Bataev a.bataev at hotmail.com
Wed Mar 5 03:05:05 PST 2014



================
Comment at: include/clang/Basic/DiagnosticSemaKinds.td:6867-6878
@@ -6865,1 +6866,14 @@
+  "argument to '%0' clause must be a positive integer value">;
+def err_omp_not_integral : Error<
+  "expression must have integral or unscoped enumeration "
+  "type, not %0">;
+def err_omp_incomplete_type : Error<
+  "expression has incomplete class type %0">;
+def err_omp_explicit_conversion : Error<
+  "expression requires explicit conversion from %0 to %1">;
+def note_omp_conversion_here : Note<
+  "conversion to %select{integral|enumeration}0 type %1 declared here">;
+def err_omp_ambiguous_conversion : Error<
+  "ambiguous conversion from type %0 to an integral or unscoped "
+  "enumeration type">;
 } // end of OpenMP category
----------------
Dmitri Gribenko wrote:
> Why not use existing err_ice_* diagnostics?
err_ice_* are only for ICE, but expression in num_threads() clause can be not only ICE, but just a regular integer expression.

================
Comment at: lib/Sema/SemaOpenMP.cpp:796-797
@@ -792,1 +795,4 @@
 
+ExprResult Sema::PerformImplicitIntegerConversion(SourceLocation Loc,
+                                                  Expr *Op) {
+  if (!Op)
----------------
Dmitri Gribenko wrote:
> This looks very much like code in Sema::BuildCXXNew().  If that code can be replaced with a call to this function (possibly generalized, if it needs to emit OMP-specific diagnostics), please do this.
There are different diagnostics messages for these operations. I don't think it is a good idea to generalize it (it will have more than 6 parameters)


http://llvm-reviews.chandlerc.com/D2964



More information about the cfe-commits mailing list