diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-02-24 08:42:20 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-02-24 08:42:20 +0000 |
commit | 38c8fe705ec4a8efa8992b99ab6d264fff14ca36 (patch) | |
tree | 8479708c5dfc117fd5e11d9f6ba8dcee70799a37 /lib/Frontend/CompilerInvocation.cpp | |
parent | 8be5b3aced37e1c7728741c60d47011f11649a58 (diff) |
Allow passing a list of comma separated checker names to -analyzer-checker, e.g:
-analyzer-checker=cocoa,unix
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126372 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/CompilerInvocation.cpp')
-rw-r--r-- | lib/Frontend/CompilerInvocation.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/Frontend/CompilerInvocation.cpp b/lib/Frontend/CompilerInvocation.cpp index 026508ac0e..c90ac70628 100644 --- a/lib/Frontend/CompilerInvocation.cpp +++ b/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<llvm::StringRef, 4> checkers; + checkerList.split(checkers, ","); + for (unsigned i = 0, e = checkers.size(); i != e; ++i) + Opts.CheckersControlList.push_back(std::make_pair(checkers[i], enable)); } } |