diff options
author | Anders Carlsson <andersca@mac.com> | 2009-12-29 20:20:19 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2009-12-29 20:20:19 +0000 |
commit | 09b6e6e8854cc4a824060101a9633082e55d7a33 (patch) | |
tree | 80558fa82b02403777ad98093ee636a887b4d57c /lib/CodeGen/CGRTTI.cpp | |
parent | 595e290bcb69af7ea053fe43f87701ee761d68d3 (diff) |
Fix function type RTTI linkage and add tests.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92266 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGRTTI.cpp')
-rw-r--r-- | lib/CodeGen/CGRTTI.cpp | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/lib/CodeGen/CGRTTI.cpp b/lib/CodeGen/CGRTTI.cpp index 937a4420ef..fc1098c985 100644 --- a/lib/CodeGen/CGRTTI.cpp +++ b/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()); |