summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2015-03-15 07:10:01 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2015-03-15 07:10:01 +0000
commitad803d4b7625dbe67381ac8ab35dfeca3e995f51 (patch)
treebc51d60ff004d23201b939b901321b67fca9f76a /clang/lib/CodeGen/CodeGenModule.cpp
parentfb4898e88136c319d949a88b2dde541de8802623 (diff)
downloadbcm5719-llvm-ad803d4b7625dbe67381ac8ab35dfeca3e995f51.tar.gz
bcm5719-llvm-ad803d4b7625dbe67381ac8ab35dfeca3e995f51.zip
MS ABI: Don't use qualified pointee types for 'catch' EH TypeDescriptors
Qualifiers are located next to the TypeDescriptor in order to properly ensure that a pointer type can only be caught by a more qualified catch handler. This means that a catch handler of type 'const int *' requires an RTTI object for 'int *'. We got this correct for 'throw' but not for 'catch'. N.B. We don't currently have the means to store the qualifiers because LLVM's EH strategy is tailored to the Itanium scheme. The Itanium ABI stores qualifiers inside the type descriptor in such a way that the manner of qualification is stored in addition to the pointee type's descriptor. Perhaps the best way of modeling this for the MS ABI is using an aggregate type to bundle the qualifiers with the descriptor? This is tricky because we want to make it clear to the optimization passes which catch handlers invalidate other handlers. My current thoughts on a design for this is along the lines of: { { TypeDescriptor* TD, i32 QualifierFlags }, i32 MiscFlags } The idea is that the inner most aggregate is all that is needed to communicate that one catch handler might supercede another. The 'MiscFlags' field would be used to hold the bitpattern for the notion that the 'catch' handler does not need to invoke a copy-constructor because we are catching by reference. llvm-svn: 232318
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index ac94e57c3e1..29c6872377b 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -3656,7 +3656,7 @@ llvm::Constant *CodeGenModule::GetAddrOfRTTIDescriptor(QualType Ty,
LangOpts.ObjCRuntime.isGNUFamily())
return ObjCRuntime->GetEHType(Ty);
- return getCXXABI().getAddrOfRTTIDescriptor(Ty);
+ return getCXXABI().getAddrOfRTTIDescriptor(Ty, ForEH);
}
void CodeGenModule::EmitOMPThreadPrivateDecl(const OMPThreadPrivateDecl *D) {
OpenPOWER on IntegriCloud