Skip to content

Commit 514a052

Browse files
committed
Drop the original buffer ID from GeneratedSourceInfo.
Nobody is using it, and this information is recoverable from the original source range.
1 parent 5c217bd commit 514a052

File tree

5 files changed

+0
-8
lines changed

5 files changed

+0
-8
lines changed

include/swift/Basic/SourceManager.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,6 @@ class GeneratedSourceInfo {
4141
PrettyPrinted,
4242
} kind;
4343

44-
/// The buffer ID for the enclosing buffer, in which originalSourceRange
45-
/// resides.
46-
unsigned originalBufferID;
47-
4844
/// The source range in the enclosing buffer where this source was generated.
4945
///
5046
/// This could point at a macro expansion or at the implicit location at

lib/AST/DiagnosticEngine.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1241,7 +1241,6 @@ DiagnosticEngine::diagnosticInfoForDiagnostic(const Diagnostic &diagnostic) {
12411241
bufferID,
12421242
GeneratedSourceInfo{
12431243
GeneratedSourceInfo::PrettyPrinted,
1244-
bufferID,
12451244
SourceRange(),
12461245
SourceRange(
12471246
memBufferStartLoc,

lib/IDETool/CompileInstance.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,6 @@ void retypeCheckFunctionBody(AbstractFunctionDecl *func,
193193
sliceBufferID,
194194
GeneratedSourceInfo{
195195
GeneratedSourceInfo::ReplacedFunctionBody,
196-
*func->getParentSourceFile()->getBufferID(),
197196
func->getOriginalBodySourceRange(),
198197
newRange,
199198
func,

lib/IDETool/IDEInspectionInstance.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,6 @@ bool IDEInspectionInstance::performCachedOperationIfPossible(
346346
newBufferID,
347347
GeneratedSourceInfo{
348348
GeneratedSourceInfo::ReplacedFunctionBody,
349-
*AFD->getParentSourceFile()->getBufferID(),
350349
AFD->getOriginalBodySourceRange(),
351350
newBodyRange,
352351
AFD,

lib/Sema/TypeCheckMacros.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,6 @@ Expr *swift::expandMacroExpr(
448448
auto macroBufferRange = sourceMgr.getRangeForBuffer(macroBufferID);
449449
GeneratedSourceInfo sourceInfo{
450450
GeneratedSourceInfo::MacroExpansion,
451-
*sourceFile->getBufferID(),
452451
expr->getSourceRange(),
453452
SourceRange(macroBufferRange.getStart(), macroBufferRange.getEnd()),
454453
ASTNode(expr).getOpaqueValue(),

0 commit comments

Comments
 (0)