Keep the memory allocator local to module loaders, instead of module map parser.

This commit is contained in:
Artem Chikin
2020-07-21 13:45:27 -07:00
parent 7a736f6582
commit 1d49d22574
3 changed files with 5 additions and 14 deletions

View File

@@ -191,7 +191,7 @@ struct ExplicitModuleInfo {
// ]
class ExplicitModuleMapParser {
public:
ExplicitModuleMapParser(ASTContext &Ctx) : Ctx(Ctx), Saver(Allocator) {}
ExplicitModuleMapParser(llvm::BumpPtrAllocator &Allocator) : Saver(Allocator) {}
std::error_code
parseSwiftExplicitModuleMap(const StringRef fileName,
@@ -201,9 +201,6 @@ private:
StringRef getScalaNodeText(llvm::yaml::Node *N);
bool parseSingleModuleEntry(llvm::yaml::Node &node,
llvm::StringMap<ExplicitModuleInfo> &moduleMap);
ASTContext &Ctx;
llvm::BumpPtrAllocator Allocator;
llvm::StringSaver Saver;
};