PR26449: Fixes for bugs in __builtin_classify_type implementation
authorAndrey Bokhanko <andreybokhanko@gmail.com>
Mon, 15 Feb 2016 10:39:04 +0000 (10:39 +0000)
committerAndrey Bokhanko <andreybokhanko@gmail.com>
Mon, 15 Feb 2016 10:39:04 +0000 (10:39 +0000)
commit5f6588ec2d3f6ef4960afe83280e83f277e13adb
treedf25e04ac7e2f5a9218581612690b9fdfb9f2af1
parent2c2a2f511960b2d0976e471f7990448631120b74
PR26449: Fixes for bugs in __builtin_classify_type implementation

This patch fixes the following bugs in __builtin_classify_type implementation:
1) Support for member functions and fields
2) Same behavior as GCC in C mode (specifically, return integer_type_class for
   enums and pointer_type_class for function pointers and arrays). Behavior in
   C++ mode didn't changed.

Also, it refactors the whole implementation, by replacing a sequence of
if-else-if with a couple of switches.

Differential Revision: http://reviews.llvm.org/D16846

llvm-svn: 260881
clang/lib/AST/ExprConstant.cpp