diff options
author | David Blaikie <dblaikie@gmail.com> | 2017-01-05 22:19:11 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2017-01-05 22:19:11 +0000 |
commit | 9280a857bc4cbd43d597003416805d6e12f33830 (patch) | |
tree | b07ae60f1d8c74749829644f5828b994b6ee4f8a /clang/lib/Frontend/CreateInvocationFromCommandLine.cpp | |
parent | 04cfed9af5dbe5a67a10c8f0cb4bf030ebf41ae4 (diff) | |
download | bcm5719-llvm-9280a857bc4cbd43d597003416805d6e12f33830.tar.gz bcm5719-llvm-9280a857bc4cbd43d597003416805d6e12f33830.zip |
IntrusiveRefCntPtr -> std::shared_ptr for CompilerInvocationBase and CodeCompleteConsumer
llvm-svn: 291184
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 1e9e57afb6b..16269064b6e 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. -CompilerInvocation * -clang::createInvocationFromCommandLine(ArrayRef<const char *> ArgList, - IntrusiveRefCntPtr<DiagnosticsEngine> Diags) { +std::unique_ptr<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 @@ clang::createInvocationFromCommandLine(ArrayRef<const char *> ArgList, } const ArgStringList &CCArgs = Cmd.getArguments(); - std::unique_ptr<CompilerInvocation> CI(new CompilerInvocation()); + auto CI = llvm::make_unique<CompilerInvocation>(); if (!CompilerInvocation::CreateFromArgs(*CI, const_cast<const char **>(CCArgs.data()), const_cast<const char **>(CCArgs.data()) + CCArgs.size(), *Diags)) return nullptr; - return CI.release(); + return CI; } |