From 6694ed095d6b27a2c92ec4fd63664fcd88a05749 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Fri, 6 Jan 2017 20:13:35 +0000 Subject: Vendor import of clang trunk r291274: https://llvm.org/svn/llvm-project/cfe/trunk@291274 --- lib/Frontend/CreateInvocationFromCommandLine.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'lib/Frontend/CreateInvocationFromCommandLine.cpp') diff --git a/lib/Frontend/CreateInvocationFromCommandLine.cpp b/lib/Frontend/CreateInvocationFromCommandLine.cpp index 1e9e57afb6bd..16269064b6e1 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 ArgList, - IntrusiveRefCntPtr Diags) { +std::unique_ptr 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 @@ clang::createInvocationFromCommandLine(ArrayRef ArgList, } const ArgStringList &CCArgs = Cmd.getArguments(); - std::unique_ptr CI(new CompilerInvocation()); + auto CI = llvm::make_unique(); if (!CompilerInvocation::CreateFromArgs(*CI, const_cast(CCArgs.data()), const_cast(CCArgs.data()) + CCArgs.size(), *Diags)) return nullptr; - return CI.release(); + return CI; } -- cgit v1.2.3