From c08d89e6c22aa47f0d7c6310324a24ef7fbb48a1 Mon Sep 17 00:00:00 2001 From: Argyrios Kyrtzidis Date: Thu, 24 Feb 2011 08:42:20 +0000 Subject: Allow passing a list of comma separated checker names to -analyzer-checker, e.g: -analyzer-checker=cocoa,unix llvm-svn: 126372 --- clang/lib/Frontend/CompilerInvocation.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'clang/lib/Frontend/CompilerInvocation.cpp') diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index 026508ac0ea..c90ac70628d 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -891,8 +891,13 @@ static void ParseAnalyzerArgs(AnalyzerOptions &Opts, ArgList &Args, const Arg *A = *it; A->claim(); bool enable = (A->getOption().getID() == OPT_analyzer_checker); - Opts.CheckersControlList.push_back(std::make_pair(A->getValue(Args), - enable)); + // We can have a list of comma separated checker names, e.g: + // '-analyzer-checker=cocoa,unix' + llvm::StringRef checkerList = A->getValue(Args); + llvm::SmallVector checkers; + checkerList.split(checkers, ","); + for (unsigned i = 0, e = checkers.size(); i != e; ++i) + Opts.CheckersControlList.push_back(std::make_pair(checkers[i], enable)); } } -- cgit v1.2.3