summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2016-02-03 01:32:42 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2016-02-03 01:32:42 +0000
commit4a38201176fc8e8822fbdace03bb98ee75cac82a (patch)
treecb20281460b6c1a532c2c3f887bdc126617e57cc /clang/lib/CodeGen
parenteb959722a70c76af559f673806253bff4a2a4d6e (diff)
downloadbcm5719-llvm-4a38201176fc8e8822fbdace03bb98ee75cac82a.tar.gz
bcm5719-llvm-4a38201176fc8e8822fbdace03bb98ee75cac82a.zip
Fix Itanium RTTI emission so that we emit fundamental type information into the
C++ ABI library for the same set of types for which we expect the C++ ABI library to provide the RTTI. Specifically: 1) __int128 and unsigned __int128 are now emitted into the ABI library. We always expected them to be there but never actually made sure to emit them. 2) Do not expect OpenCL builtin types to have type info in the C++ ABI library. Neither libc++abi nor libstdc++ puts them there when built with either GCC or Clang. This matches GCC's behavior. llvm-svn: 259616
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r--clang/lib/CodeGen/ItaniumCXXABI.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/ItaniumCXXABI.cpp b/clang/lib/CodeGen/ItaniumCXXABI.cpp
index 753bf561e9b..9d7b4da2c53 100644
--- a/clang/lib/CodeGen/ItaniumCXXABI.cpp
+++ b/clang/lib/CodeGen/ItaniumCXXABI.cpp
@@ -2508,6 +2508,11 @@ static bool TypeInfoIsInStandardLibrary(const BuiltinType *Ty) {
// 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.
+ //
+ // GCC also emits RTTI for __int128.
+ // FIXME: We do not emit RTTI information for decimal types here.
+
+ // Types added here must also be added to EmitFundamentalRTTIDescriptors.
switch (Ty->getKind()) {
case BuiltinType::Void:
case BuiltinType::NullPtr:
@@ -2534,6 +2539,8 @@ static bool TypeInfoIsInStandardLibrary(const BuiltinType *Ty) {
case BuiltinType::Char32:
case BuiltinType::Int128:
case BuiltinType::UInt128:
+ return true;
+
case BuiltinType::OCLImage1d:
case BuiltinType::OCLImage1dArray:
case BuiltinType::OCLImage1dBuffer:
@@ -2552,7 +2559,7 @@ static bool TypeInfoIsInStandardLibrary(const BuiltinType *Ty) {
case BuiltinType::OCLQueue:
case BuiltinType::OCLNDRange:
case BuiltinType::OCLReserveID:
- return true;
+ return false;
case BuiltinType::Dependent:
#define BUILTIN_TYPE(Id, SingletonId)
@@ -3344,6 +3351,7 @@ void ItaniumCXXABI::EmitFundamentalRTTIDescriptor(QualType Type) {
}
void ItaniumCXXABI::EmitFundamentalRTTIDescriptors() {
+ // Types added here must also be added to TypeInfoIsInStandardLibrary.
QualType FundamentalTypes[] = {
getContext().VoidTy, getContext().NullPtrTy,
getContext().BoolTy, getContext().WCharTy,
@@ -3352,7 +3360,8 @@ void ItaniumCXXABI::EmitFundamentalRTTIDescriptors() {
getContext().UnsignedShortTy, getContext().IntTy,
getContext().UnsignedIntTy, getContext().LongTy,
getContext().UnsignedLongTy, getContext().LongLongTy,
- getContext().UnsignedLongLongTy, getContext().HalfTy,
+ getContext().UnsignedLongLongTy, getContext().Int128Ty,
+ getContext().UnsignedInt128Ty, getContext().HalfTy,
getContext().FloatTy, getContext().DoubleTy,
getContext().LongDoubleTy, getContext().Char16Ty,
getContext().Char32Ty,
OpenPOWER on IntegriCloud