diff options
author | Mike Stump <mrs@apple.com> | 2009-11-17 02:57:13 +0000 |
---|---|---|
committer | Mike Stump <mrs@apple.com> | 2009-11-17 02:57:13 +0000 |
commit | 21f5d5d74a1d8c750c29e5fc68fb45e4abfbae58 (patch) | |
tree | 205bade1a4bab4c8fbfa8cfebcb51ec6c289874c /lib/CodeGen/CGRtti.cpp | |
parent | c6ea5d4f6e3049617e829e428f78f3d63da2cf52 (diff) |
Add typeinfo support for T* and const T* for all builtin types T.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89030 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGRtti.cpp')
-rw-r--r-- | lib/CodeGen/CGRtti.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/CodeGen/CGRtti.cpp b/lib/CodeGen/CGRtti.cpp index 5ac2095c25..de26f543f6 100644 --- a/lib/CodeGen/CGRtti.cpp +++ b/lib/CodeGen/CGRtti.cpp @@ -253,6 +253,19 @@ public: // We expect all type_info objects for builtin types to be in the library. return BuildTypeRef(Ty); } + + case Type::Pointer: { + QualType PTy = Ty->getPointeeType(); + Qualifiers Q = PTy.getQualifiers(); + Q.removeConst(); + // T* and const T* for all builtin types T are expected in the library. + if (isa<BuiltinType>(PTy) && Q.empty()) + return BuildTypeRef(Ty); + + assert(0 && "typeid expression"); + const llvm::Type *Int8PtrTy = llvm::Type::getInt8PtrTy(VMContext); + return llvm::Constant::getNullValue(Int8PtrTy); + } } } }; |