[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/libclang/
Richard Smith via cfe-commits
cfe-commits at lists.llvm.org
Tue Feb 2 17:36:57 PST 2016
Fixed as part of r259616.
On Tue, Feb 2, 2016 at 4:45 PM, Richard Smith <richard at metafoo.co.uk> wrote:
> Hi Guy,
>
>> Modified: cfe/trunk/lib/CodeGen/CGRTTI.cpp
>> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGRTTI.cpp?rev=170428&r1=170427&r2=170428&view=diff
>> ==============================================================================
>> --- cfe/trunk/lib/CodeGen/CGRTTI.cpp (original)
>> +++ cfe/trunk/lib/CodeGen/CGRTTI.cpp Tue Dec 18 06:30:03 2012
>> @@ -1,1011 +1,1017 @@
> [...]
>> -/// TypeInfoIsInStandardLibrary - Given a builtin type, returns whether the type
>> -/// info for that type is defined in the standard library.
>> -static bool TypeInfoIsInStandardLibrary(const BuiltinType *Ty) {
>> - // Itanium C++ ABI 2.9.2:
>> - // Basic type information (e.g. for "int", "bool", etc.) will be kept in
>> - // the run-time support library. Specifically, the run-time support
>> - // library should contain type_info objects for the types X, X* and
>> - // X const*, for every X in: void, std::nullptr_t, bool, wchar_t, char,
>> - // unsigned char, signed char, short, unsigned short, int, unsigned int,
>> - // long, unsigned long, long long, unsigned long long, float, double,
>> - // long double, char16_t, char32_t, and the IEEE 754r decimal and
>> - // half-precision floating point types.
>> - switch (Ty->getKind()) {
>> - case BuiltinType::Void:
>> - case BuiltinType::NullPtr:
>> - case BuiltinType::Bool:
>> - case BuiltinType::WChar_S:
>> - case BuiltinType::WChar_U:
>> - case BuiltinType::Char_U:
>> - case BuiltinType::Char_S:
>> - case BuiltinType::UChar:
>> - case BuiltinType::SChar:
>> - case BuiltinType::Short:
>> - case BuiltinType::UShort:
>> - case BuiltinType::Int:
>> - case BuiltinType::UInt:
>> - case BuiltinType::Long:
>> - case BuiltinType::ULong:
>> - case BuiltinType::LongLong:
>> - case BuiltinType::ULongLong:
>> - case BuiltinType::Half:
>> - case BuiltinType::Float:
>> - case BuiltinType::Double:
>> - case BuiltinType::LongDouble:
>> - case BuiltinType::Char16:
>> - case BuiltinType::Char32:
>> - case BuiltinType::Int128:
>> - case BuiltinType::UInt128:
>> - return true;
>> +/// TypeInfoIsInStandardLibrary - Given a builtin type, returns whether the type
>> +/// info for that type is defined in the standard library.
>> +static bool TypeInfoIsInStandardLibrary(const BuiltinType *Ty) {
>> + // Itanium C++ ABI 2.9.2:
>> + // Basic type information (e.g. for "int", "bool", etc.) will be kept in
>> + // the run-time support library. Specifically, the run-time support
>> + // library should contain type_info objects for the types X, X* and
>> + // X const*, for every X in: void, std::nullptr_t, bool, wchar_t, char,
>> + // unsigned char, signed char, short, unsigned short, int, unsigned int,
>> + // long, unsigned long, long long, unsigned long long, float, double,
>> + // long double, char16_t, char32_t, and the IEEE 754r decimal and
>> + // half-precision floating point types.
>> + switch (Ty->getKind()) {
>> + case BuiltinType::Void:
>> + case BuiltinType::NullPtr:
>> + case BuiltinType::Bool:
>> + case BuiltinType::WChar_S:
>> + case BuiltinType::WChar_U:
>> + case BuiltinType::Char_U:
>> + case BuiltinType::Char_S:
>> + case BuiltinType::UChar:
>> + case BuiltinType::SChar:
>> + case BuiltinType::Short:
>> + case BuiltinType::UShort:
>> + case BuiltinType::Int:
>> + case BuiltinType::UInt:
>> + case BuiltinType::Long:
>> + case BuiltinType::ULong:
>> + case BuiltinType::LongLong:
>> + case BuiltinType::ULongLong:
>> + case BuiltinType::Half:
>> + case BuiltinType::Float:
>> + case BuiltinType::Double:
>> + case BuiltinType::LongDouble:
>> + case BuiltinType::Char16:
>> + case BuiltinType::Char32:
>> + case BuiltinType::Int128:
>> + case BuiltinType::UInt128:
>> + case BuiltinType::OCLImage1d:
>> + case BuiltinType::OCLImage1dArray:
>> + case BuiltinType::OCLImage1dBuffer:
>> + case BuiltinType::OCLImage2d:
>> + case BuiltinType::OCLImage2dArray:
>> + case BuiltinType::OCLImage3d:
>> + return true;
>
> This change is wrong. If you add types here, you must also add them to
> EmitFundamentalRTTIDescriptor:
>
> [...]
>> -void CodeGenModule::EmitFundamentalRTTIDescriptor(QualType Type) {
>> - QualType PointerType = Context.getPointerType(Type);
>> - QualType PointerTypeConst = Context.getPointerType(Type.withConst());
>> - RTTIBuilder(*this).BuildTypeInfo(Type, true);
>> - RTTIBuilder(*this).BuildTypeInfo(PointerType, true);
>> - RTTIBuilder(*this).BuildTypeInfo(PointerTypeConst, true);
>> -}
>> -
>> -void CodeGenModule::EmitFundamentalRTTIDescriptors() {
>> - QualType FundamentalTypes[] = { Context.VoidTy, Context.NullPtrTy,
>> - Context.BoolTy, Context.WCharTy,
>> - Context.CharTy, Context.UnsignedCharTy,
>> - Context.SignedCharTy, Context.ShortTy,
>> - Context.UnsignedShortTy, Context.IntTy,
>> - Context.UnsignedIntTy, Context.LongTy,
>> - Context.UnsignedLongTy, Context.LongLongTy,
>> - Context.UnsignedLongLongTy, Context.FloatTy,
>> - Context.DoubleTy, Context.LongDoubleTy,
>> - Context.Char16Ty, Context.Char32Ty };
>> - for (unsigned i = 0; i < sizeof(FundamentalTypes)/sizeof(QualType); ++i)
>> - EmitFundamentalRTTIDescriptor(FundamentalTypes[i]);
>> -}
>
> Should these type descriptors be part of the C++ ABI library or not? I
> would suspect not, as GCC does not do so.
More information about the cfe-commits
mailing list