Skip to content

Commit f9ef75f

Browse files
committed
Remove SourceFile::addVisibleDecl.
`SourceFile::addVisibleDecl` is an unnecessary API. It was upstreamed in swiftlang#30821.
1 parent 5d8d8da commit f9ef75f

File tree

3 files changed

+2
-9
lines changed

3 files changed

+2
-9
lines changed

include/swift/AST/SourceFile.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -394,8 +394,6 @@ class SourceFile final : public FileUnit {
394394
void cacheVisibleDecls(SmallVectorImpl<ValueDecl *> &&globals) const;
395395
const SmallVectorImpl<ValueDecl *> &getCachedVisibleDecls() const;
396396

397-
void addVisibleDecl(ValueDecl *decl);
398-
399397
virtual void lookupValue(DeclName name, NLKind lookupKind,
400398
SmallVectorImpl<ValueDecl*> &result) const override;
401399

lib/AST/Module.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2232,11 +2232,6 @@ SourceFile::getCachedVisibleDecls() const {
22322232
return getCache().AllVisibleValues;
22332233
}
22342234

2235-
void SourceFile::addVisibleDecl(ValueDecl *decl) {
2236-
Decls->push_back(decl);
2237-
getCache().AllVisibleValues.push_back(decl);
2238-
}
2239-
22402235
static void performAutoImport(
22412236
SourceFile &SF,
22422237
SourceFile::ImplicitModuleImportKind implicitModuleImportKind) {

lib/SILOptimizer/Utils/Differentiation/LinearMapInfo.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ LinearMapInfo::createBranchingTraceDecl(SILBasicBlock *originalBB,
156156
computeAccessLevel(branchingTraceDecl, original->getEffectiveSymbolLinkage());
157157
branchingTraceDecl->getInterfaceType();
158158
assert(branchingTraceDecl->hasInterfaceType());
159-
file.addVisibleDecl(branchingTraceDecl);
159+
file.addTopLevelDecl(branchingTraceDecl);
160160
// Add basic block enum cases.
161161
for (auto *predBB : originalBB->getPredecessorBlocks()) {
162162
auto bbId = "bb" + std::to_string(predBB->getDebugID());
@@ -226,7 +226,7 @@ LinearMapInfo::createLinearMapStruct(SILBasicBlock *originalBB,
226226
computeAccessLevel(linearMapStruct, original->getEffectiveSymbolLinkage());
227227
linearMapStruct->getInterfaceType();
228228
assert(linearMapStruct->hasInterfaceType());
229-
file.addVisibleDecl(linearMapStruct);
229+
file.addTopLevelDecl(linearMapStruct);
230230
return linearMapStruct;
231231
}
232232

0 commit comments

Comments
 (0)