return llvm::ConstantStruct::getAnon(Fields);
}
+llvm::Constant *CodeGenModule::getAddrOfCXXCatchDescriptor(QualType Ty) {
+ return getCXXABI().getAddrOfCXXCatchDescriptor(Ty);
+}
+
llvm::Constant *CodeGenModule::GetAddrOfRTTIDescriptor(QualType Ty,
bool ForEH) {
// Return a bogus pointer if RTTI is disabled, unless it's for EH.
LangOpts.ObjCRuntime.isGNUFamily())
return ObjCRuntime->GetEHType(Ty);
- return getCXXABI().getAddrOfRTTIDescriptor(Ty, ForEH);
+ return getCXXABI().getAddrOfRTTIDescriptor(Ty);
}
void CodeGenModule::EmitOMPThreadPrivateDecl(const OMPThreadPrivateDecl *D) {
void EmitFundamentalRTTIDescriptor(QualType Type);
void EmitFundamentalRTTIDescriptors();
- llvm::Constant *getAddrOfRTTIDescriptor(QualType Ty, bool ForEH) override;
+ llvm::Constant *getAddrOfRTTIDescriptor(QualType Ty) override;
+ llvm::Constant *getAddrOfCXXCatchDescriptor(QualType Ty) {
+ return getAddrOfRTTIDescriptor(Ty);
+ }
bool shouldTypeidBeNullChecked(bool IsDeref, QualType SrcRecordTy) override;
void EmitBadTypeidCall(CodeGenFunction &CGF) override;
ItaniumRTTIBuilder(CXXABI).BuildTypeInfo(QualType(ClassType, 0)));
}
-llvm::Constant *ItaniumCXXABI::getAddrOfRTTIDescriptor(QualType Ty,
- bool ForEH) {
+llvm::Constant *ItaniumCXXABI::getAddrOfRTTIDescriptor(QualType Ty) {
return ItaniumRTTIBuilder(*this).BuildTypeInfo(Ty);
}
llvm::GlobalVariable *getMSCompleteObjectLocator(const CXXRecordDecl *RD,
const VPtrInfo *Info);
- llvm::Constant *getAddrOfRTTIDescriptor(QualType Ty, bool ForEH) override;
+ llvm::Constant *getAddrOfRTTIDescriptor(QualType Ty) override;
+ llvm::Constant *getAddrOfCXXCatchDescriptor(QualType Ty) override;
bool shouldTypeidBeNullChecked(bool IsDeref, QualType SrcRecordTy) override;
void EmitBadTypeidCall(CodeGenFunction &CGF) override;
// Initialize the BaseClassDescriptor.
llvm::Constant *Fields[] = {
ABI.getImageRelativeConstant(
- ABI.getAddrOfRTTIDescriptor(Context.getTypeDeclType(Class.RD),
- /*ForEH=*/false)),
+ ABI.getAddrOfRTTIDescriptor(Context.getTypeDeclType(Class.RD))),
llvm::ConstantInt::get(CGM.IntTy, Class.NumBases),
llvm::ConstantInt::get(CGM.IntTy, Class.OffsetInVBase),
llvm::ConstantInt::get(CGM.IntTy, VBPtrOffset),
return T;
}
-/// \brief Gets a TypeDescriptor. Returns a llvm::Constant * rather than a
-/// llvm::GlobalVariable * because different type descriptors have different
-/// types, and need to be abstracted. They are abstracting by casting the
-/// address to an Int8PtrTy.
-llvm::Constant *MicrosoftCXXABI::getAddrOfRTTIDescriptor(QualType Type,
- bool ForEH) {
+llvm::Constant *MicrosoftCXXABI::getAddrOfCXXCatchDescriptor(QualType Type) {
// TypeDescriptors for exceptions never has qualified pointer types,
// qualifiers are stored seperately in order to support qualification
// conversions.
- if (ForEH) {
- // FIXME: This is only a 50% solution, we need to actually do something with
- // these qualifiers.
- bool IsConst, IsVolatile;
- Type = decomposeTypeForEH(getContext(), Type, IsConst, IsVolatile);
- }
+ bool IsConst, IsVolatile;
+ Type = decomposeTypeForEH(getContext(), Type, IsConst, IsVolatile);
+ return getAddrOfRTTIDescriptor(Type);
+}
+
+/// \brief Gets a TypeDescriptor. Returns a llvm::Constant * rather than a
+/// llvm::GlobalVariable * because different type descriptors have different
+/// types, and need to be abstracted. They are abstracting by casting the
+/// address to an Int8PtrTy.
+llvm::Constant *MicrosoftCXXABI::getAddrOfRTTIDescriptor(QualType Type) {
SmallString<256> MangledName, TypeInfoString;
{
llvm::raw_svector_ostream Out(MangledName);
// The TypeDescriptor is used by the runtime to determine if a catch handler
// is appropriate for the exception object.
- llvm::Constant *TD =
- getImageRelativeConstant(getAddrOfRTTIDescriptor(T, /*ForEH=*/true));
+ llvm::Constant *TD = getImageRelativeConstant(getAddrOfRTTIDescriptor(T));
// The runtime is responsible for calling the copy constructor if the
// exception is caught by value.