Skip to content

Commit 0e5813b

Browse files
abrahamcdcjdb
authored andcommitted
[clang][NFC] silences warnings
* removes unused data member `OS` from `SARIFDiagnostic` * flags `Filename` variable as currently unused This is a follow-up to D131632.
1 parent 2f08f84 commit 0e5813b

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

clang/include/clang/Frontend/SARIFDiagnostic.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,6 @@ class SARIFDiagnostic : public DiagnosticRenderer {
5555
StringRef ModuleName) override;
5656

5757
private:
58-
raw_ostream &OS;
59-
6058
// Shared between SARIFDiagnosticPrinter and this renderer.
6159
SarifDocumentWriter *Writer;
6260

clang/lib/Frontend/SARIFDiagnostic.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ namespace clang {
3333
SARIFDiagnostic::SARIFDiagnostic(raw_ostream &OS, const LangOptions &LangOpts,
3434
DiagnosticOptions *DiagOpts,
3535
SarifDocumentWriter *Writer)
36-
: DiagnosticRenderer(LangOpts, DiagOpts), OS(OS), Writer(Writer) {}
36+
: DiagnosticRenderer(LangOpts, DiagOpts), Writer(Writer) {}
3737

3838
// FIXME(llvm-project/issues/57323): Refactor Diagnostic classes.
3939
void SARIFDiagnostic::emitDiagnosticMessage(
@@ -71,7 +71,8 @@ SarifResult SARIFDiagnostic::addLocationToResult(
7171
FileID FID = Loc.getFileID();
7272
if (FID.isValid()) {
7373
if (const FileEntry *FE = Loc.getFileEntry()) {
74-
emitFilename(FE->getName(), Loc.getManager());
74+
[[gnu::unused]] llvm::StringRef Filename =
75+
emitFilename(FE->getName(), Loc.getManager());
7576
// FIXME(llvm-project/issues/57366): File-only locations
7677
}
7778
}

0 commit comments

Comments
 (0)