Skip to content

Commit 3fa4840

Browse files
authored
Merge pull request swiftlang#30395 from brentdax/two-revisions-for-two-revisions-for-slashing
2 parents 4240805 + b65a9c6 commit 3fa4840

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

include/swift/AST/SourceFile.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -329,10 +329,13 @@ class SourceFile final : public FileUnit {
329329
/// forwarded on to IRGen.
330330
ASTStage_t ASTStage = Unprocessed;
331331

332-
/// Virtual filenames declared by #sourceLocation(file:) directives in this
333-
/// file.
334-
llvm::SmallVector<Located<StringRef>, 0> VirtualFilenames;
332+
/// Virtual file paths declared by \c #sourceLocation(file:) declarations in
333+
/// this source file.
334+
llvm::SmallVector<Located<StringRef>, 0> VirtualFilePaths;
335335

336+
/// Returns information about the file paths used for diagnostics and magic
337+
/// identifiers in this source file, including virtual filenames introduced by
338+
/// \c #sourceLocation(file:) declarations.
336339
llvm::StringMap<SourceFilePathInfo> getInfoForUsedFilePaths() const;
337340

338341
SourceFile(ModuleDecl &M, SourceFileKind K, Optional<unsigned> bufferID,

lib/AST/Module.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1968,7 +1968,7 @@ SourceFile::getInfoForUsedFilePaths() const {
19681968
getASTContext().SourceMgr.getLocForBufferStart(BufferID);
19691969
}
19701970

1971-
for (auto &vpath : VirtualFilenames) {
1971+
for (auto &vpath : VirtualFilePaths) {
19721972
result[vpath.Item].virtualFileLocs.insert(vpath.Loc);
19731973
}
19741974

lib/Parse/ParseDecl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4833,7 +4833,7 @@ ParserStatus Parser::parseLineDirective(bool isLine) {
48334833
if (!Filename.hasValue())
48344834
return makeParserError();
48354835
SourceLoc filenameLoc = consumeToken(tok::string_literal);
4836-
SF.VirtualFilenames.emplace_back(*Filename, filenameLoc);
4836+
SF.VirtualFilePaths.emplace_back(*Filename, filenameLoc);
48374837

48384838
if (parseToken(tok::comma, diag::sourceLocation_expected, ",") ||
48394839
parseSpecificIdentifier("line", diag::sourceLocation_expected,

lib/SILGen/SILGen.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ class LLVM_LIBRARY_VISIBILITY SILGenModule : public ASTVisitor<SILGenModule> {
132132
ASTContext &getASTContext() { return M.getASTContext(); }
133133

134134
llvm::StringMap<std::pair<std::string, /*isWinner=*/bool>>
135-
MagicFileStringsByFilePath;
135+
MagicFileStringsByFilePath;
136136

137137
static DeclName getMagicFunctionName(SILDeclRef ref);
138138
static DeclName getMagicFunctionName(DeclContext *dc);

0 commit comments

Comments
 (0)