Skip to content

Commit d3f7362

Browse files
Merge pull request swiftlang#74854 from adrian-prantl/112122752-6.0
Skip macro-expanded code in the playground transform.
2 parents f5c2d75 + 3acbb6e commit d3f7362

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/Sema/PlaygroundTransform.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -949,7 +949,9 @@ void swift::performPlaygroundTransform(SourceFile &SF, PlaygroundOptionSet Opts)
949949

950950
PreWalkAction walkToDeclPre(Decl *D) override {
951951
if (auto *FD = dyn_cast<AbstractFunctionDecl>(D)) {
952-
if (!FD->isImplicit() && !FD->isBodySkipped()) {
952+
// Skip any functions that do not have user-written source code.
953+
if (!FD->isImplicit() && !FD->isBodySkipped() &&
954+
!FD->isInMacroExpansionInContext()) {
953955
if (BraceStmt *Body = FD->getBody()) {
954956
const ParameterList *PL = FD->getParameters();
955957
Instrumenter I(ctx, FD, RNG, Options, TmpNameIndex);

0 commit comments

Comments
 (0)