[cfe-commits] r146628 - in /cfe/trunk: lib/StaticAnalyzer/Core/CheckerRegistry.cpp test/Analysis/taint-tester.c

Jordy Rose jediknil at belkadan.com
Mon Dec 19 06:22:49 PST 2011


While it's good to be able to test this properly, checkers shouldn't be order-dependent, right? Or at least not until we have a real way to indicate dependencies. If you switch the order of arguments to -analyzer-checker, does the test break?

(sorry for not just checking this myself; I'm writing this offline and haven't been updating my repo)
Jordy


On Dec 15, 2011, at 8:36, Anna Zaks wrote:

> Author: zaks
> Date: Wed Dec 14 19:36:04 2011
> New Revision: 146628
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=146628&view=rev
> Log:
> [analyzer] Ensure that the order in which checker callbacks are called
> is deterministic.
> 
> Non-determinism was the reason for the test which caused the earlier
> buildbot failures, so re-enable the test.
> 
> Modified:
>    cfe/trunk/lib/StaticAnalyzer/Core/CheckerRegistry.cpp
>    cfe/trunk/test/Analysis/taint-tester.c
> 
> Modified: cfe/trunk/lib/StaticAnalyzer/Core/CheckerRegistry.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Core/CheckerRegistry.cpp?rev=146628&r1=146627&r2=146628&view=diff
> ==============================================================================
> --- cfe/trunk/lib/StaticAnalyzer/Core/CheckerRegistry.cpp (original)
> +++ cfe/trunk/lib/StaticAnalyzer/Core/CheckerRegistry.cpp Wed Dec 14 19:36:04 2011
> @@ -9,12 +9,13 @@
> 
> #include "clang/StaticAnalyzer/Core/CheckerRegistry.h"
> #include "clang/StaticAnalyzer/Core/CheckerOptInfo.h"
> +#include "llvm/ADT/SetVector.h"
> 
> using namespace clang;
> using namespace ento;
> 
> static const char PackageSeparator = '.';
> -typedef llvm::DenseSet<const CheckerRegistry::CheckerInfo *> CheckerInfoSet;
> +typedef llvm::SetVector<const CheckerRegistry::CheckerInfo *> CheckerInfoSet;
> 
> 
> static bool checkerNameLT(const CheckerRegistry::CheckerInfo &a,
> @@ -72,7 +73,7 @@
>     if (opt.isEnabled())
>       collected.insert(&*i);
>     else
> -      collected.erase(&*i);
> +      collected.remove(&*i);
>   }
> }
> 
> 
> Modified: cfe/trunk/test/Analysis/taint-tester.c
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/taint-tester.c?rev=146628&r1=146627&r2=146628&view=diff
> ==============================================================================
> --- cfe/trunk/test/Analysis/taint-tester.c (original)
> +++ cfe/trunk/test/Analysis/taint-tester.c Wed Dec 14 19:36:04 2011
> @@ -1,4 +1,4 @@
> -// RUN: %clang_cc1  -analyze -analyzer-checker=experimental.security.taint,debug.TaintTest %s
> +// RUN: %clang_cc1  -analyze -analyzer-checker=experimental.security.taint,debug.TaintTest %s -verify
> 
> #include <stdarg.h>
> 
> 
> 
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits





More information about the cfe-commits mailing list