llvm-project/clang/lib/Checker/GRExprEngineExperimentalChecks.h
Tom Care 3ff08a8e76 Added a path-sensitive idempotent operation checker (-analyzer-idempotent-operation). Finds idempotent and/or tautological operations in a path sensitive context, flagging operations that have no effect or a predictable effect.
Example:
{
int a = 1;
int b = 5;
int c = b / a; // a is 1 on all paths
}

- New IdempotentOperationChecker class
- Moved recursive Stmt functions in r107675 to IdempotentOperationChecker
- Minor refactoring of SVal to allow checking for any integer
- Added command line option for check
- Added basic test cases

llvm-svn: 107706
2010-07-06 21:43:29 +00:00

29 lines
914 B
C++

//=-- GRExprEngineExperimentalChecks.h ------------------------------*- C++ -*-=
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file defines functions to instantiate and register experimental
// checks in GRExprEngine.
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_CLANG_GREXPRENGINE_EXPERIMENTAL_CHECKS
#define LLVM_CLANG_GREXPRENGINE_EXPERIMENTAL_CHECKS
namespace clang {
class GRExprEngine;
void RegisterPthreadLockChecker(GRExprEngine &Eng);
void RegisterMallocChecker(GRExprEngine &Eng);
void RegisterStreamChecker(GRExprEngine &Eng);
void RegisterIdempotentOperationChecker(GRExprEngine &Eng);
} // end clang namespace
#endif