Added psuedo-constant analysis and integrated it into the false positive...
Added psuedo-constant analysis and integrated it into the false positive reduction stage in IdempotentOperationChecker. - Renamed IdempotentOperationChecker::isConstant to isConstantOrPseudoConstant to better reflect the function - Changed IdempotentOperationChecker::PreVisitBinaryOperator to only run 'CanVary' once on undefined assumptions - Created new PsuedoConstantAnalysis class and added it to AnalysisContext - Changed IdempotentOperationChecker to exploit the new analysis - Updated tests with psuedo-constants - Added check to IdempotentOperationChecker to see if a Decl is const qualified git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111426 91177308-0d34-0410-b5e6-96231b3b80d8
Showing
- include/clang/Analysis/Analyses/PsuedoConstantAnalysis.h 44 additions, 0 deletionsinclude/clang/Analysis/Analyses/PsuedoConstantAnalysis.h
- include/clang/Analysis/AnalysisContext.h 4 additions, 1 deletioninclude/clang/Analysis/AnalysisContext.h
- lib/Analysis/AnalysisContext.cpp 8 additions, 0 deletionslib/Analysis/AnalysisContext.cpp
- lib/Analysis/CMakeLists.txt 1 addition, 0 deletionslib/Analysis/CMakeLists.txt
- lib/Analysis/PsuedoConstantAnalysis.cpp 119 additions, 0 deletionslib/Analysis/PsuedoConstantAnalysis.cpp
- lib/Checker/IdempotentOperationChecker.cpp 37 additions, 15 deletionslib/Checker/IdempotentOperationChecker.cpp
- test/Analysis/constant-folding.c 5 additions, 5 deletionstest/Analysis/constant-folding.c
- test/Analysis/idempotent-operations.c 28 additions, 2 deletionstest/Analysis/idempotent-operations.c
- test/Analysis/null-deref-ps.c 1 addition, 1 deletiontest/Analysis/null-deref-ps.c
lib/Analysis/PsuedoConstantAnalysis.cpp
0 → 100644
Please register or sign in to comment