@@ -518,7 +518,7 @@ class MicrosoftCXXABI : public CGCXXABI {
518
518
CGM.IntTy ,
519
519
CGM.IntTy ,
520
520
CGM.IntTy ,
521
- getImageRelativeType (getClassHierarchyDescriptorType ()-> getPointerTo () ),
521
+ getImageRelativeType (CGM. UnqualPtrTy ),
522
522
};
523
523
BaseClassDescriptorType = llvm::StructType::create (
524
524
CGM.getLLVMContext (), FieldTypes, " rtti.BaseClassDescriptor" );
@@ -531,13 +531,8 @@ class MicrosoftCXXABI : public CGCXXABI {
531
531
// Forward-declare RTTIClassHierarchyDescriptor to break a cycle.
532
532
ClassHierarchyDescriptorType = llvm::StructType::create (
533
533
CGM.getLLVMContext (), " rtti.ClassHierarchyDescriptor" );
534
- llvm::Type *FieldTypes[] = {
535
- CGM.IntTy ,
536
- CGM.IntTy ,
537
- CGM.IntTy ,
538
- getImageRelativeType (
539
- getBaseClassDescriptorType ()->getPointerTo ()->getPointerTo ()),
540
- };
534
+ llvm::Type *FieldTypes[] = {CGM.IntTy , CGM.IntTy , CGM.IntTy ,
535
+ getImageRelativeType (CGM.UnqualPtrTy )};
541
536
ClassHierarchyDescriptorType->setBody (FieldTypes);
542
537
return ClassHierarchyDescriptorType;
543
538
}
@@ -552,7 +547,7 @@ class MicrosoftCXXABI : public CGCXXABI {
552
547
CGM.IntTy ,
553
548
CGM.IntTy ,
554
549
getImageRelativeType (CGM.Int8PtrTy ),
555
- getImageRelativeType (getClassHierarchyDescriptorType ()-> getPointerTo () ),
550
+ getImageRelativeType (CGM. UnqualPtrTy ),
556
551
getImageRelativeType (CompleteObjectLocatorType),
557
552
};
558
553
llvm::ArrayRef<llvm::Type *> FieldTypesRef (FieldTypes);
@@ -749,8 +744,7 @@ class MicrosoftCXXABI : public CGCXXABI {
749
744
750
745
llvm::SmallString<23 > CTATypeName (" eh.CatchableTypeArray." );
751
746
CTATypeName += llvm::utostr (NumEntries);
752
- llvm::Type *CTType =
753
- getImageRelativeType (getCatchableTypeType ()->getPointerTo ());
747
+ llvm::Type *CTType = getImageRelativeType (CGM.UnqualPtrTy );
754
748
llvm::Type *FieldTypes[] = {
755
749
CGM.IntTy , // NumEntries
756
750
llvm::ArrayType::get (CTType, NumEntries) // CatchableTypes
@@ -777,7 +771,7 @@ class MicrosoftCXXABI : public CGCXXABI {
777
771
llvm::FunctionCallee getThrowFn () {
778
772
// _CxxThrowException is passed an exception object and a ThrowInfo object
779
773
// which describes the exception.
780
- llvm::Type *Args[] = {CGM.Int8PtrTy , getThrowInfoType ()-> getPointerTo () };
774
+ llvm::Type *Args[] = {CGM.Int8PtrTy , CGM. UnqualPtrTy };
781
775
llvm::FunctionType *FTy =
782
776
llvm::FunctionType::get (CGM.VoidTy , Args, /* isVarArg=*/ false );
783
777
llvm::FunctionCallee Throw =
@@ -909,9 +903,8 @@ void MicrosoftCXXABI::emitVirtualObjectDelete(CodeGenFunction &CGF,
909
903
}
910
904
911
905
void MicrosoftCXXABI::emitRethrow (CodeGenFunction &CGF, bool isNoReturn) {
912
- llvm::Value *Args[] = {
913
- llvm::ConstantPointerNull::get (CGM.Int8PtrTy ),
914
- llvm::ConstantPointerNull::get (getThrowInfoType ()->getPointerTo ())};
906
+ llvm::Value *Args[] = {llvm::ConstantPointerNull::get (CGM.Int8PtrTy ),
907
+ llvm::ConstantPointerNull::get (CGM.UnqualPtrTy )};
915
908
llvm::FunctionCallee Fn = getThrowFn ();
916
909
if (isNoReturn)
917
910
CGF.EmitNoreturnRuntimeCallOrInvoke (Fn, Args);
@@ -1958,13 +1951,13 @@ CGCallee MicrosoftCXXABI::getVirtualFunctionPointer(CodeGenFunction &CGF,
1958
1951
SourceLocation Loc) {
1959
1952
CGBuilderTy &Builder = CGF.Builder ;
1960
1953
1961
- Ty = Ty-> getPointerTo () ;
1954
+ Ty = CGF. UnqualPtrTy ;
1962
1955
Address VPtr =
1963
1956
adjustThisArgumentForVirtualFunctionCall (CGF, GD, This, true );
1964
1957
1965
1958
auto *MethodDecl = cast<CXXMethodDecl>(GD.getDecl ());
1966
- llvm::Value *VTable = CGF. GetVTablePtr (VPtr, Ty-> getPointerTo (),
1967
- MethodDecl->getParent ());
1959
+ llvm::Value *VTable =
1960
+ CGF. GetVTablePtr (VPtr, CGF. UnqualPtrTy , MethodDecl->getParent ());
1968
1961
1969
1962
MicrosoftVTableContext &VFTContext = CGM.getMicrosoftVTableContext ();
1970
1963
MethodVFTableLocation ML = VFTContext.getMethodVFTableLocation (GD);
@@ -2125,9 +2118,9 @@ MicrosoftCXXABI::EmitVirtualMemPtrThunk(const CXXMethodDecl *MD,
2125
2118
2126
2119
// Load the vfptr and then callee from the vftable. The callee should have
2127
2120
// adjusted 'this' so that the vfptr is at offset zero.
2128
- llvm::Type *ThunkPtrTy = ThunkTy-> getPointerTo () ;
2129
- llvm::Value *VTable = CGF. GetVTablePtr (
2130
- getThisAddress (CGF), ThunkPtrTy-> getPointerTo () , MD->getParent ());
2121
+ llvm::Type *ThunkPtrTy = CGF. UnqualPtrTy ;
2122
+ llvm::Value *VTable =
2123
+ CGF. GetVTablePtr ( getThisAddress (CGF), CGF. UnqualPtrTy , MD->getParent ());
2131
2124
2132
2125
llvm::Value *VFuncPtr = CGF.Builder .CreateConstInBoundsGEP1_64 (
2133
2126
ThunkPtrTy, VTable, ML.Index , " vfn" );
@@ -2551,7 +2544,7 @@ static ConstantAddress getInitThreadEpochPtr(CodeGenModule &CGM) {
2551
2544
static llvm::FunctionCallee getInitThreadHeaderFn (CodeGenModule &CGM) {
2552
2545
llvm::FunctionType *FTy =
2553
2546
llvm::FunctionType::get (llvm::Type::getVoidTy (CGM.getLLVMContext ()),
2554
- CGM.IntTy -> getPointerTo () , /* isVarArg=*/ false );
2547
+ CGM.UnqualPtrTy , /* isVarArg=*/ false );
2555
2548
return CGM.CreateRuntimeFunction (
2556
2549
FTy, " _Init_thread_header" ,
2557
2550
llvm::AttributeList::get (CGM.getLLVMContext (),
@@ -2563,7 +2556,7 @@ static llvm::FunctionCallee getInitThreadHeaderFn(CodeGenModule &CGM) {
2563
2556
static llvm::FunctionCallee getInitThreadFooterFn (CodeGenModule &CGM) {
2564
2557
llvm::FunctionType *FTy =
2565
2558
llvm::FunctionType::get (llvm::Type::getVoidTy (CGM.getLLVMContext ()),
2566
- CGM.IntTy -> getPointerTo () , /* isVarArg=*/ false );
2559
+ CGM.UnqualPtrTy , /* isVarArg=*/ false );
2567
2560
return CGM.CreateRuntimeFunction (
2568
2561
FTy, " _Init_thread_footer" ,
2569
2562
llvm::AttributeList::get (CGM.getLLVMContext (),
@@ -2575,7 +2568,7 @@ static llvm::FunctionCallee getInitThreadFooterFn(CodeGenModule &CGM) {
2575
2568
static llvm::FunctionCallee getInitThreadAbortFn (CodeGenModule &CGM) {
2576
2569
llvm::FunctionType *FTy =
2577
2570
llvm::FunctionType::get (llvm::Type::getVoidTy (CGM.getLLVMContext ()),
2578
- CGM.IntTy -> getPointerTo () , /* isVarArg=*/ false );
2571
+ CGM.UnqualPtrTy , /* isVarArg=*/ false );
2579
2572
return CGM.CreateRuntimeFunction (
2580
2573
FTy, " _Init_thread_abort" ,
2581
2574
llvm::AttributeList::get (CGM.getLLVMContext (),
@@ -3157,8 +3150,8 @@ MicrosoftCXXABI::GetVBaseOffsetFromVBPtr(CodeGenFunction &CGF,
3157
3150
VBPtrAlign = CGF.getPointerAlign ();
3158
3151
}
3159
3152
3160
- llvm::Value *VBTable = Builder. CreateAlignedLoad (
3161
- CGM. Int32Ty -> getPointerTo ( 0 ) , VBPtr, VBPtrAlign, " vbtable" );
3153
+ llvm::Value *VBTable =
3154
+ Builder. CreateAlignedLoad (CGM. UnqualPtrTy , VBPtr, VBPtrAlign, " vbtable" );
3162
3155
3163
3156
// Translate from byte offset to table index. It improves analyzability.
3164
3157
llvm::Value *VBTableIndex = Builder.CreateAShr (
@@ -3813,8 +3806,7 @@ MSRTTIBuilder::getBaseClassArray(SmallVectorImpl<MSRTTIClass> &Classes) {
3813
3806
// mode) bytes of padding. We provide a pointer sized amount of padding by
3814
3807
// adding +1 to Classes.size(). The sections have pointer alignment and are
3815
3808
// marked pick-any so it shouldn't matter.
3816
- llvm::Type *PtrType = ABI.getImageRelativeType (
3817
- ABI.getBaseClassDescriptorType ()->getPointerTo ());
3809
+ llvm::Type *PtrType = ABI.getImageRelativeType (CGM.UnqualPtrTy );
3818
3810
auto *ArrType = llvm::ArrayType::get (PtrType, Classes.size () + 1 );
3819
3811
auto *BCA =
3820
3812
new llvm::GlobalVariable (Module, ArrType,
@@ -4360,8 +4352,7 @@ llvm::GlobalVariable *MicrosoftCXXABI::getCatchableTypeArray(QualType T) {
4360
4352
CatchableTypes.insert (getCatchableType (getContext ().VoidPtrTy ));
4361
4353
4362
4354
uint32_t NumEntries = CatchableTypes.size ();
4363
- llvm::Type *CTType =
4364
- getImageRelativeType (getCatchableTypeType ()->getPointerTo ());
4355
+ llvm::Type *CTType = getImageRelativeType (CGM.UnqualPtrTy );
4365
4356
llvm::ArrayType *AT = llvm::ArrayType::get (CTType, NumEntries);
4366
4357
llvm::StructType *CTAType = getCatchableTypeArrayType (NumEntries);
4367
4358
llvm::Constant *Fields[] = {
0 commit comments