File tree Expand file tree Collapse file tree 3 files changed +5
-14
lines changed Expand file tree Collapse file tree 3 files changed +5
-14
lines changed Original file line number Diff line number Diff line change @@ -191,7 +191,7 @@ struct ExplicitModuleInfo {
191
191
// ]
192
192
class ExplicitModuleMapParser {
193
193
public:
194
- ExplicitModuleMapParser (ASTContext &Ctx ) : Ctx(Ctx), Saver(Allocator) {}
194
+ ExplicitModuleMapParser (llvm::BumpPtrAllocator &Allocator ) : Saver(Allocator) {}
195
195
196
196
std::error_code
197
197
parseSwiftExplicitModuleMap (const StringRef fileName,
@@ -201,9 +201,6 @@ class ExplicitModuleMapParser {
201
201
StringRef getScalaNodeText (llvm::yaml::Node *N);
202
202
bool parseSingleModuleEntry (llvm::yaml::Node &node,
203
203
llvm::StringMap<ExplicitModuleInfo> &moduleMap);
204
-
205
- ASTContext &Ctx;
206
- llvm::BumpPtrAllocator Allocator;
207
204
llvm::StringSaver Saver;
208
205
};
209
206
Original file line number Diff line number Diff line change @@ -1513,11 +1513,12 @@ bool InterfaceSubContextDelegateImpl::runInSubCompilerInstance(StringRef moduleN
1513
1513
1514
1514
struct ExplicitSwiftModuleLoader ::Implementation {
1515
1515
ASTContext &Ctx;
1516
+ llvm::BumpPtrAllocator Allocator;
1516
1517
llvm::StringMap<ExplicitModuleInfo> ExplicitModuleMap;
1517
1518
Implementation (ASTContext &Ctx) : Ctx(Ctx) {}
1518
1519
1519
1520
void parseSwiftExplicitModuleMap (StringRef fileName) {
1520
- ExplicitModuleMapParser parser (Ctx );
1521
+ ExplicitModuleMapParser parser (Allocator );
1521
1522
auto result =
1522
1523
parser.parseSwiftExplicitModuleMap (fileName, ExplicitModuleMap);
1523
1524
if (result == std::errc::invalid_argument)
@@ -1587,8 +1588,6 @@ std::error_code ExplicitModuleMapParser::parseSwiftExplicitModuleMap(
1587
1588
}
1588
1589
}
1589
1590
} else {
1590
- Ctx.Diags .diagnose (SourceLoc (), diag::explicit_swift_module_map_corrupted,
1591
- fileName);
1592
1591
return std::make_error_code (std::errc::invalid_argument);
1593
1592
}
1594
1593
}
Original file line number Diff line number Diff line change @@ -102,6 +102,7 @@ class ExternalSwiftModuleStubScanner : public ModuleDependencyScanner {
102
102
// / Scan the given external module map
103
103
void parseExternalModuleMap (StringRef fileName);
104
104
llvm::StringMap<ExplicitModuleInfo> ExternalDependencyModuleMap;
105
+ llvm::BumpPtrAllocator Allocator;
105
106
106
107
public:
107
108
ExternalSwiftModuleStubScanner (ASTContext &ctx, ModuleLoadingMode LoadMode,
@@ -139,17 +140,11 @@ class ExternalSwiftModuleStubScanner : public ModuleDependencyScanner {
139
140
this ->dependencies = std::move (dependencies);
140
141
return std::error_code{};
141
142
}
142
-
143
- public:
144
- static std::unique_ptr<ExternalSwiftModuleStubScanner>
145
- create (ASTContext &ctx, DependencyTracker *tracker,
146
- ModuleLoadingMode loadMode, StringRef ExternalDependencyModuleMap,
147
- bool IgnoreSwiftSourceInfoFile);
148
143
};
149
144
} // namespace
150
145
151
146
void ExternalSwiftModuleStubScanner::parseExternalModuleMap (StringRef fileName) {
152
- ExplicitModuleMapParser parser (Ctx );
147
+ ExplicitModuleMapParser parser (Allocator );
153
148
auto result =
154
149
parser.parseSwiftExplicitModuleMap (fileName, ExternalDependencyModuleMap);
155
150
if (result == std::errc::invalid_argument)
You can’t perform that action at this time.
0 commit comments