diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-12-23 22:04:40 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-12-23 22:04:40 +0000 |
commit | 247894b36138182c092f111d4e4c1a15e03c194f (patch) | |
tree | ee281fbd3400e6a0c9acc914b3f114b455dc4e78 /clang/lib/CodeGen/CGException.cpp | |
parent | 8135870f2343e54d7c184ac5a5008d0946aa1dd6 (diff) | |
download | bcm5719-llvm-247894b36138182c092f111d4e4c1a15e03c194f.tar.gz bcm5719-llvm-247894b36138182c092f111d4e4c1a15e03c194f.zip |
There is no such thing as typeinfo for a cv-qualified type. Assert
that this is true when mangling, then fix up the various places in
Sema and/or CodeGen that need to remove qualifiers. Addresses a
linking issue when building LLVM with Clang.
llvm-svn: 92064
Diffstat (limited to 'clang/lib/CodeGen/CGException.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGException.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGException.cpp b/clang/lib/CodeGen/CGException.cpp index caf0668d647..30499157f14 100644 --- a/clang/lib/CodeGen/CGException.cpp +++ b/clang/lib/CodeGen/CGException.cpp @@ -367,7 +367,9 @@ void CodeGenFunction::EmitStartEHSpec(const Decl *D) { for (unsigned i = 0; i < Proto->getNumExceptions(); ++i) { QualType Ty = Proto->getExceptionType(i); - llvm::Value *EHType = CGM.GetAddrOfRTTIDescriptor(Ty.getNonReferenceType()); + QualType ExceptType + = Ty.getNonReferenceType().getUnqualifiedType(); + llvm::Value *EHType = CGM.GetAddrOfRTTIDescriptor(ExceptType); SelectorArgs.push_back(EHType); } if (Proto->getNumExceptions()) @@ -506,8 +508,11 @@ void CodeGenFunction::EmitCXXTryStmt(const CXXTryStmt &S) { const CXXCatchStmt *C = S.getHandler(i); VarDecl *CatchParam = C->getExceptionDecl(); if (CatchParam) { + // C++ [except.handle]p3 indicates that top-level cv-qualifiers + // are ignored. + QualType CaughtType = C->getCaughtType().getNonReferenceType(); llvm::Value *EHTypeInfo - = CGM.GetAddrOfRTTIDescriptor(C->getCaughtType().getNonReferenceType()); + = CGM.GetAddrOfRTTIDescriptor(CaughtType.getUnqualifiedType()); SelectorArgs.push_back(EHTypeInfo); } else { // null indicates catch all |