Skip to content

Commit 49fabcd

Browse files
committed
[clang] Count references to DiagnosticOptions atomically
1 parent 511500e commit 49fabcd

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

clang-tools-extra/clangd/Preamble.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,6 @@ buildPreamble(PathRef FileName, CompilerInvocation CI,
673673
// Reset references to ref-counted-ptrs before executing the callbacks, to
674674
// prevent resetting them concurrently.
675675
PreambleDiagsEngine.reset();
676-
CI.DiagnosticOpts.reset();
677676

678677
// When building the AST for the main file, we do want the function
679678
// bodies.

clang/include/clang/Basic/DiagnosticOptions.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ inline DiagnosticLevelMask operator&(DiagnosticLevelMask LHS,
6767
raw_ostream& operator<<(raw_ostream& Out, DiagnosticLevelMask M);
6868

6969
/// Options for controlling the compiler diagnostics engine.
70-
class DiagnosticOptions : public RefCountedBase<DiagnosticOptions>{
70+
class DiagnosticOptions
71+
: public llvm::ThreadSafeRefCountedBase<DiagnosticOptions> {
7172
friend bool ParseDiagnosticArgs(DiagnosticOptions &, llvm::opt::ArgList &,
7273
clang::DiagnosticsEngine *, bool);
7374

0 commit comments

Comments
 (0)