aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CreateInvocationFromCommandLine.cpp
diff options
context:
space:
mode:
authorDylan Noblesmith <nobled@dreamwidth.org>2011-12-23 03:05:38 +0000
committerDylan Noblesmith <nobled@dreamwidth.org>2011-12-23 03:05:38 +0000
commite99b27f35e802bb3b7ef40068e75f8fb3378c103 (patch)
tree284f9f683aba5f63f5fbc5875a8e8d42981a0c48 /clang/lib/Frontend/CreateInvocationFromCommandLine.cpp
parent5d44a4332a7cc34dbbf91df28fe150e605fb89d7 (diff)
downloadllvm-e99b27f35e802bb3b7ef40068e75f8fb3378c103.zip
llvm-e99b27f35e802bb3b7ef40068e75f8fb3378c103.tar.gz
llvm-e99b27f35e802bb3b7ef40068e75f8fb3378c103.tar.bz2
Let CompilerInvocation initialization indicate failure
This fixes the FIXMEs in ParseAnalyzeArgs. (Also a precursor to moving the analyzer into an AST plugin.) For consistency, do the same with AssemblerInvocation. llvm-svn: 147218
Diffstat (limited to 'clang/lib/Frontend/CreateInvocationFromCommandLine.cpp')
-rw-r--r--clang/lib/Frontend/CreateInvocationFromCommandLine.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/clang/lib/Frontend/CreateInvocationFromCommandLine.cpp b/clang/lib/Frontend/CreateInvocationFromCommandLine.cpp
index e94b944..f7a2961 100644
--- a/clang/lib/Frontend/CreateInvocationFromCommandLine.cpp
+++ b/clang/lib/Frontend/CreateInvocationFromCommandLine.cpp
@@ -80,11 +80,12 @@ clang::createInvocationFromCommandLine(ArrayRef<const char *> ArgList,
}
const driver::ArgStringList &CCArgs = Cmd->getArguments();
- CompilerInvocation *CI = new CompilerInvocation();
- CompilerInvocation::CreateFromArgs(*CI,
+ llvm::OwningPtr<CompilerInvocation> CI(new CompilerInvocation());
+ if (!CompilerInvocation::CreateFromArgs(*CI,
const_cast<const char **>(CCArgs.data()),
const_cast<const char **>(CCArgs.data()) +
CCArgs.size(),
- *Diags);
- return CI;
+ *Diags))
+ return 0;
+ return CI.take();
}