diff options
author | Ted Kremenek <kremenek@apple.com> | 2009-11-06 21:51:50 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2009-11-06 21:51:50 +0000 |
commit | 795c611cfa0372f7620aa57df3120550455fa875 (patch) | |
tree | f863e2dd2cdbb79638420a7f5b4a2cd32133f359 /clang/lib/Analysis/VLASizeChecker.cpp | |
parent | 95239110cd49240b36d4922969a6e01220a72906 (diff) | |
download | bcm5719-llvm-795c611cfa0372f7620aa57df3120550455fa875.tar.gz bcm5719-llvm-795c611cfa0372f7620aa57df3120550455fa875.zip |
Make the VLASizeChecker implementation private, and its creation only known to GRExprEngineInternalChecks.cpp.
llvm-svn: 86292
Diffstat (limited to 'clang/lib/Analysis/VLASizeChecker.cpp')
-rw-r--r-- | clang/lib/Analysis/VLASizeChecker.cpp | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/clang/lib/Analysis/VLASizeChecker.cpp b/clang/lib/Analysis/VLASizeChecker.cpp index 6184a77cf39..49e19434cb7 100644 --- a/clang/lib/Analysis/VLASizeChecker.cpp +++ b/clang/lib/Analysis/VLASizeChecker.cpp @@ -12,12 +12,40 @@ // //===----------------------------------------------------------------------===// -#include "clang/Analysis/PathSensitive/Checkers/VLASizeChecker.h" +#include "GRExprEngineInternalChecks.h" +#include "clang/Analysis/PathSensitive/Checker.h" #include "clang/Analysis/PathSensitive/GRExprEngine.h" #include "clang/Analysis/PathSensitive/BugReporter.h" using namespace clang; +namespace { +class VISIBILITY_HIDDEN UndefSizedVLAChecker : public Checker { + BugType *BT; + +public: + UndefSizedVLAChecker() : BT(0) {} + static void *getTag(); + ExplodedNode *CheckType(QualType T, ExplodedNode *Pred, + const GRState *state, Stmt *S, GRExprEngine &Eng); +}; + +class VISIBILITY_HIDDEN ZeroSizedVLAChecker : public Checker { + BugType *BT; + +public: + ZeroSizedVLAChecker() : BT(0) {} + static void *getTag(); + ExplodedNode *CheckType(QualType T, ExplodedNode *Pred, + const GRState *state, Stmt *S, GRExprEngine &Eng); +}; +} // end anonymous namespace + +void clang::RegisterVLASizeChecker(GRExprEngine &Eng) { + Eng.registerCheck(new UndefSizedVLAChecker()); + Eng.registerCheck(new ZeroSizedVLAChecker()); +} + void *UndefSizedVLAChecker::getTag() { static int x = 0; return &x; |