mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[LLDB] Add an API for unregistering MemoryBuffer modules (NFC)
This commit is contained in:
@@ -373,11 +373,14 @@ public:
|
|||||||
/// FIXME: make this an actual import *path* once submodules are designed.
|
/// FIXME: make this an actual import *path* once submodules are designed.
|
||||||
bool registerMemoryBuffer(StringRef importPath,
|
bool registerMemoryBuffer(StringRef importPath,
|
||||||
std::unique_ptr<llvm::MemoryBuffer> input,
|
std::unique_ptr<llvm::MemoryBuffer> input,
|
||||||
llvm::VersionTuple version) {
|
llvm::VersionTuple version);
|
||||||
return MemoryBuffers
|
|
||||||
.insert({importPath, MemoryBufferInfo(std::move(input), version)})
|
/// During the transtion to explicitly tracked module dependencies LLDB may
|
||||||
.second;
|
/// instruct this loader to forget one of the (now redundant) MemoryBuffers
|
||||||
}
|
/// because it found an explicit module file on disk.
|
||||||
|
///
|
||||||
|
/// \return true if the importPath existed.
|
||||||
|
bool unregisterMemoryBuffer(StringRef importPath);
|
||||||
|
|
||||||
void collectVisibleTopLevelModuleNames(
|
void collectVisibleTopLevelModuleNames(
|
||||||
SmallVectorImpl<Identifier> &names) const override {}
|
SmallVectorImpl<Identifier> &names) const override {}
|
||||||
|
|||||||
@@ -1708,6 +1708,19 @@ MemoryBufferSerializedModuleLoader::loadModule(SourceLoc importLoc,
|
|||||||
return M;
|
return M;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool MemoryBufferSerializedModuleLoader::registerMemoryBuffer(
|
||||||
|
StringRef importPath, std::unique_ptr<llvm::MemoryBuffer> input,
|
||||||
|
llvm::VersionTuple version) {
|
||||||
|
return MemoryBuffers
|
||||||
|
.insert({importPath, MemoryBufferInfo(std::move(input), version)})
|
||||||
|
.second;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool MemoryBufferSerializedModuleLoader::unregisterMemoryBuffer(
|
||||||
|
StringRef importPath) {
|
||||||
|
return MemoryBuffers.erase(importPath);
|
||||||
|
}
|
||||||
|
|
||||||
void SerializedModuleLoaderBase::loadExtensions(NominalTypeDecl *nominal,
|
void SerializedModuleLoaderBase::loadExtensions(NominalTypeDecl *nominal,
|
||||||
unsigned previousGeneration) {
|
unsigned previousGeneration) {
|
||||||
for (auto &modulePair : LoadedModuleFiles) {
|
for (auto &modulePair : LoadedModuleFiles) {
|
||||||
|
|||||||
Reference in New Issue
Block a user