mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
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:
@@ -31,6 +31,7 @@
|
||||
#define SWIFT_SIL_FUNCTIONCONVENTIONS_H
|
||||
|
||||
#include "swift/AST/Types.h"
|
||||
#include "swift/Basic/AccessControls.h"
|
||||
#include "swift/SIL/SILArgumentConvention.h"
|
||||
#include "swift/SIL/SILType.h"
|
||||
#include "llvm/Support/ErrorHandling.h"
|
||||
@@ -526,11 +527,9 @@ public:
|
||||
- getNumIndirectSILErrorResults()];
|
||||
}
|
||||
|
||||
/// WARNING: Do not use this from SILGen!
|
||||
/// Use methods such as `isSILIndirect` or query the ParameterInfo instead.
|
||||
///
|
||||
/// Return the SIL argument convention of apply/entry argument at
|
||||
/// the given argument index.
|
||||
SWIFT_UNAVAILABLE_IN_SILGEN_MSG("Use methods such as `isSILIndirect` or query the ParameterInfo instead.")
|
||||
SILArgumentConvention getSILArgumentConvention(unsigned index) const;
|
||||
|
||||
/// Return the SIL type of the apply/entry argument at the given index.
|
||||
|
||||
17
include/swift/SIL/SILGenUtils.h
Normal file
17
include/swift/SIL/SILGenUtils.h
Normal file
@@ -0,0 +1,17 @@
|
||||
//
|
||||
// Created by Kavon Farvardin on 11/19/25.
|
||||
//
|
||||
|
||||
#ifndef SWIFT_SILGENUTILS_H
|
||||
#define SWIFT_SILGENUTILS_H
|
||||
|
||||
#include "swift/SIL/SILValue.h"
|
||||
|
||||
namespace swift {
|
||||
|
||||
// Unsafe access may have invalid storage (e.g. a RawPointer).
|
||||
bool isPossibleUnsafeAccessInvalidStorage(SILValue access, SILFunction *F);
|
||||
|
||||
} // namespace swift
|
||||
|
||||
#endif // SWIFT_SILGENUTILS_H
|
||||
Reference in New Issue
Block a user