Skip to content

Commit 0350023

Browse files
Merge pull request #74848 from adrian-prantl/112122752
Skip macro-expanded code in the playground transform.
2 parents 8455309 + 388bd6e commit 0350023

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
@@ -950,7 +950,9 @@ void swift::performPlaygroundTransform(SourceFile &SF, PlaygroundOptionSet Opts)
950950

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

0 commit comments

Comments
 (0)