From 81d08294384d968ebbc2d0584d1b987f1a8a01b3 Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Fri, 6 Jan 2017 17:47:10 +0000 Subject: Revert "IntrusiveRefCntPtr -> std::shared_ptr for CompilerInvocationBase and CodeCompleteConsumer" Caused a memory leak reported by asan. Reverting while I investigate. This reverts commit r291184. llvm-svn: 291249 --- clang/lib/Frontend/CreateInvocationFromCommandLine.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'clang/lib/Frontend/CreateInvocationFromCommandLine.cpp') diff --git a/clang/lib/Frontend/CreateInvocationFromCommandLine.cpp b/clang/lib/Frontend/CreateInvocationFromCommandLine.cpp index 16269064..1e9e57a 100644 --- a/clang/lib/Frontend/CreateInvocationFromCommandLine.cpp +++ b/clang/lib/Frontend/CreateInvocationFromCommandLine.cpp @@ -30,9 +30,9 @@ using namespace llvm::opt; /// /// \return A CompilerInvocation, or 0 if none was built for the given /// argument vector. -std::unique_ptr clang::createInvocationFromCommandLine( - ArrayRef ArgList, - IntrusiveRefCntPtr Diags) { +CompilerInvocation * +clang::createInvocationFromCommandLine(ArrayRef ArgList, + IntrusiveRefCntPtr Diags) { if (!Diags.get()) { // No diagnostics engine was provided, so create our own diagnostics object // with the default options. @@ -93,12 +93,12 @@ std::unique_ptr clang::createInvocationFromCommandLine( } const ArgStringList &CCArgs = Cmd.getArguments(); - auto CI = llvm::make_unique(); + std::unique_ptr CI(new CompilerInvocation()); if (!CompilerInvocation::CreateFromArgs(*CI, const_cast(CCArgs.data()), const_cast(CCArgs.data()) + CCArgs.size(), *Diags)) return nullptr; - return CI; + return CI.release(); } -- cgit v1.1