mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[ASTDumper] Respect function body skipping
Avoid parsing a body for e.g `-experimental-skip-all-function-bodies`.
This commit is contained in:
@@ -1561,7 +1561,8 @@ namespace {
|
||||
});
|
||||
}
|
||||
|
||||
if (auto Body = D->getBody(/*canSynthesize=*/ParseIfNeeded)) {
|
||||
auto canParse = ParseIfNeeded && !D->isBodySkipped();
|
||||
if (auto Body = D->getBody(canParse)) {
|
||||
printRec(Body, &D->getASTContext());
|
||||
}
|
||||
}
|
||||
|
||||
6
test/Frontend/dump-parse-skip-function-body.swift
Normal file
6
test/Frontend/dump-parse-skip-function-body.swift
Normal file
@@ -0,0 +1,6 @@
|
||||
// RUN: %target-swift-frontend -dump-parse -experimental-skip-all-function-bodies %s | %FileCheck %s
|
||||
|
||||
func foo() {
|
||||
print("hello")
|
||||
}
|
||||
// CHECK-NOT: brace_stmt
|
||||
Reference in New Issue
Block a user