summaryrefslogtreecommitdiff
path: root/lib/Frontend/CreateInvocationFromCommandLine.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2017-01-05 22:19:11 +0000
committerDavid Blaikie <dblaikie@gmail.com>2017-01-05 22:19:11 +0000
commit4a854da51bcc2d42866b036bd4d6e14d38b40cec (patch)
tree063039b60b3fba114a4fdd0a000020864b09d60d /lib/Frontend/CreateInvocationFromCommandLine.cpp
parentd65cd1f9424369c4ae7f945fac7fd9e4357451b2 (diff)
downloadclang-4a854da51bcc2d42866b036bd4d6e14d38b40cec.tar.gz
IntrusiveRefCntPtr -> std::shared_ptr for CompilerInvocationBase and CodeCompleteConsumer
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@291184 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/CreateInvocationFromCommandLine.cpp')
-rw-r--r--lib/Frontend/CreateInvocationFromCommandLine.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/Frontend/CreateInvocationFromCommandLine.cpp b/lib/Frontend/CreateInvocationFromCommandLine.cpp
index 1e9e57afb6..16269064b6 100644
--- a/lib/Frontend/CreateInvocationFromCommandLine.cpp
+++ b/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;
}