case Type::Pointer:
case Type::MemberPointer:
- return BuildTypeInfo(Ty);
-
case Type::FunctionProto:
case Type::FunctionNoProto:
- return BuildSimpleType(Ty, "_ZTVN10__cxxabiv120__function_type_infoE");
+ return BuildTypeInfo(Ty);
+
case Type::ConstantArray:
case Type::IncompleteArray:
case Type::VariableArray:
break;
case Type::MemberPointer:
// abi::__pointer_to_member_type_info
- VtableName = "_ZTVN10__cxxabiv129__pointer_to_member_type_infoE";
+ VtableName = "_ZTVN10__cxxabiv129__pointer_to_member_type_infoE";
break;
+
+ case Type::FunctionNoProto:
+ case Type::FunctionProto:
+ // abi::__function_type_info
+ VtableName = "_ZTVN10__cxxabiv120__function_type_infoE";
}
llvm::Constant *Vtable =
assert(false && "Builtin type info must be in the standard library!");
break;
+ case Type::FunctionNoProto:
+ case Type::FunctionProto:
+ // Itanium C++ ABI 2.9.5p4:
+ // abi::__function_type_info adds no data members to std::type_info;
+ break;
+
case Type::Record: {
const CXXRecordDecl *RD =
cast<CXXRecordDecl>(cast<RecordType>(Ty)->getDecl());
// CHECK: _ZTIN12_GLOBAL__N_11DE = internal constant
// CHECK: _ZTSPN12_GLOBAL__N_11DE = internal constant
// CHECK: _ZTIPN12_GLOBAL__N_11DE = internal constant
+// CHECK: _ZTSFN12_GLOBAL__N_11DEvE = internal constant
+// CHECK: _ZTIFN12_GLOBAL__N_11DEvE = internal constant
+// CHECK: _ZTSFvN12_GLOBAL__N_11DEE = internal constant
+// CHECK: _ZTIFvN12_GLOBAL__N_11DEE = internal constant
+
+// CHECK: _ZTSPFvvE = weak_odr constant
+// CHECK: _ZTSFvvE = weak_odr constant
+// CHECK: _ZTIFvvE = weak_odr
+// CHECK: _ZTIPFvvE = weak_odr constant
// A has no key function, so its RTTI data should be weak_odr.
struct A { };
const std::type_info &t2() {
(void)typeid(const D);
- (void)typeid(D *);
+ (void)typeid(D *);
+ (void)typeid(D (*)());
+ (void)typeid(void (*)(D));
+ // The exception specification is not part of the RTTI descriptor, so it should not have
+ // internal linkage.
+ (void)typeid(void (*)() throw (D));
+
// CHECK: _ZTIN12_GLOBAL__N_11DE to
return typeid(getD());
}