mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Merge pull request #42553 from aschwaighofer/irgen_metadata_instantiation_readonly_willreturn
IRGen: Set `readonly` and `willreturn` on meta data instantiation functions
This commit is contained in:
@@ -2276,7 +2276,8 @@ MetadataResponse irgen::emitGenericTypeMetadataAccessFunction(
|
||||
// materialize the nominal type descriptor and call this thunk.
|
||||
auto generateThunkFn = [&IGM,
|
||||
checkPrespecialized](IRGenFunction &subIGF) {
|
||||
subIGF.CurFn->setDoesNotAccessMemory();
|
||||
subIGF.CurFn->setOnlyReadsMemory();
|
||||
subIGF.CurFn->setWillReturn();
|
||||
subIGF.CurFn->setCallingConv(IGM.SwiftCC);
|
||||
IGM.setHasNoFramePointer(subIGF.CurFn);
|
||||
|
||||
@@ -2857,7 +2858,8 @@ emitMetadataAccessByMangledName(IRGenFunction &IGF, CanType type,
|
||||
? "__swift_instantiateConcreteTypeFromMangledNameAbstract"
|
||||
: "__swift_instantiateConcreteTypeFromMangledName";
|
||||
auto generateInstantiationFn = [&IGM, request](IRGenFunction &subIGF) {
|
||||
subIGF.CurFn->setDoesNotAccessMemory();
|
||||
subIGF.CurFn->setOnlyReadsMemory();
|
||||
subIGF.CurFn->setWillReturn();
|
||||
IGM.setHasNoFramePointer(subIGF.CurFn);
|
||||
|
||||
auto params = subIGF.collectParameters();
|
||||
@@ -2960,7 +2962,7 @@ emitMetadataAccessByMangledName(IRGenFunction &IGF, CanType type,
|
||||
llvm::ConstantPointerNull::get(IGM.Int8PtrPtrTy)});
|
||||
}
|
||||
call->setDoesNotThrow();
|
||||
call->setDoesNotAccessMemory();
|
||||
call->setOnlyReadsMemory();
|
||||
call->setCallingConv(IGM.SwiftCC);
|
||||
|
||||
// Store the result back to the cache. Metadata instantiation should
|
||||
@@ -2995,7 +2997,7 @@ emitMetadataAccessByMangledName(IRGenFunction &IGF, CanType type,
|
||||
|
||||
auto call = IGF.Builder.CreateCall(instantiationFn, cache);
|
||||
call->setDoesNotThrow();
|
||||
call->setDoesNotAccessMemory();
|
||||
call->setOnlyReadsMemory();
|
||||
|
||||
auto response = MetadataResponse::forComplete(call);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user