summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2009-12-29 20:20:19 +0000
committerAnders Carlsson <andersca@mac.com>2009-12-29 20:20:19 +0000
commit26cf4ab8e2f69b0f2a0ca0acef128dc651e0dbf2 (patch)
tree72c397323d794b2c714c32e2855b94e247e99582 /clang/lib/CodeGen
parent6b37c9e6fcb443fbfac21a284e0e66bfc411facd (diff)
downloadbcm5719-llvm-26cf4ab8e2f69b0f2a0ca0acef128dc651e0dbf2.tar.gz
bcm5719-llvm-26cf4ab8e2f69b0f2a0ca0acef128dc651e0dbf2.zip
Fix function type RTTI linkage and add tests.
llvm-svn: 92266
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r--clang/lib/CodeGen/CGRTTI.cpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/clang/lib/CodeGen/CGRTTI.cpp b/clang/lib/CodeGen/CGRTTI.cpp
index 937a4420ef7..fc1098c9858 100644
--- a/clang/lib/CodeGen/CGRTTI.cpp
+++ b/clang/lib/CodeGen/CGRTTI.cpp
@@ -365,11 +365,10 @@ public:
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:
@@ -681,8 +680,13 @@ void RTTIBuilder::BuildVtablePointer(const Type *Ty) {
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 =
@@ -730,6 +734,12 @@ llvm::Constant *RTTIBuilder::BuildTypeInfo(QualType Ty) {
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());
OpenPOWER on IntegriCloud