[cfe-dev] [OpenCL patch] asType, Convert **revised**

Anton Lokhmotov Anton.Lokhmotov at arm.com
Fri May 27 08:25:19 PDT 2011


Hi Tanya,

Thank you for splitting from this patch.  I agree it's fine to have as_type
in the AST.  Minor comments below.

Best, Anton.


+// OpenCL warnings and errors.
+def err_invalid_astype_of_different_size : Error<
+  "invalid astype between type '%0' and '%1' of different size">;
+
AL: "invalid reinterpretation: sizes of %0 and %1 must match"? ('sizes of'
in the sense 'sizeof')

+KEYWORD(__builtin_astype            , KEYOPENCL)
AL: I'm still unconvinced this should be declared an OpenCL keyword (even if
it's OpenCL specific).

+/// AsTypeExpr - Clang builtin function __builtin_astype 
+/// [OpenCL1.0 6.2.4.2]
+/// AsTypeExpr - Clang builtin function __builtin_astype [OpenCL1.0
6.2.4.2]
AL: Duplicated comments.  It's also in the same section for OpenCL 1.1.

+/// This AST node provide**r**s support bit casting **any** type to another
type of
+/// the size.
AL: "This AST node provides support for reinterpreting a type to another
type of the same size". (Can't say 'any' because it's not true for e.g. the
half type.)

+  assert(false && "Cannot transform astype expressions yet");
AL: as_type? asType?

+/// ActOnAsTypeExpr - create a new AsType (bitcast) from the arguments.
AL: as_type? asType?

+      // In the case of going from int4->float3, a bitcas**e** is needed
before
AL: bitcast

+        // Create a float type of the same size as **the source** or dst.
AL: "src or dst"? "the source or destination"?

+    if (ExpectAndConsume(tok::comma, diag::err_expected_comma,
"",tok::r_paren))
AL: Insert space before tok::r_paren.

-    void VisitCUDAKernelCallExpr(CUDAKernelCallExpr *E);
+    void VisitCUDAKernelCallExpr(CUDAKernelCallExpr *E);    
AL: Extra whitespace causes this?







More information about the cfe-dev mailing list