SILGen: ban getSILArgumentConvention

This function will give the wrong convention in SILGen when
using -enable-sil-opaque-values. In particular, it will say
arguments are indirect when they are not.
This commit is contained in:
Kavon Farvardin
2025-11-19 14:24:49 -08:00
parent 5e9fba115a
commit 199156b307
8 changed files with 34 additions and 9 deletions

View File

@@ -22,6 +22,7 @@
#include "swift/SIL/SILBridging.h"
#include "swift/SIL/SILInstruction.h"
#include "swift/SIL/SILModule.h"
#include "swift/SIL/SILGenUtils.h"
#include "swift/SIL/SILUndef.h"
#include "swift/SIL/Test.h"
#include "llvm/Support/Debug.h"
@@ -2485,6 +2486,12 @@ void swift::checkSwitchEnumBlockArg(SILPhiArgument *arg) {
}
}
bool swift::isPossibleUnsafeAccessInvalidStorage(SILValue address,
SILFunction *F) {
auto storage = AccessStorage::compute(address);
return storage && !isPossibleFormalAccessStorage(storage, F);
}
bool swift::isPossibleFormalAccessStorage(const AccessStorage &storage,
SILFunction *F) {
switch (storage.getKind()) {