Skip to content

Commit f176879

Browse files
committed
---
yaml --- r: 343383 b: refs/heads/master-rebranch c: 9249966 h: refs/heads/master i: 343381: 1b768ee 343379: abe9236 343375: 09a9390
1 parent bfd7993 commit f176879

File tree

4 files changed

+6
-34
lines changed

4 files changed

+6
-34
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1455,7 +1455,7 @@ refs/tags/swift-DEVELOPMENT-SNAPSHOT-2019-08-02-a: ddd2b2976aa9bfde5f20fe37f6bd2
14551455
refs/tags/swift-DEVELOPMENT-SNAPSHOT-2019-08-03-a: 171cc166f2abeb5ca2a4003700a8a78a108bd300
14561456
refs/heads/benlangmuir-patch-1: baaebaf39d52f3bf36710d4fe40cf212e996b212
14571457
refs/heads/i-do-redeclare: 8c4e6d5de5c1e3f0a2cedccf319df713ea22c48e
1458-
refs/heads/master-rebranch: d8b745db775a9ebdb93a973e76453a98a3136f3f
1458+
refs/heads/master-rebranch: 9249966b8c829cf210e0bd8652484a7507a005d8
14591459
refs/heads/rdar-53901732: 9bd06af3284e18a109cdbf9aa59d833b24eeca7b
14601460
refs/heads/revert-26776-subst-always-returns-a-type: 1b8e18fdd391903a348970a4c848995d4cdd789c
14611461
refs/heads/tensorflow-merge: 8b854f62f80d4476cb383d43c4aac2001dde3cec

branches/master-rebranch/include/swift/Sema/SourceLoader.h

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,20 @@ class ModuleDecl;
2424
class SourceLoader : public ModuleLoader {
2525
private:
2626
ASTContext &Ctx;
27-
bool SkipBodies;
2827
bool EnableLibraryEvolution;
2928

3029
explicit SourceLoader(ASTContext &ctx,
31-
bool skipBodies,
3230
bool enableResilience,
3331
DependencyTracker *tracker)
3432
: ModuleLoader(tracker), Ctx(ctx),
35-
SkipBodies(skipBodies), EnableLibraryEvolution(enableResilience) {}
33+
EnableLibraryEvolution(enableResilience) {}
3634

3735
public:
3836
static std::unique_ptr<SourceLoader>
39-
create(ASTContext &ctx, bool skipBodies, bool enableResilience,
37+
create(ASTContext &ctx, bool enableResilience,
4038
DependencyTracker *tracker = nullptr) {
4139
return std::unique_ptr<SourceLoader>{
42-
new SourceLoader(ctx, skipBodies, enableResilience, tracker)
40+
new SourceLoader(ctx, enableResilience, tracker)
4341
};
4442
}
4543

branches/master-rebranch/lib/Frontend/Frontend.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -315,12 +315,9 @@ void CompilerInstance::setUpDiagnosticOptions() {
315315

316316
bool CompilerInstance::setUpModuleLoaders() {
317317
if (hasSourceImport()) {
318-
bool immediate = FrontendOptions::isActionImmediate(
319-
Invocation.getFrontendOptions().RequestedAction);
320318
bool enableLibraryEvolution =
321319
Invocation.getFrontendOptions().EnableLibraryEvolution;
322320
Context->addModuleLoader(SourceLoader::create(*Context,
323-
!immediate,
324321
enableLibraryEvolution,
325322
getDependencyTracker()));
326323
}

branches/master-rebranch/lib/Sema/SourceLoader.cpp

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -56,20 +56,6 @@ static FileOrError findModule(ASTContext &ctx, StringRef moduleID,
5656
return make_error_code(std::errc::no_such_file_or_directory);
5757
}
5858

59-
namespace {
60-
61-
/// Don't parse any function bodies except those that are transparent.
62-
class SkipNonTransparentFunctions : public DelayedParsingCallbacks {
63-
bool shouldDelayFunctionBodyParsing(Parser &TheParser,
64-
AbstractFunctionDecl *AFD,
65-
const DeclAttributes &Attrs,
66-
SourceRange BodyRange) override {
67-
return Attrs.hasAttribute<TransparentAttr>();
68-
}
69-
};
70-
71-
} // unnamed namespace
72-
7359
void SourceLoader::collectVisibleTopLevelModuleNames(
7460
SmallVectorImpl<Identifier> &names) const {
7561
// TODO: Implement?
@@ -145,20 +131,11 @@ ModuleDecl *SourceLoader::loadModule(SourceLoc importLoc,
145131
importMod->addFile(*importFile);
146132

147133
bool done;
148-
PersistentParserState persistentState;
149-
SkipNonTransparentFunctions delayCallbacks;
150-
parseIntoSourceFile(*importFile, bufferID, &done, nullptr, &persistentState,
151-
SkipBodies ? &delayCallbacks : nullptr);
134+
parseIntoSourceFile(*importFile, bufferID, &done, nullptr, nullptr, nullptr);
152135
assert(done && "Parser returned early?");
153136
(void)done;
154137

155-
// FIXME: Support recursive definitions in immediate modes by making type
156-
// checking even lazier.
157-
if (SkipBodies)
158-
performNameBinding(*importFile);
159-
else
160-
performTypeChecking(*importFile, persistentState.getTopLevelContext(),
161-
None);
138+
performNameBinding(*importFile);
162139
importMod->setHasResolvedImports();
163140
return importMod;
164141
}

0 commit comments

Comments
 (0)