llvm-project/clang/lib/StaticAnalyzer/Checkers
Jordan Rose 61e221f68d [analyzer] Replace isIntegerType() with isIntegerOrEnumerationType().
Previously, the analyzer used isIntegerType() everywhere, which uses the C
definition of "integer". The C++ predicate with the same behavior is
isIntegerOrUnscopedEnumerationType().

However, the analyzer is /really/ using this to ask if it's some sort of
"integrally representable" type, i.e. it should include C++11 scoped
enumerations as well. hasIntegerRepresentation() sounds like the right
predicate, but that includes vectors, which the analyzer represents by its
elements.

This commit audits all uses of isIntegerType() and replaces them with the
general isIntegerOrEnumerationType(), except in some specific cases where
it makes sense to exclude scoped enumerations, or any enumerations. These
cases now use isIntegerOrUnscopedEnumerationType() and getAs<BuiltinType>()
plus BuiltinType::isInteger().

isIntegerType() is hereby banned in the analyzer - lib/StaticAnalysis and
include/clang/StaticAnalysis. :-)

Fixes real assertion failures. PR15703 / <rdar://problem/12350701>

llvm-svn: 179081
2013-04-09 02:30:33 +00:00
..
AnalyzerStatsChecker.cpp Remove the CFGElement "Invalid" state. 2013-02-23 00:29:34 +00:00
ArrayBoundChecker.cpp Replace ProgramPoint llvm::cast support to be well-defined. 2013-02-21 22:23:56 +00:00
ArrayBoundCheckerV2.cpp Include llvm::Optional in clang/Basic/LLVM.h 2013-02-20 22:23:23 +00:00
BasicObjCFoundationChecks.cpp [analyzer] Replace isIntegerType() with isIntegerOrEnumerationType(). 2013-04-09 02:30:33 +00:00
BoolAssignmentChecker.cpp Include llvm::Optional in clang/Basic/LLVM.h 2013-02-20 22:23:23 +00:00
BuiltinFunctionChecker.cpp Replace SVal llvm::cast support to be well-defined. 2013-02-20 05:52:05 +00:00
CMakeLists.txt [analyzer] Rename AttrNonNullChecker -> NonNullParamChecker 2013-03-09 03:23:14 +00:00
CStringChecker.cpp Replace ProgramPoint llvm::cast support to be well-defined. 2013-02-21 22:23:56 +00:00
CStringSyntaxChecker.cpp Sort all of Clang's files under 'lib', and fix up the broken headers 2012-12-04 09:13:33 +00:00
CallAndMessageChecker.cpp [analyzer] Warn when nil receiver results in forming null reference 2013-04-03 19:28:19 +00:00
CastSizeChecker.cpp Sort all of Clang's files under 'lib', and fix up the broken headers 2012-12-04 09:13:33 +00:00
CastToStructChecker.cpp Sort all of Clang's files under 'lib', and fix up the broken headers 2012-12-04 09:13:33 +00:00
CheckObjCDealloc.cpp Sort all of Clang's files under 'lib', and fix up the broken headers 2012-12-04 09:13:33 +00:00
CheckObjCInstMethSignature.cpp Sort all of Clang's files under 'lib', and fix up the broken headers 2012-12-04 09:13:33 +00:00
CheckSecuritySyntaxOnly.cpp [analyzer] Replace isIntegerType() with isIntegerOrEnumerationType(). 2013-04-09 02:30:33 +00:00
CheckSizeofPointer.cpp Sort all of Clang's files under 'lib', and fix up the broken headers 2012-12-04 09:13:33 +00:00
CheckerDocumentation.cpp [analyzer] Document existence of ConstPointerEscape. 2013-03-28 23:15:32 +00:00
Checkers.td [analyzer] Re-enable cplusplus.NewDelete (but not NewDeleteLeaks). 2013-04-05 17:55:07 +00:00
ChrootChecker.cpp Sort all of Clang's files under 'lib', and fix up the broken headers 2012-12-04 09:13:33 +00:00
ClangCheckers.cpp [analyzer] Overhaul of checker registration in preparation for basic plugin support. Removes support for checker groups (we can add them back in later if we decide they are still useful), and -analyzer-checker-help output is a little worse for the time being (no packages). 2011-08-16 21:24:21 +00:00
ClangSACheckers.h Don't include the header outside the include guards, it defeats the purpose of the include guards. 2012-12-17 20:10:49 +00:00
CommonBugCategories.cpp Require that all static analyzer issues have a category. As part of this change, 2012-04-05 20:43:28 +00:00
DeadStoresChecker.cpp Disable dead stores checker for template instantations. Fixes <rdar://problem/13213575>. 2013-02-18 07:18:28 +00:00
DebugCheckers.cpp Sort all of Clang's files under 'lib', and fix up the broken headers 2012-12-04 09:13:33 +00:00
DereferenceChecker.cpp [analyzer] tracking stores/constraints now works for ObjC ivars or struct fields. 2013-02-24 07:21:01 +00:00
DirectIvarAssignment.cpp [analyzer] DirectIvarAssignment: allow suppression annotation on Ivars. 2013-01-17 23:24:58 +00:00
DivZeroChecker.cpp Include llvm::Optional in clang/Basic/LLVM.h 2013-02-20 22:23:23 +00:00
DynamicTypePropagation.cpp [analyzer] Restrict ObjC type inference to methods that have related result type. 2013-02-25 22:10:34 +00:00
ExprInspectionChecker.cpp Replace SVal llvm::cast support to be well-defined. 2013-02-20 05:52:05 +00:00
FixedAddressChecker.cpp Sort all of Clang's files under 'lib', and fix up the broken headers 2012-12-04 09:13:33 +00:00
GenericTaintChecker.cpp Include llvm::Optional in clang/Basic/LLVM.h 2013-02-20 22:23:23 +00:00
IdempotentOperationChecker.cpp [analyzer] Apply the suppression rules to the nil receiver only if the value participates in the computation of the nil we warn about. 2013-03-28 23:15:22 +00:00
InterCheckerAPI.h [analyzer] Fix another false positive in the Malloc Checker, by making 2012-02-17 22:35:31 +00:00
IvarInvalidationChecker.cpp objective-C: synthesize properties in order of their 2013-02-14 22:33:34 +00:00
LLVMConventionsChecker.cpp Sort all of Clang's files under 'lib', and fix up the broken headers 2012-12-04 09:13:33 +00:00
MacOSKeychainAPIChecker.cpp [analyzer] Rename “Mac OS X API”, “Mac OS API” -> “API Misuse (Apple)” 2013-04-03 19:28:22 +00:00
MacOSXAPIChecker.cpp [analyzer] Rename “Mac OS X API”, “Mac OS API” -> “API Misuse (Apple)” 2013-04-03 19:28:22 +00:00
Makefile Clang-side build system infrastructure for multiple tblgens. 2011-10-06 01:52:10 +00:00
MallocChecker.cpp [analyzer] Keep tracking the pointer after the escape to more aggressively report mismatched deallocator 2013-04-09 00:30:28 +00:00
MallocOverflowSecurityChecker.cpp Remove the CFGElement "Invalid" state. 2013-02-23 00:29:34 +00:00
MallocSizeofChecker.cpp [analyzer] Replace isIntegerType() with isIntegerOrEnumerationType(). 2013-04-09 02:30:33 +00:00
NSAutoreleasePoolChecker.cpp Sort all of Clang's files under 'lib', and fix up the broken headers 2012-12-04 09:13:33 +00:00
NSErrorChecker.cpp Include llvm::Optional in clang/Basic/LLVM.h 2013-02-20 22:23:23 +00:00
NoReturnFunctionChecker.cpp Add missing null check. Not sure why my tests passed before. 2013-01-23 21:12:49 +00:00
NonNullParamChecker.cpp [analyzer] Rename AttrNonNullChecker -> NonNullParamChecker 2013-03-09 03:23:14 +00:00
ObjCAtSyncChecker.cpp Replace SVal llvm::cast support to be well-defined. 2013-02-20 05:52:05 +00:00
ObjCContainersASTChecker.cpp Sort all of Clang's files under 'lib', and fix up the broken headers 2012-12-04 09:13:33 +00:00
ObjCContainersChecker.cpp Replace SVal llvm::cast support to be well-defined. 2013-02-20 05:52:05 +00:00
ObjCMissingSuperCallChecker.cpp [analyzer] Fix doc error (wrong param name) in ObjCSuperCallChecker. 2012-12-13 18:26:05 +00:00
ObjCSelfInitChecker.cpp Replace SVal llvm::cast support to be well-defined. 2013-02-20 05:52:05 +00:00
ObjCUnusedIVarsChecker.cpp Rework the traversal of Objective-C categories and extensions to 2013-01-16 23:00:23 +00:00
PointerArithChecker.cpp Sort all of Clang's files under 'lib', and fix up the broken headers 2012-12-04 09:13:33 +00:00
PointerSubChecker.cpp Sort all of Clang's files under 'lib', and fix up the broken headers 2012-12-04 09:13:33 +00:00
PthreadLockChecker.cpp Replace SVal llvm::cast support to be well-defined. 2013-02-20 05:52:05 +00:00
RetainCountChecker.cpp [analyzer] RetainCountChecker: refactor annotation handling. 2013-04-04 22:31:48 +00:00
ReturnPointerRangeChecker.cpp Replace ProgramPoint llvm::cast support to be well-defined. 2013-02-21 22:23:56 +00:00
ReturnUndefChecker.cpp [analyzer] Check for returning null references in ReturnUndefChecker. 2013-03-07 01:23:25 +00:00
SimpleStreamChecker.cpp [analyzer] Add pointer escape type param to checkPointerEscape callback 2013-02-07 23:05:43 +00:00
StackAddrEscapeChecker.cpp [analyzer] StackAddrEscapeChecker: strip qualifiers from temporary types. 2013-02-26 01:21:21 +00:00
StreamChecker.cpp [analyzer] Address a TODO in the StreamChecker; otherwise the output is non-deterministic. 2013-03-15 23:34:31 +00:00
TaintTesterChecker.cpp Sort all of Clang's files under 'lib', and fix up the broken headers 2012-12-04 09:13:33 +00:00
TraversalChecker.cpp [analyzer] Print return values from debug.DumpCalls checker. 2013-03-21 18:16:59 +00:00
UndefBranchChecker.cpp Replace ProgramPoint llvm::cast support to be well-defined. 2013-02-21 22:23:56 +00:00
UndefCapturedBlockVarChecker.cpp [analyzer] Apply the suppression rules to the nil receiver only if the value participates in the computation of the nil we warn about. 2013-03-28 23:15:22 +00:00
UndefResultChecker.cpp Sort all of Clang's files under 'lib', and fix up the broken headers 2012-12-04 09:13:33 +00:00
UndefinedArraySubscriptChecker.cpp [analyzer] Better model for copying of array fields in implicit copy ctors. 2013-04-03 01:39:08 +00:00
UndefinedAssignmentChecker.cpp Sort all of Clang's files under 'lib', and fix up the broken headers 2012-12-04 09:13:33 +00:00
UnixAPIChecker.cpp Include llvm::Optional in clang/Basic/LLVM.h 2013-02-20 22:23:23 +00:00
UnreachableCodeChecker.cpp Remove the CFGElement "Invalid" state. 2013-02-23 00:29:34 +00:00
VLASizeChecker.cpp Replace SVal llvm::cast support to be well-defined. 2013-02-20 05:52:05 +00:00
VirtualCallChecker.cpp Sort all of Clang's files under 'lib', and fix up the broken headers 2012-12-04 09:13:33 +00:00