llvm-project/clang/lib
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
..
ARCMigrate [arcmt] Copy the diagnostics so we don't have to worry about invaliding iterators from the diagnostic list. 2013-04-01 21:12:30 +00:00
AST <rdar://problem/12806802> Propagate access specifiers for conversion functions to the conversion function set eagerly. 2013-04-08 17:12:58 +00:00
ASTMatchers Implements memoization for ancestor matching. 2013-03-14 16:33:21 +00:00
Analysis Thread safety analysis: turn on checking within lock and unlock functions. 2013-04-08 20:11:11 +00:00
Basic The PNaCl target no longer permits __attribute__((regparm)). 2013-04-08 21:31:01 +00:00
CodeGen Don't copy just to capture a strong block pointer under ARC. 2013-04-08 23:27:49 +00:00
Driver [analyzer] Re-enable cplusplus.NewDelete (but not NewDeleteLeaks). 2013-04-05 17:55:07 +00:00
Edit [objcmt] Fix a mishandled conversion to objc directory literal. 2013-04-06 01:13:17 +00:00
Format Recognize function-like macro usages without semicolon in declaration context. 2013-04-08 22:16:06 +00:00
Frontend <rdar://problem/13559825> Further reduce template instantiation depth down to 256, since we're blowing the stack for a trivial "factorial" class template. 2013-04-08 21:13:13 +00:00
FrontendTool <rdar://problem/13509689> Introduce -module-file-info option that provides information about a particular module file. 2013-03-27 16:47:18 +00:00
Headers Add tests that build modules for our builtin headers, and fix two buglets exposed by doing so. 2013-04-04 02:55:24 +00:00
Lex [preprocessor] Minor optimization following r178671. 2013-04-03 21:29:07 +00:00
Parse <rdar://problem/13540921> Fix a crasher when an Objective-C for-in loop gets a non-variable iteration declaration. 2013-04-08 20:52:24 +00:00
Rewrite Add 178663 back. 2013-04-03 19:27:57 +00:00
Sema When checking for illegal expressions in a default-argument 2013-04-09 01:56:28 +00:00
Serialization Pare back r164351 somewhat. The problem that change was addressing was that we 2013-04-03 22:49:41 +00:00
StaticAnalyzer [analyzer] Replace isIntegerType() with isIntegerOrEnumerationType(). 2013-04-09 02:30:33 +00:00
Tooling ClangTool output cleanup 2013-03-15 20:14:01 +00:00
CMakeLists.txt Initial version of formatting library. 2012-12-03 18:12:45 +00:00
Makefile Dont use/link ARCMT, StaticAnalyzer and Rewriter to clang when the user 2012-12-13 16:09:42 +00:00