Skip to content

Commit cee9d0f

Browse files
committed
[ast] Move ActorIsolation::dump out of line so we don't call print in a header.
This works around a layering violation where libSwiftBasic includes parts of the AST even though it shouldn't. (cherry picked from commit 5e6b247)
1 parent 1296393 commit cee9d0f

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

include/swift/AST/ActorIsolation.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -271,10 +271,7 @@ class ActorIsolation {
271271
void printForDiagnostics(llvm::raw_ostream &os,
272272
StringRef openingQuotationMark = "'") const;
273273

274-
SWIFT_DEBUG_DUMP {
275-
print(llvm::dbgs());
276-
llvm::dbgs() << '\n';
277-
}
274+
SWIFT_DEBUG_DUMPER(dump());
278275

279276
// Defined out of line to prevent linker errors since libswiftBasic would
280277
// include this header exascerbating a layering violation where libswiftBasic

lib/AST/TypeCheckRequests.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1784,6 +1784,11 @@ void ActorIsolation::printForSIL(llvm::raw_ostream &os) const {
17841784
llvm_unreachable("Covered switch isn't covered?!");
17851785
}
17861786

1787+
void ActorIsolation::dump() const {
1788+
print(llvm::dbgs());
1789+
llvm::dbgs() << '\n';
1790+
}
1791+
17871792
void ActorIsolation::dumpForDiagnostics() const {
17881793
printForDiagnostics(llvm::dbgs());
17891794
llvm::dbgs() << '\n';

0 commit comments

Comments
 (0)