[WIP][SourceManager] Reorganize methods for line and column #8203
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Reorganize
SourceManagermethods regarding filename, line and column.https://lists.swift.org/pipermail/swift-dev/Week-of-Mon-20170313/004232.html
The first commit is strictly NFC.
Presumed locations ( respects
#sourceLocationdirective)getBufferIdentifierForLoc(Loc)→getPresumedFilenameForLoc(Loc)getLineAndColumn(Loc)→getPresumedLineAndColumnForLoc(Loc)Physical locations (ignores
#sourceLocationdirective)getIdentifierForBuffer(BufferID)→ ASISnew
getIdentifierForBuffer(Loc)getLineNumber(Loc)→getLineAndColumnInBuffer(Loc).firstresolveFromLineCol(BufferID, Line, Column)→getOffsetForLineAndColumnInBuffer(BufferID, Line, Column)getLocForLineCol(BufferID, Line, Column)→getLocForLineAndColumnInBuffer(BufferID, Line, Column)Audit checklist
ASTScope::printConformanceLookupTable::compareProtocolConformancesDeclContext::printContextGenericSignatureBuilder::RequirementSource::printSingleRawComment::SingleRawComment→ Use physical line and column, modifiedSourceLoc::printLineAndColumnswift::writeEditsInJson→ Use physical filename, asisDiagnosticVerifier::verifyFileSourceManager::GetMessage→ Use presumed filename, line and column, asis.SerializedDiagnosticConsumer::addLocToRecordCommentToXMLConverter::visitDocCommentswift::ide::getLocationInfoswift::ide::reformat(lib/IDE/Formatting.cpp)PrettySourceFileEmission::printIRGenDebugInfo::IRGenDebugInfoindex::indexSourceFileLexer::getLocForStartOfToken→ Unused function, removedParser::parseLineDirective→ Use physical line, asisParser::parseTrailingClosure→ Use physical line, asisParser::parseStmtReturn→ Use physical column, modifiedSILLocation::decodeSILGenFunction::emitLiteral(#filevalue) Use presumed filename, asisSILGenFunction::emitPreconditionOptionalHasValueUse presumed filename and line, modifiedRValueEmitter::visitMagicIdentifierLiteralExpr(#lineand#columnvalue) Use presumed line and column, asisCoverageMapping::emitSourceRegionsNameBinder::addImportFailureDiagnosis::visitApplyExpr→ Use physical line, asisswift::performStmtDiagnostics→ Use physical line and column, modifiedswift::performPCMacroswift::performPlaygroundTransformstatic diagnoseAndMigrateVarParameterToBody→ Use physical line, asisGroupNameCollectorFromJson::getGroupNameInternalEditorDiagConsumer::handleDiagnosticSwiftEditorSyntaxWalker::walkToNodePreSwiftEditorDocument::replaceTextAnnotationPrinter::printLocASTTypePrinter::walkToExprPreASTCommentPrinter::walkToDeclPreUSRPrinter::printLoc