<div dir="ltr">FYI: OpenCL is planning to add C++ flavor of kernel language: <a href="https://www.khronos.org/registry/cl/specs/opencl-2.1-openclc++.pdf" target="_blank">https://www.khronos.org/registry/cl/specs/opencl-2.1-openclc++.pdf</a><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Feb 3, 2016 at 12:04 PM, Benyei, Guy via cfe-commits <span dir="ltr"><<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Hi Richard,<br>
Since these are OpenCL specific types, I think you are right,  these types shouldn't be part of the C++ ABI library.<br>
<br>
Thanks<br>
     Guy<br>
<br>
-----Original Message-----<br>
From: <a href="mailto:metafoo@gmail.com" target="_blank">metafoo@gmail.com</a> [mailto:<a href="mailto:metafoo@gmail.com" target="_blank">metafoo@gmail.com</a>] On Behalf Of Richard Smith<br>
Sent: Wednesday, February 03, 2016 02:46<br>
To: Benyei, Guy <<a href="mailto:guy.benyei@intel.com" target="_blank">guy.benyei@intel.com</a>>; cfe-commits <<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a>><br>
Subject: Fwd: [cfe-commits] r170428 [1/3] - in /cfe/trunk: include/clang/AST/ include/clang/Basic/ include/clang/Sema/ include/clang/Serialization/ lib/AST/ lib/CodeGen/ lib/Parse/ lib/Sema/ lib/Serialization/ test/CodeGenOpenCL/ test/PCH/ test/Parser/ tools/li...<br>
<br>
Hi Guy,<br>
<br>
> Modified: cfe/trunk/lib/CodeGen/CGRTTI.cpp<br>
> URL:<br>
> <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGRTTI.cpp?r" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGRTTI.cpp?r</a><br>
> ev=170428&r1=170427&r2=170428&view=diff<br>
> ======================================================================<br>
> ========<br>
> --- cfe/trunk/lib/CodeGen/CGRTTI.cpp (original)<br>
> +++ cfe/trunk/lib/CodeGen/CGRTTI.cpp Tue Dec 18 06:30:03 2012<br>
> @@ -1,1011 +1,1017 @@<br>
[...]<br>
> -/// TypeInfoIsInStandardLibrary - Given a builtin type, returns<br>
> whether the type -/// info for that type is defined in the standard library.<br>
> -static bool TypeInfoIsInStandardLibrary(const BuiltinType *Ty) {<br>
> -  // Itanium C++ ABI 2.9.2:<br>
> -  //   Basic type information (e.g. for "int", "bool", etc.) will be kept in<br>
> -  //   the run-time support library. Specifically, the run-time support<br>
> -  //   library should contain type_info objects for the types X, X* and<br>
> -  //   X const*, for every X in: void, std::nullptr_t, bool, wchar_t, char,<br>
> -  //   unsigned char, signed char, short, unsigned short, int, unsigned int,<br>
> -  //   long, unsigned long, long long, unsigned long long, float, double,<br>
> -  //   long double, char16_t, char32_t, and the IEEE 754r decimal and<br>
> -  //   half-precision floating point types.<br>
> -  switch (Ty->getKind()) {<br>
> -    case BuiltinType::Void:<br>
> -    case BuiltinType::NullPtr:<br>
> -    case BuiltinType::Bool:<br>
> -    case BuiltinType::WChar_S:<br>
> -    case BuiltinType::WChar_U:<br>
> -    case BuiltinType::Char_U:<br>
> -    case BuiltinType::Char_S:<br>
> -    case BuiltinType::UChar:<br>
> -    case BuiltinType::SChar:<br>
> -    case BuiltinType::Short:<br>
> -    case BuiltinType::UShort:<br>
> -    case BuiltinType::Int:<br>
> -    case BuiltinType::UInt:<br>
> -    case BuiltinType::Long:<br>
> -    case BuiltinType::ULong:<br>
> -    case BuiltinType::LongLong:<br>
> -    case BuiltinType::ULongLong:<br>
> -    case BuiltinType::Half:<br>
> -    case BuiltinType::Float:<br>
> -    case BuiltinType::Double:<br>
> -    case BuiltinType::LongDouble:<br>
> -    case BuiltinType::Char16:<br>
> -    case BuiltinType::Char32:<br>
> -    case BuiltinType::Int128:<br>
> -    case BuiltinType::UInt128:<br>
> -      return true;<br>
> +/// TypeInfoIsInStandardLibrary - Given a builtin type, returns<br>
> +whether the type /// info for that type is defined in the standard library.<br>
> +static bool TypeInfoIsInStandardLibrary(const BuiltinType *Ty) {<br>
> +  // Itanium C++ ABI 2.9.2:<br>
> +  //   Basic type information (e.g. for "int", "bool", etc.) will be kept in<br>
> +  //   the run-time support library. Specifically, the run-time support<br>
> +  //   library should contain type_info objects for the types X, X* and<br>
> +  //   X const*, for every X in: void, std::nullptr_t, bool, wchar_t, char,<br>
> +  //   unsigned char, signed char, short, unsigned short, int, unsigned int,<br>
> +  //   long, unsigned long, long long, unsigned long long, float, double,<br>
> +  //   long double, char16_t, char32_t, and the IEEE 754r decimal and<br>
> +  //   half-precision floating point types.<br>
> +  switch (Ty->getKind()) {<br>
> +    case BuiltinType::Void:<br>
> +    case BuiltinType::NullPtr:<br>
> +    case BuiltinType::Bool:<br>
> +    case BuiltinType::WChar_S:<br>
> +    case BuiltinType::WChar_U:<br>
> +    case BuiltinType::Char_U:<br>
> +    case BuiltinType::Char_S:<br>
> +    case BuiltinType::UChar:<br>
> +    case BuiltinType::SChar:<br>
> +    case BuiltinType::Short:<br>
> +    case BuiltinType::UShort:<br>
> +    case BuiltinType::Int:<br>
> +    case BuiltinType::UInt:<br>
> +    case BuiltinType::Long:<br>
> +    case BuiltinType::ULong:<br>
> +    case BuiltinType::LongLong:<br>
> +    case BuiltinType::ULongLong:<br>
> +    case BuiltinType::Half:<br>
> +    case BuiltinType::Float:<br>
> +    case BuiltinType::Double:<br>
> +    case BuiltinType::LongDouble:<br>
> +    case BuiltinType::Char16:<br>
> +    case BuiltinType::Char32:<br>
> +    case BuiltinType::Int128:<br>
> +    case BuiltinType::UInt128:<br>
> +    case BuiltinType::OCLImage1d:<br>
> +    case BuiltinType::OCLImage1dArray:<br>
> +    case BuiltinType::OCLImage1dBuffer:<br>
> +    case BuiltinType::OCLImage2d:<br>
> +    case BuiltinType::OCLImage2dArray:<br>
> +    case BuiltinType::OCLImage3d:<br>
> +      return true;<br>
<br>
This change is wrong. If you add types here, you must also add them to<br>
EmitFundamentalRTTIDescriptor:<br>
<br>
[...]<br>
> -void CodeGenModule::EmitFundamentalRTTIDescriptor(QualType Type) {<br>
> -  QualType PointerType = Context.getPointerType(Type);<br>
> -  QualType PointerTypeConst =<br>
> Context.getPointerType(Type.withConst());<br>
> -  RTTIBuilder(*this).BuildTypeInfo(Type, true);<br>
> -  RTTIBuilder(*this).BuildTypeInfo(PointerType, true);<br>
> -  RTTIBuilder(*this).BuildTypeInfo(PointerTypeConst, true); -}<br>
> -<br>
> -void CodeGenModule::EmitFundamentalRTTIDescriptors() {<br>
> -  QualType FundamentalTypes[] = { Context.VoidTy, Context.NullPtrTy,<br>
> -                                  Context.BoolTy, Context.WCharTy,<br>
> -                                  Context.CharTy, Context.UnsignedCharTy,<br>
> -                                  Context.SignedCharTy, Context.ShortTy,<br>
> -                                  Context.UnsignedShortTy, Context.IntTy,<br>
> -                                  Context.UnsignedIntTy, Context.LongTy,<br>
> -                                  Context.UnsignedLongTy, Context.LongLongTy,<br>
> -                                  Context.UnsignedLongLongTy, Context.FloatTy,<br>
> -                                  Context.DoubleTy, Context.LongDoubleTy,<br>
> -                                  Context.Char16Ty, Context.Char32Ty };<br>
> -  for (unsigned i = 0; i < sizeof(FundamentalTypes)/sizeof(QualType); ++i)<br>
> -    EmitFundamentalRTTIDescriptor(FundamentalTypes[i]);<br>
> -}<br>
<br>
Should these type descriptors be part of the C++ ABI library or not? I would suspect not, as GCC does not do so.<br>
---------------------------------------------------------------------<br>
Intel Israel (74) Limited<br>
<br>
This e-mail and any attachments may contain confidential material for<br>
the sole use of the intended recipient(s). Any review or distribution<br>
by others is strictly prohibited. If you are not the intended<br>
recipient, please contact the sender and delete all copies.<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits</a><br>
</blockquote></div><br></div></div>