[cfe-dev] TreeTransform: QualType for OpenCL float4

Sameer Sahasrabuddhe sameer.sahasrabuddhe at amd.com
Wed Jan 21 22:53:33 PST 2015


On 1/21/2015 11:35 PM, Christoph Viebig (lists) wrote:
> My question is now: How can I construct or retrieve an instance of
> Type that represents OpenCL float4 (e.g. from Sema or Context)?

OpenCL vector types are represented as "extended vectors" in Clang
http://clang.llvm.org/docs/LanguageExtensions.html#vectors-and-extended-vectors

AstContext provides a method to construct these as a QualType:
http://clang.llvm.org/doxygen/classclang_1_1ASTContext.html

QualType     getExtVectorType (QualType VectorType, unsigned NumElts) const
      Return the unique reference to an extended vector type of the 
specified element type and size.

Is this what you need?

Sameer.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20150122/43e19671/attachment.html>


More information about the cfe-dev mailing list