Merge pull request #30395 from brentdax/two-revisions-for-two-revisions-for-slashing

This commit is contained in:
swift-ci
2020-03-17 14:11:02 -07:00
committed by GitHub
4 changed files with 9 additions and 6 deletions

View File

@@ -329,10 +329,13 @@ public:
/// forwarded on to IRGen.
ASTStage_t ASTStage = Unprocessed;
/// Virtual filenames declared by #sourceLocation(file:) directives in this
/// file.
llvm::SmallVector<Located<StringRef>, 0> VirtualFilenames;
/// Virtual file paths declared by \c #sourceLocation(file:) declarations in
/// this source file.
llvm::SmallVector<Located<StringRef>, 0> VirtualFilePaths;
/// Returns information about the file paths used for diagnostics and magic
/// identifiers in this source file, including virtual filenames introduced by
/// \c #sourceLocation(file:) declarations.
llvm::StringMap<SourceFilePathInfo> getInfoForUsedFilePaths() const;
SourceFile(ModuleDecl &M, SourceFileKind K, Optional<unsigned> bufferID,

View File

@@ -1968,7 +1968,7 @@ SourceFile::getInfoForUsedFilePaths() const {
getASTContext().SourceMgr.getLocForBufferStart(BufferID);
}
for (auto &vpath : VirtualFilenames) {
for (auto &vpath : VirtualFilePaths) {
result[vpath.Item].virtualFileLocs.insert(vpath.Loc);
}

View File

@@ -4833,7 +4833,7 @@ ParserStatus Parser::parseLineDirective(bool isLine) {
if (!Filename.hasValue())
return makeParserError();
SourceLoc filenameLoc = consumeToken(tok::string_literal);
SF.VirtualFilenames.emplace_back(*Filename, filenameLoc);
SF.VirtualFilePaths.emplace_back(*Filename, filenameLoc);
if (parseToken(tok::comma, diag::sourceLocation_expected, ",") ||
parseSpecificIdentifier("line", diag::sourceLocation_expected,