@@ -78,9 +78,7 @@ class AArch64Arm64ECCallLowering : public ModulePass {
78
78
private:
79
79
int cfguard_module_flag = 0 ;
80
80
FunctionType *GuardFnType = nullptr ;
81
- PointerType *GuardFnPtrType = nullptr ;
82
81
FunctionType *DispatchFnType = nullptr ;
83
- PointerType *DispatchFnPtrType = nullptr ;
84
82
Constant *GuardFnCFGlobal = nullptr ;
85
83
Constant *GuardFnGlobal = nullptr ;
86
84
Constant *DispatchFnGlobal = nullptr ;
@@ -641,7 +639,7 @@ Function *AArch64Arm64ECCallLowering::buildGuestExitThunk(Function *F) {
641
639
GuardFn = GuardFnCFGlobal;
642
640
else
643
641
GuardFn = GuardFnGlobal;
644
- LoadInst *GuardCheckLoad = B.CreateLoad (GuardFnPtrType , GuardFn);
642
+ LoadInst *GuardCheckLoad = B.CreateLoad (PtrTy , GuardFn);
645
643
646
644
// Create new call instruction. The CFGuard check should always be a call,
647
645
// even if the original CallBase is an Invoke or CallBr instruction.
@@ -696,7 +694,7 @@ AArch64Arm64ECCallLowering::buildPatchableThunk(GlobalAlias *UnmangledAlias,
696
694
IRBuilder<> B (BB);
697
695
698
696
// Load the global symbol as a pointer to the check function.
699
- LoadInst *DispatchLoad = B.CreateLoad (DispatchFnPtrType , DispatchFnGlobal);
697
+ LoadInst *DispatchLoad = B.CreateLoad (PtrTy , DispatchFnGlobal);
700
698
701
699
// Create new dispatch call instruction.
702
700
Function *ExitThunk =
@@ -748,7 +746,7 @@ void AArch64Arm64ECCallLowering::lowerCall(CallBase *CB) {
748
746
GuardFn = GuardFnCFGlobal;
749
747
else
750
748
GuardFn = GuardFnGlobal;
751
- LoadInst *GuardCheckLoad = B.CreateLoad (GuardFnPtrType , GuardFn);
749
+ LoadInst *GuardCheckLoad = B.CreateLoad (PtrTy , GuardFn);
752
750
753
751
// Create new call instruction. The CFGuard check should always be a call,
754
752
// even if the original CallBase is an Invoke or CallBr instruction.
@@ -779,15 +777,10 @@ bool AArch64Arm64ECCallLowering::runOnModule(Module &Mod) {
779
777
VoidTy = Type::getVoidTy (M->getContext ());
780
778
781
779
GuardFnType = FunctionType::get (PtrTy, {PtrTy, PtrTy}, false );
782
- GuardFnPtrType = PointerType::get (M->getContext (), 0 );
783
780
DispatchFnType = FunctionType::get (PtrTy, {PtrTy, PtrTy, PtrTy}, false );
784
- DispatchFnPtrType = PointerType::get (M->getContext (), 0 );
785
- GuardFnCFGlobal =
786
- M->getOrInsertGlobal (" __os_arm64x_check_icall_cfg" , GuardFnPtrType);
787
- GuardFnGlobal =
788
- M->getOrInsertGlobal (" __os_arm64x_check_icall" , GuardFnPtrType);
789
- DispatchFnGlobal =
790
- M->getOrInsertGlobal (" __os_arm64x_dispatch_call" , DispatchFnPtrType);
781
+ GuardFnCFGlobal = M->getOrInsertGlobal (" __os_arm64x_check_icall_cfg" , PtrTy);
782
+ GuardFnGlobal = M->getOrInsertGlobal (" __os_arm64x_check_icall" , PtrTy);
783
+ DispatchFnGlobal = M->getOrInsertGlobal (" __os_arm64x_dispatch_call" , PtrTy);
791
784
792
785
// Mangle names of function aliases and add the alias name to
793
786
// arm64ec_unmangled_name metadata to ensure a weak anti-dependency symbol is
0 commit comments