Skip to content

Commit 54be4e1

Browse files
authored
[Serialization] Fix one PrettyStackTrace, add another. (#7436)
We want to see /what/ types are failing here.
1 parent a4904be commit 54be4e1

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

lib/Serialization/Deserialization.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4253,7 +4253,7 @@ Type ModuleFile::getType(TypeID TID) {
42534253
}
42544254

42554255
#ifndef NDEBUG
4256-
PrettyStackTraceType(ctx, "deserializing", typeOrOffset.get());
4256+
PrettyStackTraceType trace(ctx, "deserializing", typeOrOffset.get());
42574257
assert(!typeOrOffset.get()->hasError());
42584258
#endif
42594259

lib/Serialization/Serialization.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
#include "swift/AST/GenericEnvironment.h"
2121
#include "swift/AST/Initializer.h"
2222
#include "swift/AST/LinkLibrary.h"
23+
#include "swift/AST/PrettyStackTrace.h"
2324
#include "swift/AST/ProtocolConformance.h"
24-
#include "swift/AST/ASTMangler.h"
2525
#include "swift/AST/RawComment.h"
2626
#include "swift/AST/USRGeneration.h"
2727
#include "swift/Basic/Dwarf.h"
@@ -465,7 +465,10 @@ TypeID Serializer::addTypeRef(Type ty) {
465465
if (!ty)
466466
return 0;
467467

468+
#ifndef NDEBUG
469+
PrettyStackTraceType trace(M->getASTContext(), "serializing", ty);
468470
assert(!ty->hasError() && "Serializing error type");
471+
#endif
469472

470473
auto &id = DeclAndTypeIDs[ty];
471474
if (id.first != 0)

0 commit comments

Comments
 (0)