Skip to content

Commit 240b573

Browse files
committed
WIP
1 parent aafc2a3 commit 240b573

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

include/swift/AST/DiagnosticEngine.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -807,12 +807,12 @@ namespace swift {
807807
static const char *diagnosticStringFor(const DiagID id);
808808

809809
/// If there is no clear .dia file for a diagnostic, put it in the one
810-
/// corresponding to the input file name given here.
810+
/// corresponding to the input buffer ID given here.
811811
/// In particular, in batch mode when a diagnostic is located in
812812
/// a non-primary file, use this affordance to place it in the .dia
813813
/// file for the primary that is currently being worked on.
814814
void setBufferIndirectlyCausingDiagnosticToInput(
815-
StringRef defaultDiagnosticInputFile);
815+
unsigned bufferIDE);
816816
void resetBufferIndirectlyCausingDiagnostic();
817817
SourceLoc getDefaultDiagnosticLoc() const {
818818
return bufferIndirectlyCausingDiagnostic;
@@ -825,10 +825,10 @@ namespace swift {
825825

826826
public:
827827
BufferIndirectlyCausingDiagnosticRAII(DiagnosticEngine &Diags,
828-
StringRef defaultDiagnosticInputFile)
828+
unsigned bufferID)
829829
: Diags(Diags) {
830830
Diags.setBufferIndirectlyCausingDiagnosticToInput(
831-
defaultDiagnosticInputFile);
831+
bufferID);
832832
}
833833
~BufferIndirectlyCausingDiagnosticRAII() {
834834
Diags.resetBufferIndirectlyCausingDiagnostic();

lib/FrontendTool/FrontendTool.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1221,7 +1221,7 @@ static bool performCompileStepsPostSILGen(
12211221

12221222
Optional<BufferIndirectlyCausingDiagnosticRAII> ricd;
12231223
if (auto *SF = MSF.dyn_cast<SourceFile *>())
1224-
ricd.emplace(Context.Diags, SF->getFilename());
1224+
ricd.emplace(Context.Diags, SF->getBufferID());
12251225

12261226
if (Stats)
12271227
countStatsPostSILGen(*Stats, *SM);

lib/Sema/TypeChecker.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ void swift::performTypeChecking(SourceFile &SF, TopLevelContext &TLC,
461461

462462
auto &Ctx = SF.getASTContext();
463463
BufferIndirectlyCausingDiagnosticRAII cpr(SF.getASTContext().Diags,
464-
SF.getFilename());
464+
SF.getBufferID());
465465

466466
// Make sure we have a type checker.
467467
TypeChecker &TC = createTypeChecker(Ctx);

0 commit comments

Comments
 (0)