aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Interpreter/Interpreter.cpp
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2025-05-22 12:44:20 -0700
committerKazu Hirata <kazu@google.com>2025-05-22 12:44:20 -0700
commite2a885537f11f8d9ced1c80c2c90069ab5adeb1d (patch)
treed838fa124762f02c1b2ce921f667beb29acfee7b /clang/lib/Interpreter/Interpreter.cpp
parente23a6921b47d2cfb4d27289149079e9d77aa0560 (diff)
downloadllvm-e2a885537f11f8d9ced1c80c2c90069ab5adeb1d.zip
llvm-e2a885537f11f8d9ced1c80c2c90069ab5adeb1d.tar.gz
llvm-e2a885537f11f8d9ced1c80c2c90069ab5adeb1d.tar.bz2
Revert "[clang] Remove intrusive reference count from `DiagnosticOptions` (#139584)"
This reverts commit 9e306ad4600c4d3392c194a8be88919ee758425c. Multiple builtbot failures have been reported: https://github.com/llvm/llvm-project/pull/139584
Diffstat (limited to 'clang/lib/Interpreter/Interpreter.cpp')
-rw-r--r--clang/lib/Interpreter/Interpreter.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/clang/lib/Interpreter/Interpreter.cpp b/clang/lib/Interpreter/Interpreter.cpp
index 84feff8..4b407a0 100644
--- a/clang/lib/Interpreter/Interpreter.cpp
+++ b/clang/lib/Interpreter/Interpreter.cpp
@@ -95,9 +95,9 @@ CreateCI(const llvm::opt::ArgStringList &Argv) {
// Buffer diagnostics from argument parsing so that we can output them using
// a well formed diagnostic object.
- DiagnosticOptions DiagOpts;
+ IntrusiveRefCntPtr<DiagnosticOptions> DiagOpts = new DiagnosticOptions();
TextDiagnosticBuffer *DiagsBuffer = new TextDiagnosticBuffer;
- DiagnosticsEngine Diags(DiagID, DiagOpts, DiagsBuffer);
+ DiagnosticsEngine Diags(DiagID, &*DiagOpts, DiagsBuffer);
bool Success = CompilerInvocation::CreateFromArgs(
Clang->getInvocation(), llvm::ArrayRef(Argv.begin(), Argv.size()), Diags);
@@ -173,10 +173,10 @@ IncrementalCompilerBuilder::create(std::string TT,
// Buffer diagnostics from argument parsing so that we can output them using a
// well formed diagnostic object.
IntrusiveRefCntPtr<DiagnosticIDs> DiagID(new DiagnosticIDs());
- std::unique_ptr<DiagnosticOptions> DiagOpts =
+ IntrusiveRefCntPtr<DiagnosticOptions> DiagOpts =
CreateAndPopulateDiagOpts(ClangArgv);
TextDiagnosticBuffer *DiagsBuffer = new TextDiagnosticBuffer;
- DiagnosticsEngine Diags(DiagID, *DiagOpts, DiagsBuffer);
+ DiagnosticsEngine Diags(DiagID, &*DiagOpts, DiagsBuffer);
driver::Driver Driver(/*MainBinaryName=*/ClangArgv[0], TT, Diags);
Driver.setCheckInputsExist(false); // the input comes from mem buffers