Add more information to backtraces from the LoadableByAddress pass

Should not change functionality outside of displaying more information in backtraces.
This commit is contained in:
Arnold Schwaighofer
2025-10-23 08:57:21 -07:00
parent 412fffce7d
commit 78a3393f72

View File

@@ -26,6 +26,7 @@
#include "swift/Basic/Assertions.h"
#include "swift/IRGen/IRGenSILPasses.h"
#include "swift/SIL/DebugUtils.h"
#include "swift/SIL/PrettyStackTrace.h"
#include "swift/SIL/SILArgument.h"
#include "swift/SIL/SILBuilder.h"
#include "swift/SIL/SILCloner.h"
@@ -1914,6 +1915,8 @@ static void allocateAndSetAll(StructLoweringState &pass,
LoadableStorageAllocation &allocator,
SILInstruction *user,
MutableArrayRef<Operand> operands) {
PrettyStackTraceSILNode backtrace("Running allocateAndSetAll on ", user);
for (Operand &operand : operands) {
SILValue value = operand.get();
SILType silType = value->getType();
@@ -2424,6 +2427,8 @@ static bool rewriteFunctionReturn(StructLoweringState &pass) {
}
void LoadableByAddress::runOnFunction(SILFunction *F) {
PrettyStackTraceSILFunction backtrace("Running LoadableByAddress on ", F);
CanSILFunctionType funcType = F->getLoweredFunctionType();
IRGenModule *currIRMod = getIRGenModule()->IRGen.getGenModule(F);