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. /// forwarded on to IRGen.
ASTStage_t ASTStage = Unprocessed; ASTStage_t ASTStage = Unprocessed;
/// Virtual filenames declared by #sourceLocation(file:) directives in this /// Virtual file paths declared by \c #sourceLocation(file:) declarations in
/// file. /// this source file.
llvm::SmallVector<Located<StringRef>, 0> VirtualFilenames; 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; llvm::StringMap<SourceFilePathInfo> getInfoForUsedFilePaths() const;
SourceFile(ModuleDecl &M, SourceFileKind K, Optional<unsigned> bufferID, SourceFile(ModuleDecl &M, SourceFileKind K, Optional<unsigned> bufferID,

View File

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

View File

@@ -4833,7 +4833,7 @@ ParserStatus Parser::parseLineDirective(bool isLine) {
if (!Filename.hasValue()) if (!Filename.hasValue())
return makeParserError(); return makeParserError();
SourceLoc filenameLoc = consumeToken(tok::string_literal); 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, ",") || if (parseToken(tok::comma, diag::sourceLocation_expected, ",") ||
parseSpecificIdentifier("line", diag::sourceLocation_expected, parseSpecificIdentifier("line", diag::sourceLocation_expected,

View File

@@ -132,7 +132,7 @@ public:
ASTContext &getASTContext() { return M.getASTContext(); } ASTContext &getASTContext() { return M.getASTContext(); }
llvm::StringMap<std::pair<std::string, /*isWinner=*/bool>> llvm::StringMap<std::pair<std::string, /*isWinner=*/bool>>
MagicFileStringsByFilePath; MagicFileStringsByFilePath;
static DeclName getMagicFunctionName(SILDeclRef ref); static DeclName getMagicFunctionName(SILDeclRef ref);
static DeclName getMagicFunctionName(DeclContext *dc); static DeclName getMagicFunctionName(DeclContext *dc);