Skip to content

Commit 7c5f8a0

Browse files
committed
[NFC] Const-qualify BasicSourceFileInfo
1 parent d1c7a00 commit 7c5f8a0

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

include/swift/AST/RawComment.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ struct BasicSourceFileInfo {
104104

105105
BasicSourceFileInfo() {}
106106

107-
bool populate(SourceFile *SF);
107+
bool populate(const SourceFile *SF);
108108
};
109109

110110
} // namespace swift

lib/AST/Module.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1536,9 +1536,9 @@ const clang::Module *ModuleDecl::findUnderlyingClangModule() const {
15361536
}
15371537

15381538
void ModuleDecl::collectBasicSourceFileInfo(
1539-
llvm::function_ref<void(const BasicSourceFileInfo &)> callback) {
1540-
for (FileUnit *fileUnit : getFiles()) {
1541-
if (SourceFile *SF = dyn_cast<SourceFile>(fileUnit)) {
1539+
llvm::function_ref<void(const BasicSourceFileInfo &)> callback) const {
1540+
for (const FileUnit *fileUnit : getFiles()) {
1541+
if (const auto *SF = dyn_cast<SourceFile>(fileUnit)) {
15421542
BasicSourceFileInfo info;
15431543
if (info.populate(SF))
15441544
continue;

lib/AST/RawComment.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ CharSourceRange RawComment::getCharSourceRange() {
240240
return CharSourceRange(Start, Length);
241241
}
242242

243-
bool BasicSourceFileInfo::populate(SourceFile *SF) {
243+
bool BasicSourceFileInfo::populate(const SourceFile *SF) {
244244
SourceManager &SM = SF->getASTContext().SourceMgr;
245245

246246
auto filename = SF->getFilename();

0 commit comments

Comments
 (0)