From 9f4dbff6669c8037f3b036bcf580d14f1a4f12a5 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Mon, 24 Nov 2014 09:15:30 +0000 Subject: Vendor import of clang RELEASE_350/final tag r216957 (effectively, 3.5.0 release): https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_350/final@216957 --- lib/Frontend/CreateInvocationFromCommandLine.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'lib/Frontend/CreateInvocationFromCommandLine.cpp') diff --git a/lib/Frontend/CreateInvocationFromCommandLine.cpp b/lib/Frontend/CreateInvocationFromCommandLine.cpp index 78f39d4298af7..f2f36e4cacb2f 100644 --- a/lib/Frontend/CreateInvocationFromCommandLine.cpp +++ b/lib/Frontend/CreateInvocationFromCommandLine.cpp @@ -32,7 +32,7 @@ using namespace llvm::opt; CompilerInvocation * clang::createInvocationFromCommandLine(ArrayRef ArgList, IntrusiveRefCntPtr Diags) { - if (!Diags.getPtr()) { + if (!Diags.get()) { // No diagnostics engine was provided, so create our own diagnostics object // with the default options. Diags = CompilerInstance::createDiagnostics(new DiagnosticOptions); @@ -47,17 +47,17 @@ clang::createInvocationFromCommandLine(ArrayRef ArgList, // FIXME: We shouldn't have to pass in the path info. driver::Driver TheDriver("clang", llvm::sys::getDefaultTargetTriple(), - "a.out", *Diags); + *Diags); // Don't check that inputs exist, they may have been remapped. TheDriver.setCheckInputsExist(false); - OwningPtr C(TheDriver.BuildCompilation(Args)); + std::unique_ptr C(TheDriver.BuildCompilation(Args)); // Just print the cc1 options if -### was present. if (C->getArgs().hasArg(driver::options::OPT__HASH_HASH_HASH)) { C->getJobs().Print(llvm::errs(), "\n", true); - return 0; + return nullptr; } // We expect to get back exactly one command job, if we didn't something @@ -68,22 +68,22 @@ clang::createInvocationFromCommandLine(ArrayRef ArgList, llvm::raw_svector_ostream OS(Msg); Jobs.Print(OS, "; ", true); Diags->Report(diag::err_fe_expected_compiler_job) << OS.str(); - return 0; + return nullptr; } const driver::Command *Cmd = cast(*Jobs.begin()); if (StringRef(Cmd->getCreator().getName()) != "clang") { Diags->Report(diag::err_fe_expected_clang_command); - return 0; + return nullptr; } const ArgStringList &CCArgs = Cmd->getArguments(); - OwningPtr CI(new CompilerInvocation()); + std::unique_ptr CI(new CompilerInvocation()); if (!CompilerInvocation::CreateFromArgs(*CI, const_cast(CCArgs.data()), const_cast(CCArgs.data()) + CCArgs.size(), *Diags)) - return 0; - return CI.take(); + return nullptr; + return CI.release(); } -- cgit v1.2.3