aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Interpreter
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Interpreter')
-rw-r--r--clang/lib/Interpreter/CodeCompletion.cpp14
-rw-r--r--clang/lib/Interpreter/Interpreter.cpp6
2 files changed, 8 insertions, 12 deletions
diff --git a/clang/lib/Interpreter/CodeCompletion.cpp b/clang/lib/Interpreter/CodeCompletion.cpp
index dac3888..dc7030c 100644
--- a/clang/lib/Interpreter/CodeCompletion.cpp
+++ b/clang/lib/Interpreter/CodeCompletion.cpp
@@ -238,11 +238,9 @@ public:
// compiler instance before the super `ExecuteAction` triggers parsing
void IncrementalSyntaxOnlyAction::ExecuteAction() {
CompilerInstance &CI = getCompilerInstance();
- ExternalSource *myExternalSource =
- new ExternalSource(CI.getASTContext(), CI.getFileManager(),
- ParentCI->getASTContext(), ParentCI->getFileManager());
- llvm::IntrusiveRefCntPtr<clang::ExternalASTSource> astContextExternalSource(
- myExternalSource);
+ auto astContextExternalSource = llvm::makeIntrusiveRefCnt<ExternalSource>(
+ CI.getASTContext(), CI.getFileManager(), ParentCI->getASTContext(),
+ ParentCI->getFileManager());
CI.getASTContext().setExternalSource(astContextExternalSource);
CI.getASTContext().getTranslationUnitDecl()->setHasExternalVisibleStorage(
true);
@@ -380,9 +378,9 @@ void ReplCodeCompleter::codeComplete(CompilerInstance *InterpCI,
AU->setOwnsRemappedFileBuffers(false);
AU->CodeComplete(CodeCompletionFileName, 1, Col, RemappedFiles, false, false,
false, consumer,
- std::make_shared<clang::PCHContainerOperations>(), *diag,
- InterpCI->getLangOpts(), AU->getSourceManager(),
- AU->getFileManager(), sd, tb, std::move(Act));
+ std::make_shared<clang::PCHContainerOperations>(), diag,
+ InterpCI->getLangOpts(), AU->getSourceManagerPtr(),
+ AU->getFileManagerPtr(), sd, tb, std::move(Act));
}
} // namespace clang
diff --git a/clang/lib/Interpreter/Interpreter.cpp b/clang/lib/Interpreter/Interpreter.cpp
index 9b71486..5e5ae81 100644
--- a/clang/lib/Interpreter/Interpreter.cpp
+++ b/clang/lib/Interpreter/Interpreter.cpp
@@ -86,7 +86,6 @@ GetCC1Arguments(DiagnosticsEngine *Diagnostics,
static llvm::Expected<std::unique_ptr<CompilerInstance>>
CreateCI(const llvm::opt::ArgStringList &Argv) {
std::unique_ptr<CompilerInstance> Clang(new CompilerInstance());
- IntrusiveRefCntPtr<DiagnosticIDs> DiagID(new DiagnosticIDs());
// Register the support for object-file-wrapped Clang modules.
// FIXME: Clang should register these container operations automatically.
@@ -98,7 +97,7 @@ CreateCI(const llvm::opt::ArgStringList &Argv) {
// a well formed diagnostic object.
DiagnosticOptions DiagOpts;
TextDiagnosticBuffer *DiagsBuffer = new TextDiagnosticBuffer;
- DiagnosticsEngine Diags(DiagID, DiagOpts, DiagsBuffer);
+ DiagnosticsEngine Diags(DiagnosticIDs::create(), DiagOpts, DiagsBuffer);
bool Success = CompilerInvocation::CreateFromArgs(
Clang->getInvocation(), llvm::ArrayRef(Argv.begin(), Argv.size()), Diags);
@@ -174,11 +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 =
CreateAndPopulateDiagOpts(ClangArgv);
TextDiagnosticBuffer *DiagsBuffer = new TextDiagnosticBuffer;
- DiagnosticsEngine Diags(DiagID, *DiagOpts, DiagsBuffer);
+ DiagnosticsEngine Diags(DiagnosticIDs::create(), *DiagOpts, DiagsBuffer);
driver::Driver Driver(/*MainBinaryName=*/ClangArgv[0], TT, Diags);
Driver.setCheckInputsExist(false); // the input comes from mem buffers