diff options
author | David Blaikie <dblaikie@gmail.com> | 2017-01-06 17:47:10 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2017-01-06 17:47:10 +0000 |
commit | 81d08294384d968ebbc2d0584d1b987f1a8a01b3 (patch) | |
tree | f74908be6ffd56b83252c5430c5b855be2f10c1e /clang/lib/Frontend/CreateInvocationFromCommandLine.cpp | |
parent | 3128d6b520c7c43dacd6efb60464ba5318e88feb (diff) | |
download | llvm-81d08294384d968ebbc2d0584d1b987f1a8a01b3.zip llvm-81d08294384d968ebbc2d0584d1b987f1a8a01b3.tar.gz llvm-81d08294384d968ebbc2d0584d1b987f1a8a01b3.tar.bz2 |
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
Diffstat (limited to 'clang/lib/Frontend/CreateInvocationFromCommandLine.cpp')
-rw-r--r-- | clang/lib/Frontend/CreateInvocationFromCommandLine.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
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<CompilerInvocation> clang::createInvocationFromCommandLine( - ArrayRef<const char *> ArgList, - IntrusiveRefCntPtr<DiagnosticsEngine> Diags) { +CompilerInvocation * +clang::createInvocationFromCommandLine(ArrayRef<const char *> ArgList, + IntrusiveRefCntPtr<DiagnosticsEngine> 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<CompilerInvocation> clang::createInvocationFromCommandLine( } const ArgStringList &CCArgs = Cmd.getArguments(); - auto CI = llvm::make_unique<CompilerInvocation>(); + std::unique_ptr<CompilerInvocation> CI(new CompilerInvocation()); if (!CompilerInvocation::CreateFromArgs(*CI, const_cast<const char **>(CCArgs.data()), const_cast<const char **>(CCArgs.data()) + CCArgs.size(), *Diags)) return nullptr; - return CI; + return CI.release(); } |